come here
This commit is contained in:
parent
fe9f682818
commit
e03cede4bb
6 changed files with 139 additions and 4 deletions
|
@ -4,6 +4,7 @@ var velocity = Vector2.ZERO
|
|||
var is_moving = false
|
||||
var is_holding_shard = true
|
||||
var has_respawned = false
|
||||
var first_lead = true
|
||||
onready var death_particles = $DeathSplatter
|
||||
onready var sprite = $Sprite
|
||||
onready var anims = $AnimationPlayer
|
||||
|
@ -16,6 +17,8 @@ const shard = preload("res://objects/collectibles/shard.tscn")
|
|||
const BloodSpray := preload("res://objects/environment/blood/blood_spray.tscn")
|
||||
#DIALOGUE
|
||||
const here_take_this = preload("res://audio/sounds/msx_here_take_this.wav")
|
||||
const come_here = preload("res://audio/sounds/msx_come_here.ogg")
|
||||
const help_me = preload("res://audio/sounds/msx_help_me_get_outta_here.ogg")
|
||||
|
||||
func _ready():
|
||||
raycast.add_exception($Hitbox)
|
||||
|
@ -31,12 +34,14 @@ func _physics_process(delta):
|
|||
if respawn_raycast.is_colliding():
|
||||
#start moving again after respawning when seeing sg
|
||||
if raycast.get_collider() != null:
|
||||
if first_lead == true: Audio.play_sound(help_me,Audio.ac_voice)
|
||||
first_lead = false
|
||||
if raycast.get_collider().is_in_group("player_hitbox"): is_moving = true
|
||||
velocity.y += 128 * delta
|
||||
velocity = move_and_slide_with_snap(velocity, Vector2.DOWN, Vector2.UP, true)
|
||||
#Anims
|
||||
if velocity.x == 0:
|
||||
if !anims.get_current_animation() == "give" && !anims.get_current_animation() == "respawn" && !anims.get_current_animation() == "blink": anims.play("idle")
|
||||
if !anims.get_current_animation() == "give" && !anims.get_current_animation() == "respawn" && !anims.get_current_animation() == "blink" && !anims.get_current_animation() == "come here": anims.play("idle")
|
||||
else:
|
||||
anims.play("walk")
|
||||
#Stop at the end of path and give shard
|
||||
|
@ -55,8 +60,8 @@ func spawn_shard():
|
|||
is_holding_shard = false
|
||||
|
||||
func switch_action():
|
||||
#is_moving = true
|
||||
pass
|
||||
Audio.play_sound(come_here,Audio.ac_voice)
|
||||
anims.play("come here")
|
||||
|
||||
func spray_blood():
|
||||
for i in 16:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue