Made some changes :)
This commit is contained in:
parent
038935709f
commit
8f6a068eba
76 changed files with 889 additions and 36 deletions
|
@ -1,16 +1,34 @@
|
|||
extends Node2D
|
||||
|
||||
export(int, "Red", "Yellow","Green","Blue","Magenta") var color
|
||||
export var value = 1
|
||||
onready var sprite = $AnimatedSprite
|
||||
|
||||
func _ready():
|
||||
#Sync all coinframes
|
||||
$AnimatedSprite.play()
|
||||
|
||||
sprite.play()
|
||||
#Change color
|
||||
match color:
|
||||
0:
|
||||
sprite.material.set_shader_param("palette",load("res://graphics/collectibles/pal_star_red.png"))
|
||||
1:
|
||||
sprite.material.set_shader_param("palette",load("res://graphics/collectibles/pal_star_yellow.png"))
|
||||
2:
|
||||
sprite.material.set_shader_param("palette",load("res://graphics/collectibles/pal_star_green.png"))
|
||||
3:
|
||||
sprite.material.set_shader_param("palette",load("res://graphics/collectibles/pal_star_blue.png"))
|
||||
4:
|
||||
sprite.material.set_shader_param("palette",load("res://graphics/collectibles/pal_star_magenta.png"))
|
||||
|
||||
func _on_Area2D_area_entered(area):
|
||||
#Collect
|
||||
if area.is_in_group("player"):
|
||||
Game.play_sound(Game.a_star,Game.ac_collectible)
|
||||
Game.stars += value
|
||||
Game.score += 100
|
||||
Game.stars[color] = true
|
||||
#5 Star reward
|
||||
if Game.stars == 5: Game.shards += 1
|
||||
if Game.stars[0] && Game.stars[1] && Game.stars[2] && Game.stars[3] && Game.stars[4]:
|
||||
Game.play_sound(Game.a_shard,Game.ac_collectible)
|
||||
Game.shards += 1
|
||||
Game.score += 500
|
||||
queue_free()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue