spawnable tests and hpbar for bebittes
This commit is contained in:
16
Scenes/Player/player.gd
Normal file
16
Scenes/Player/player.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
extends Node2D
|
||||
|
||||
@export var batTemplatePath : PackedScene
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("place_spawnable"):
|
||||
spawnBat()
|
||||
|
||||
func spawnBat():
|
||||
var bat = batTemplatePath.instantiate()
|
||||
bat.global_position = get_global_mouse_position()
|
||||
$"..".add_child(bat)
|
||||
$"../Enemy".add_foe(bat)
|
8
Scenes/Player/player.tscn
Normal file
8
Scenes/Player/player.tscn
Normal file
@@ -0,0 +1,8 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://0onqgygm832d"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scenes/Player/player.gd" id="1_63swt"]
|
||||
[ext_resource type="PackedScene" uid="uid://brnx3xyyd0e71" path="res://Scenes/Spawnables/bat_spawnable.tscn" id="2_fd41r"]
|
||||
|
||||
[node name="Player" type="Node2D"]
|
||||
script = ExtResource("1_63swt")
|
||||
batTemplatePath = ExtResource("2_fd41r")
|
Reference in New Issue
Block a user