peeple
This commit is contained in:
parent
941c2a0bed
commit
4f3495d5d4
14 changed files with 615 additions and 0 deletions
14
scripts/fireparticles.gd
Normal file
14
scripts/fireparticles.gd
Normal file
|
@ -0,0 +1,14 @@
|
|||
@tool
|
||||
extends Node3D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
var camera = get_viewport().get_camera_3d()
|
||||
if camera == null: return
|
||||
$smoke.set_global_rotation(get_global_rotation().direction_to(camera.get_global_position()))
|
32
scripts/person.gd
Normal file
32
scripts/person.gd
Normal file
|
@ -0,0 +1,32 @@
|
|||
extends Node3D
|
||||
signal scored(name)
|
||||
|
||||
@export var title: String
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
$fire_particles/smoke.emitting = false
|
||||
$fire_particles/glow.emitting = false
|
||||
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if Input.is_action_pressed("ActivateBackLeft"):
|
||||
put_to_rest()
|
||||
|
||||
func put_to_rest():
|
||||
burst()
|
||||
scored.emit(title)
|
||||
|
||||
|
||||
func burst():
|
||||
$fire_particles/smoke.emitting = true
|
||||
$fire_particles/glow.emitting = true
|
||||
$person.hide()
|
||||
$burst_length_timer.start()
|
||||
|
||||
|
||||
func _on_burst_length_timer_timeout() -> void:
|
||||
$fire_particles/smoke.emitting = false
|
||||
$fire_particles/glow.emitting = false
|
Loading…
Add table
Add a link
Reference in a new issue