forked from team-sg/hero-mark-2
shard titles pop up in game
This commit is contained in:
parent
a13a9cee10
commit
afa641901c
10 changed files with 108 additions and 8 deletions
35
graphics/hud/shard_counter.png.import
Normal file
35
graphics/hud/shard_counter.png.import
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/shard_counter.png-21107511ef3e175bf6cbab17710b5745.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/hud/shard_counter.png"
|
||||||
|
dest_files=[ "res://.import/shard_counter.png-21107511ef3e175bf6cbab17710b5745.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=false
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
BIN
graphics/player/sg_duck.png
Normal file
BIN
graphics/player/sg_duck.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 335 B |
35
graphics/player/sg_duck.png.import
Normal file
35
graphics/player/sg_duck.png.import
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/sg_duck.png-2c4af6f61584cc7699021d5bd8cdd8a4.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/player/sg_duck.png"
|
||||||
|
dest_files=[ "res://.import/sg_duck.png-2c4af6f61584cc7699021d5bd8cdd8a4.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=false
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
|
@ -82,7 +82,7 @@ margin_top = 134.0
|
||||||
margin_right = 213.0
|
margin_right = 213.0
|
||||||
margin_bottom = 144.0
|
margin_bottom = 144.0
|
||||||
theme = ExtResource( 1 )
|
theme = ExtResource( 1 )
|
||||||
text = "Collect all coins"
|
text = "AAAAAAAAAAAAAAAAAAAAAAAA"
|
||||||
align = 1
|
align = 1
|
||||||
|
|
||||||
[node name="EasyModeText" type="Label" parent="."]
|
[node name="EasyModeText" type="Label" parent="."]
|
||||||
|
|
|
@ -1,14 +1,19 @@
|
||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
|
signal collected(shard_number)
|
||||||
|
|
||||||
export var value = 1
|
export var value = 1
|
||||||
export var number = 0 #Used for saving which specific shards collected
|
export var number = 0 #Used for saving which specific shards collected
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
var hud = get_tree().get_nodes_in_group("hud").pop_back()
|
||||||
|
connect("collected",hud,"shard_popup")
|
||||||
$AnimationPlayer.play("glow")
|
$AnimationPlayer.play("glow")
|
||||||
|
|
||||||
func _on_Area2D_body_entered(body):
|
func _on_Area2D_body_entered(body):
|
||||||
#Collect
|
#Collect
|
||||||
if body.is_in_group("player"):
|
if body.is_in_group("player"):
|
||||||
|
emit_signal("collected",number)
|
||||||
Audio.play_shard_sound()
|
Audio.play_shard_sound()
|
||||||
Game.score += 500
|
Game.score += 500
|
||||||
Game.shards += value
|
Game.shards += value
|
||||||
|
|
|
@ -32,6 +32,17 @@ func _ready():
|
||||||
tween.tween_interval(3.0)
|
tween.tween_interval(3.0)
|
||||||
tween.tween_property(music, "rect_position:x", 256.0, 1.0)
|
tween.tween_property(music, "rect_position:x", 256.0, 1.0)
|
||||||
|
|
||||||
|
func shard_popup(shard_number):
|
||||||
|
#Change text to song name
|
||||||
|
var shard_title = $ShardTitle
|
||||||
|
var level = LevelData.levels[Game.current_level]
|
||||||
|
shard_title.text = "§" + str(level.shard_titles[shard_number])
|
||||||
|
yield(get_tree(), "idle_frame")
|
||||||
|
var tween = create_tween()
|
||||||
|
tween.tween_property(shard_title, "rect_position:x", 254.0 - shard_title.rect_size.x, 1.0)
|
||||||
|
tween.tween_interval(3.0)
|
||||||
|
tween.tween_property(shard_title, "rect_position:x", 256.0, 1.0)
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
#Gold Counter
|
#Gold Counter
|
||||||
gold_counter.text = "%02d" % Game.keys
|
gold_counter.text = "%02d" % Game.keys
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=13 format=2]
|
[gd_scene load_steps=14 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://graphics/hud/stars_hud.png" type="Texture" id=1]
|
[ext_resource path="res://graphics/hud/stars_hud.png" type="Texture" id=1]
|
||||||
[ext_resource path="res://graphics/hud/lives_head.png" type="Texture" id=2]
|
[ext_resource path="res://graphics/hud/lives_head.png" type="Texture" id=2]
|
||||||
|
@ -8,17 +8,21 @@
|
||||||
[ext_resource path="res://objects/hud/hud.gd" type="Script" id=6]
|
[ext_resource path="res://objects/hud/hud.gd" type="Script" id=6]
|
||||||
[ext_resource path="res://graphics/hud/key_counter.png" type="Texture" id=7]
|
[ext_resource path="res://graphics/hud/key_counter.png" type="Texture" id=7]
|
||||||
[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=8]
|
[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=8]
|
||||||
[ext_resource path="res://ui/2ndpuberty_no_dropshadow.tres" type="Theme" id=9]
|
[ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=9]
|
||||||
[ext_resource path="res://ui/theme.tres" type="Theme" id=10]
|
[ext_resource path="res://ui/theme.tres" type="Theme" id=10]
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id=1]
|
[sub_resource type="ShaderMaterial" id=1]
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id=2]
|
[sub_resource type="ShaderMaterial" id=2]
|
||||||
|
|
||||||
[node name="HUD" type="CanvasLayer"]
|
[sub_resource type="ShaderMaterial" id=3]
|
||||||
|
shader = ExtResource( 9 )
|
||||||
|
shader_param/border_color = Color( 0.219608, 0.219608, 0.219608, 1 )
|
||||||
|
shader_param/border_corners = true
|
||||||
|
|
||||||
|
[node name="HUD" type="CanvasLayer" groups=["hud"]]
|
||||||
layer = 100
|
layer = 100
|
||||||
script = ExtResource( 6 )
|
script = ExtResource( 6 )
|
||||||
song_name = "♫Music"
|
|
||||||
bonus_color = Color( 0.478431, 1, 0.47451, 1 )
|
bonus_color = Color( 0.478431, 1, 0.47451, 1 )
|
||||||
|
|
||||||
[node name="Back" type="Sprite" parent="."]
|
[node name="Back" type="Sprite" parent="."]
|
||||||
|
@ -156,6 +160,16 @@ anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
margin_top = -10.0
|
margin_top = -10.0
|
||||||
margin_right = 42.0
|
margin_right = 42.0
|
||||||
theme = ExtResource( 9 )
|
theme = ExtResource( 10 )
|
||||||
text = "♫Music"
|
text = "♫Music"
|
||||||
align = 2
|
align = 2
|
||||||
|
|
||||||
|
[node name="ShardTitle" type="Label" parent="."]
|
||||||
|
material = SubResource( 3 )
|
||||||
|
margin_left = 256.0
|
||||||
|
margin_top = 182.0
|
||||||
|
margin_right = 333.0
|
||||||
|
margin_bottom = 192.0
|
||||||
|
theme = ExtResource( 10 )
|
||||||
|
text = "§time bonus"
|
||||||
|
align = 2
|
||||||
|
|
|
@ -1157,8 +1157,8 @@ script = ExtResource( 8 )
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement" to="." method="_process_movement"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement" to="." method="_process_movement"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded" to="." method="_on_Grounded_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded" to="." method="_on_Grounded_state_entered"]
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded" to="." method="_process_grounded"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded" to="." method="_process_grounded"]
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_horizontal_movement"]
|
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_can_walk"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_can_walk"]
|
||||||
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_horizontal_movement"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Still" to="." method="_on_Still_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Still" to="." method="_on_Still_state_entered"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Walking" to="." method="_on_Walking_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Walking" to="." method="_on_Walking_state_entered"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Blinking" to="." method="_on_Blinking_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Blinking" to="." method="_on_Blinking_state_entered"]
|
||||||
|
@ -1168,8 +1168,8 @@ script = ExtResource( 8 )
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_process_pushing"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_process_pushing"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"]
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"]
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"]
|
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"]
|
||||||
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_entered"]
|
||||||
[connection signal="state_exited" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_exited"]
|
[connection signal="state_exited" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_exited"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/LadderJump" to="." method="_on_LadderJump_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/LadderJump" to="." method="_on_LadderJump_state_entered"]
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Loading…
Add table
Add a link
Reference in a new issue