spawnable tests and hpbar for bebittes

This commit is contained in:
Victor Turgeon
2023-10-10 20:26:50 -04:00
parent d518691cea
commit 660c13980f
13 changed files with 113 additions and 20 deletions

16
Scenes/Player/player.gd Normal file
View 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)

View 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")