forked from KOBUGE-Incubator/mighty-knight
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup points scene and add size changing depending on points
- Loading branch information
1 parent
34e7529
commit 54d89ca
Showing
2 changed files
with
14 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
extends KinematicBody2D | ||
extends Node2D | ||
|
||
onready var tween = get_node("Tween") | ||
onready var label = get_node("label") | ||
onready var anim = get_node("AnimationPlayer").get_animation("bump").duplicate() | ||
|
||
func _ready(): | ||
var i = int(get_node("label").get_text()) | ||
if i > 10: | ||
i = 10 | ||
|
||
anim.track_set_key_value(0, 1, Vector2((5+i)/3, (5+i)/3)) | ||
get_node("AnimationPlayer").add_animation("bump_bis", anim) | ||
get_node("AnimationPlayer").play("bump_bis") | ||
|
||
get_node("label").set("custom_colors/font_color", Color(1, 1.1-i*0.1, 1-i*0.1)) | ||
set_fixed_process(true) | ||
|
||
func _fixed_process(delta): | ||
move(Vector2(0,-8)) | ||
|
||
func _on_VisibilityNotifier2D_exit_screen(): | ||
queue_free() | ||
if get_pos().y > -128: | ||
set_pos(get_pos() + Vector2(0, -8)) | ||
else: | ||
queue_free() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters