levels
created multiple levels.
This commit is contained in:
1 parent
13ae839b84
commit
12c5da029f
10 files changed
+309
-12
No files matched your search
@@ -4,7 +4,7 @@ extends CharacterBody2D
|
||||
var SPEED = Vector2(5, 0)
|
||||
const JUMP_VELOCITY = -400.0
|
||||
@onready var projectile: PackedScene = preload("res://scenes/core/projectile.tscn")
|
||||
var death_counter = 3
|
||||
var health_counter = 3
|
||||
|
||||
|
||||
|
||||
@@ -16,11 +16,11 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if death_counter == 2:
|
||||
if health_counter == 2:
|
||||
$ColorRect4.hide()
|
||||
if death_counter == 1:
|
||||
if health_counter == 1:
|
||||
$ColorRect3.hide()
|
||||
if death_counter == 0:
|
||||
if health_counter == 0:
|
||||
queue_free()
|
||||
velocity += get_gravity() * delta
|
||||
move_and_slide()
|
||||
@@ -38,9 +38,9 @@ func _on_timer_timeout() -> void:
|
||||
|
||||
func _on_area_2d_area_entered(_area: Area2D) -> void:
|
||||
if GlobalData.hurtable:
|
||||
death_counter -= 1
|
||||
health_counter -= 1
|
||||
elif GlobalData.weapon == 2:
|
||||
death_counter -= 1
|
||||
health_counter -= 1
|
||||
|
||||
func _on_area_2d_body_entered(_body: Node2D) -> void:
|
||||
GlobalData.death_counter -= 1
|
||||
@@ -360,6 +360,8 @@ func _physics_process(delta):
|
||||
slash = -slash
|
||||
GlobalData.hurtable = true
|
||||
$Timer.start()
|
||||
else:
|
||||
GlobalData.hurtable = false
|
||||
|
||||
if GlobalData.doing_puzzle:
|
||||
velocity = Vector2(0, 0)
|
||||
|
||||
@@ -96,6 +96,7 @@ shape = SubResource("RectangleShape2D_aqe1g")
|
||||
|
||||
[node name="Timer" type="Timer" parent="." unique_id=331042830]
|
||||
wait_time = 0.1
|
||||
ignore_time_scale = true
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="." unique_id=354625466]
|
||||
position = Vector2(11, 54)
|
||||
@@ -107,7 +108,7 @@ position = Vector2(107, 48)
|
||||
physics_interpolation_mode = 1
|
||||
top_level = true
|
||||
position = Vector2(5, 5)
|
||||
offset = Vector2(1.7197182, -1.6673563)
|
||||
offset = Vector2(-0.70020235, -0.50523585)
|
||||
|
||||
[node name="PhantomCameraHost" type="Node" parent="Camera2D" unique_id=134961787]
|
||||
process_priority = 300
|
||||
|
||||
Reference in new issue
Block a user