From 6c3432ab13d0644c106b133f83bbf646f8ed1651 Mon Sep 17 00:00:00 2001 From: Logan Date: Mon, 20 Jul 2020 23:55:16 -0500 Subject: [PATCH] Created respawn() function in player --- Player/PlayerVariables.gd | 7 +++++++ magic/Beams/EcoBeam.gd | 1 + magic/Beams/EcoBeam.tscn | 22 ++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 magic/Beams/EcoBeam.gd create mode 100644 magic/Beams/EcoBeam.tscn diff --git a/Player/PlayerVariables.gd b/Player/PlayerVariables.gd index 4392502..fe790ce 100644 --- a/Player/PlayerVariables.gd +++ b/Player/PlayerVariables.gd @@ -4,3 +4,10 @@ var position: Vector2 = Vector2() var health: float = -1 var energy: float = -1 var unlocked: Array = [Globals.Conduit2] + +func respawn(): + health = -1 + energy = -1 + +func reset_magic(): + unlocked = [] diff --git a/magic/Beams/EcoBeam.gd b/magic/Beams/EcoBeam.gd new file mode 100644 index 0000000..e251cf8 --- /dev/null +++ b/magic/Beams/EcoBeam.gd @@ -0,0 +1 @@ +extends Node2D diff --git a/magic/Beams/EcoBeam.tscn b/magic/Beams/EcoBeam.tscn new file mode 100644 index 0000000..7982729 --- /dev/null +++ b/magic/Beams/EcoBeam.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://magic/Projectiles/EcoBeam.png" type="Texture" id=1] +[ext_resource path="res://magic/Beams/EcoBeam.gd" type="Script" id=2] + +[node name="EcoBeam" type="Node2D"] +script = ExtResource( 2 ) + +[node name="Beam" type="Sprite" parent="."] +position = Vector2( 0, -4 ) +texture = ExtResource( 1 ) +centered = false +region_enabled = true +region_rect = Rect2( 0, 0, 8, 8 ) + +[node name="Begin" type="Sprite" parent="."] + +[node name="RayCast2D" type="RayCast2D" parent="."] +enabled = true +cast_to = Vector2( 100, 0 ) + +[node name="End" type="Position2D" parent="."]