forked from team-sg/hero-mark-2
Made some changes :)
This commit is contained in:
parent
038935709f
commit
8f6a068eba
76 changed files with 889 additions and 36 deletions
|
@ -10,5 +10,6 @@ func _on_Area2D_area_entered(area):
|
|||
#Collect
|
||||
if area.is_in_group("player"):
|
||||
Game.golds += value
|
||||
Game.score += 5
|
||||
Game.play_sound(Game.a_gold,Game.ac_collectible)
|
||||
queue_free()
|
||||
|
|
|
@ -45,6 +45,7 @@ playing = true
|
|||
centered = false
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
visible = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2( 4, 4 )
|
||||
|
|
|
@ -8,5 +8,7 @@ func _ready():
|
|||
func _on_Area2D_area_entered(area):
|
||||
#Collect
|
||||
if area.is_in_group("player"):
|
||||
Game.play_sound(Game.a_shard,Game.ac_collectible)
|
||||
Game.score += 500
|
||||
Game.shards += value
|
||||
queue_free()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -5,39 +5,40 @@
|
|||
[ext_resource path="res://objects/collectibles/star.gd" type="Script" id=3]
|
||||
[ext_resource path="res://graphics/collectibles/star.png" type="Texture" id=4]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=1]
|
||||
[sub_resource type="ShaderMaterial" id=10]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource( 2 )
|
||||
shader_param/border_color = Color( 0, 0, 0, 1 )
|
||||
shader_param/border_corners = false
|
||||
shader_param/palette = ExtResource( 1 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
[sub_resource type="AtlasTexture" id=11]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 0, 0, 11, 11 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
[sub_resource type="AtlasTexture" id=12]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 11, 0, 11, 11 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
[sub_resource type="AtlasTexture" id=13]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 22, 0, 11, 11 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
[sub_resource type="AtlasTexture" id=14]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 33, 0, 11, 11 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=6]
|
||||
[sub_resource type="AtlasTexture" id=15]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 44, 0, 11, 11 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=7]
|
||||
[sub_resource type="AtlasTexture" id=16]
|
||||
atlas = ExtResource( 4 )
|
||||
region = Rect2( 55, 0, 11, 11 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=8]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ) ],
|
||||
"frames": [ SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 8.0
|
||||
|
@ -50,10 +51,10 @@ extents = Vector2( 4, 4 )
|
|||
script = ExtResource( 3 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
material = SubResource( 1 )
|
||||
material = SubResource( 10 )
|
||||
position = Vector2( -1, -3 )
|
||||
frames = SubResource( 8 )
|
||||
frame = 3
|
||||
frame = 2
|
||||
playing = true
|
||||
centered = false
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue