gay lover
This commit is contained in:
parent
4ff19610d3
commit
f44f38b58c
9 changed files with 154 additions and 96 deletions
|
|
@ -8,14 +8,19 @@ extends CharacterBody2D
|
|||
@onready var startpos = position
|
||||
|
||||
var can_die = true
|
||||
var can_graze = true
|
||||
var can_shoot = true
|
||||
var can_move = true
|
||||
|
||||
var focused: bool:
|
||||
get(): return Input.is_action_pressed(&"focus")
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
print(can_die)
|
||||
var input_dir = Input.get_vector(&"move_left", &"move_right", &"move_up", &"move_down").sign()
|
||||
velocity = input_dir.normalized() * (move_focused_speed if focused else move_normal_speed)
|
||||
if can_move:
|
||||
velocity = input_dir.normalized() * (move_focused_speed if focused else move_normal_speed)
|
||||
move_and_slide()
|
||||
|
||||
|
||||
|
|
@ -25,17 +30,33 @@ func _on_hurtbox_area_entered(area: Area2D) -> void:
|
|||
%AnimationPlayer.play("respawn")
|
||||
position = startpos
|
||||
CurrentGame.change_lives(-1)
|
||||
can_die = false
|
||||
set_invincible(true)
|
||||
set_disabled(true)
|
||||
|
||||
func gover():
|
||||
print("yeeeowtch!!!")
|
||||
func set_disabled(truefalse: bool):
|
||||
velocity = Vector2.ZERO
|
||||
%HurtboxShape.disabled = truefalse
|
||||
%CollectionShape.disabled = truefalse
|
||||
%GrazeShape.disabled = truefalse
|
||||
can_shoot = !truefalse
|
||||
can_move = !truefalse
|
||||
if truefalse == true:
|
||||
%PlayerBulletEmitter.timer.stop()
|
||||
else:
|
||||
if Input.is_action_pressed("shoot"):
|
||||
%PlayerBulletEmitter.timer.start()
|
||||
%PlayerBulletEmitter._on_timer_timeout()
|
||||
|
||||
func set_immobile(truefalse: bool):
|
||||
can_move = truefalse
|
||||
|
||||
func set_invincible(truefalse: bool):
|
||||
can_die = !truefalse
|
||||
|
||||
func _on_graze_box_area_entered(area: Area2D) -> void:
|
||||
%GrazeParticles.emitting = true
|
||||
CurrentGame.change_graze(1)
|
||||
if !area.grazed && can_graze:
|
||||
area.grazed = true
|
||||
%GrazeSound.play()
|
||||
%GrazeParticles.emitting = true
|
||||
CurrentGame.change_graze(1)
|
||||
|
||||
|
||||
|
||||
func _on_animation_player_animation_finished(anim_name: StringName) -> void:
|
||||
if anim_name == "respawn":
|
||||
can_die = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue