1
Fork 0
mirror of https://github.com/Steffo99/looping-for-loops.git synced 2024-11-21 15:44:24 +00:00

🍩 Add colored loop to the cat

Co-authored-by: Cookie <58516648+Cookie-CHR@users.noreply.github.com>
This commit is contained in:
Steffo 2020-10-05 16:44:38 +02:00
parent 1f27aa1229
commit ea8753a536
5 changed files with 7 additions and 0 deletions

View file

@ -15,6 +15,7 @@ func _ready():
func _on_Loop_body_entered(body): func _on_Loop_body_entered(body):
emit_signal("picked_up") emit_signal("picked_up")
body.loops_collected += 1 body.loops_collected += 1
body.get_node("Donut").self_modulate = $Sprite.self_modulate
$AnimationPlayer.play("pop fade out") $AnimationPlayer.play("pop fade out")

View file

@ -2,6 +2,9 @@ extends KinematicBody2D
class_name Player class_name Player
var rng = RandomNumberGenerator.new()
export(Vector2) var gravity: Vector2 = Vector2(0, 10) export(Vector2) var gravity: Vector2 = Vector2(0, 10)
export(float) var move_speed: float = 300 export(float) var move_speed: float = 300
export(float) var jump_speed: float = 425 export(float) var jump_speed: float = 425
@ -24,6 +27,9 @@ func get_floor():
return collision.collider return collision.collider
func _ready():
$Donut.self_modulate = Color.from_hsv(rng.randf_range(0.0, 1.0), 0.4, 1)
func up_normal(): func up_normal():
return -gravity.normalized() return -gravity.normalized()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 758 B

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 B

After

Width:  |  Height:  |  Size: 129 B