From 9ed1eba3fb0e1329c7e2a368d09c92594707d18b Mon Sep 17 00:00:00 2001 From: Logan Date: Tue, 21 Jul 2020 23:27:14 -0500 Subject: [PATCH] Respawn workss --- Player/PlayerVariables.gd | 5 ++++- ai/Scenes/Demon.tscn | 4 +--- ai/Script/Demon.gd | 2 +- levels/Level 1.tscn | 6 +++++- levels/World.tscn | 2 -- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Player/PlayerVariables.gd b/Player/PlayerVariables.gd index ba2b79f..071404b 100644 --- a/Player/PlayerVariables.gd +++ b/Player/PlayerVariables.gd @@ -4,7 +4,7 @@ var position: Vector2 = Vector2() var health = null var energy = null var unlocked: Array = [] -var current_scene: String +var current_scene: String setget set_scene func respawn(): health = null @@ -13,3 +13,6 @@ func respawn(): func reset_magic(): unlocked = [] +func set_scene(new): + print(new) + current_scene = new diff --git a/ai/Scenes/Demon.tscn b/ai/Scenes/Demon.tscn index b336253..ac29307 100644 --- a/ai/Scenes/Demon.tscn +++ b/ai/Scenes/Demon.tscn @@ -5,8 +5,6 @@ [ext_resource path="res://Music and Fonts(Misc.)/Hell Hit.tres" type="Animation" id=3] [ext_resource path="res://Music and Fonts(Misc.)/Ogre Hit.tres" type="Animation" id=4] - - [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 5.06709, 5.78183 ) @@ -26,7 +24,7 @@ tracks/0/keys = { "values": [ 1, 2, 3, 4, 5, 6, 7 ] } -[node name="KinematicBody2D" type="KinematicBody2D"] +[node name="Demon" type="KinematicBody2D"] collision_layer = 4 collision_mask = 11 script = ExtResource( 2 ) diff --git a/ai/Script/Demon.gd b/ai/Script/Demon.gd index b728811..51c0784 100644 --- a/ai/Script/Demon.gd +++ b/ai/Script/Demon.gd @@ -1,6 +1,6 @@ extends Enemy -var Hell_Projectile = preload("res://ai/BadFireball.tscn") +var Hell_Projectile = preload("res://ai/Scenes/DemonFireball.tscn") onready var ShootDelay : Timer = $ShootDelay onready var ProjectileSpawn: Node2D = $Position2D diff --git a/levels/Level 1.tscn b/levels/Level 1.tscn index 19f988d..e9b53fc 100644 --- a/levels/Level 1.tscn +++ b/levels/Level 1.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://meta/DungeonTilemap.tres" type="TileSet" id=1] [ext_resource path="res://art/Paralax Dungeon.png" type="Texture" id=2] [ext_resource path="res://Player/Player.tscn" type="PackedScene" id=3] +[ext_resource path="res://ai/Scenes/Demon.tscn" type="PackedScene" id=4] [node name="Level 1" type="Node"] @@ -25,3 +26,6 @@ centered = false [node name="Player" parent="." instance=ExtResource( 3 )] position = Vector2( 92.1555, 139.436 ) + +[node name="Demon" parent="." instance=ExtResource( 4 )] +position = Vector2( 301, 164 ) diff --git a/levels/World.tscn b/levels/World.tscn index 133843d..22ecee8 100644 --- a/levels/World.tscn +++ b/levels/World.tscn @@ -12,8 +12,6 @@ [ext_resource path="res://art/Mana.png" type="Texture" id=12] [ext_resource path="res://objects/Door.tscn" type="PackedScene" id=13] - - [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 169.977, 24.8286 )