mirror of
https://github.com/Dariasteam/Cows-Revenge.git
synced 2026-01-23 02:15:17 +00:00
Upgrade background
This commit is contained in:
parent
c6ae244f47
commit
60624c97c6
17 changed files with 869 additions and 735 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
[ext_resource path="res://Scenes/Events/cowbell.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Sprites/Charasets/cowbell.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Scenes/Events/cowbell_animations.tres" type="Animation" id=3]
|
||||
[ext_resource path="res://Scenes/Events/cowbell_animation_one_shot.tres" type="Animation" id=3]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
|
||||
|
|
@ -30,6 +30,7 @@ amount = 100
|
|||
transform/scale = Vector2( 2, 2 )
|
||||
texture = ExtResource( 2 )
|
||||
hframes = 3
|
||||
frame = 2
|
||||
region_rect = Rect2( 0, 0, 24, 24 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Sprite"]
|
||||
|
|
|
|||
19
Scenes/Events/cowbell_animation_one_shot.tres
Normal file
19
Scenes/Events/cowbell_animation_one_shot.tres
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
[gd_resource type="Animation" format=1]
|
||||
|
||||
[resource]
|
||||
|
||||
resource/name = "Bling"
|
||||
length = 0.61
|
||||
loop = true
|
||||
step = 0.15
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/imported = false
|
||||
tracks/0/keys = {
|
||||
"times": FloatArray( 0, 0.15, 0.3, 0.45, 0.6 ),
|
||||
"transitions": FloatArray( 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0, 1, 0, 2, 0 ]
|
||||
}
|
||||
|
||||
|
|
@ -3,17 +3,17 @@
|
|||
[resource]
|
||||
|
||||
resource/name = "Bling"
|
||||
length = 0.8
|
||||
length = 0.61
|
||||
loop = true
|
||||
step = 0.2
|
||||
step = 0.15
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/imported = false
|
||||
tracks/0/keys = {
|
||||
"times": FloatArray( 0, 0.2, 0.4, 0.6 ),
|
||||
"transitions": FloatArray( 1, 1, 1, 1 ),
|
||||
"times": FloatArray( 0, 0.15, 0.3, 0.45, 0.6 ),
|
||||
"transitions": FloatArray( 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0, 1, 0, 2 ]
|
||||
"values": [ 0, 1, 0, 2, 0 ]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ func play_sound():
|
|||
aux_timer.start()
|
||||
|
||||
timer.start()
|
||||
return pitch - base_pitch
|
||||
|
||||
func _ready():
|
||||
timer.connect("timeout",self,"timer_timeout")
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ func destroy():
|
|||
queue_free()
|
||||
|
||||
func _ready():
|
||||
sound.play("bullet_sound")
|
||||
sound.play("bullet_sound",0)
|
||||
t.set_wait_time(LIFE_TIME)
|
||||
t.set_one_shot(true)
|
||||
self.add_child(t)
|
||||
|
|
@ -38,5 +38,5 @@ func _on_RigidBody2D_body_enter( body ):
|
|||
elif (end):
|
||||
destroy()
|
||||
|
||||
func _on_RigidBody2D_body_enter_shape( body_id, body, body_shape, local_shape ):
|
||||
sound.play("bullet_sound")
|
||||
func _on_RigidBody2D_body_enter_shape( body_id, body, body_shape, local_shape ):
|
||||
sound.play("bullet_sound", 0)
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ params/pitch_scale = 1.0
|
|||
params/attenuation/min_distance = 0.0
|
||||
params/attenuation/max_distance = 750.0
|
||||
params/attenuation/distance_exp = 2.37841
|
||||
config/polyphony = 4
|
||||
config/polyphony = 3
|
||||
config/samples = SubResource( 2 )
|
||||
config/pitch_random = 0.135
|
||||
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ export(int) var cowbells_collected = 0
|
|||
|
||||
func add_cowbells(var number):
|
||||
cowbells_collected += number
|
||||
hud_cowbell.set_counter (cowbells_collected)
|
||||
return cowbell_collector.play_sound()
|
||||
hud_cowbell.set_counter (cowbells_collected, cowbell_collector.play_sound())
|
||||
|
||||
|
||||
func is_falling ():
|
||||
return velocity.y > 0
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ tracks/0/keys = {
|
|||
"player",
|
||||
]]
|
||||
|
||||
transform/scale = Vector2( 2, 2 )
|
||||
transform/scale = Vector2( 1.8, 1.8 )
|
||||
z/relative = false
|
||||
input/pickable = true
|
||||
shapes/0/shape = SubResource( 1 )
|
||||
|
|
@ -64,11 +64,11 @@ cowbells_collected = 0
|
|||
|
||||
[node name="shooter" type="Node2D" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
transform/pos = Vector2( 25.3282, 2.0993 )
|
||||
transform/scale = Vector2( 0.5, 0.5 )
|
||||
script/script = ExtResource( 2 )
|
||||
SHOOT_CADENCE = 0.1
|
||||
bullet_cost = 2
|
||||
|
||||
[node name="ray" parent="shooter" instance=ExtResource( 3 )]
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ var weapon = WEAPONS.regular
|
|||
var shoot = false
|
||||
var recharge = false
|
||||
|
||||
export(int) var bullet_cost = 1
|
||||
|
||||
onready var player = get_parent()
|
||||
onready var instanced_ray = get_node("ray")
|
||||
|
||||
|
|
@ -63,7 +65,7 @@ func shoot_regular():
|
|||
t.start()
|
||||
yield(t, "timeout")
|
||||
recharge = false
|
||||
player.decrease_milk(1)
|
||||
player.decrease_milk(bullet_cost)
|
||||
|
||||
func shoot_laser():
|
||||
player.decrease_milk(0.1)
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=18 format=1]
|
||||
[gd_scene load_steps=20 format=1]
|
||||
|
||||
[ext_resource path="res://Scenes/Maps/map_1.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Scenes/Menu/life_hud.gd" type="Script" id=2]
|
||||
|
|
@ -14,6 +14,8 @@
|
|||
[ext_resource path="res://Scenes/Menu/cowbells_hud.gd" type="Script" id=12]
|
||||
[ext_resource path="res://Fonts/Cave-Story.fnt" type="BitmapFont" id=13]
|
||||
[ext_resource path="res://Sprites/Charasets/cowbell.png" type="Texture" id=14]
|
||||
[ext_resource path="res://Scenes/Events/cowbell_animation_one_shot.tres" type="Animation" id=15]
|
||||
[ext_resource path="res://Scenes/Events/cowbell_animations.tres" type="Animation" id=16]
|
||||
|
||||
[sub_resource type="Environment" id=1]
|
||||
|
||||
|
|
@ -115,7 +117,6 @@ initial_heart_pos = Vector2( 32, 0 )
|
|||
]]
|
||||
|
||||
editor/display_folded = true
|
||||
visibility/visible = false
|
||||
script/script = ExtResource( 3 )
|
||||
|
||||
[node name="Bttn_U" type="TouchScreenButton" parent="Control/Buttons"]
|
||||
|
|
@ -293,6 +294,20 @@ bbcode/bbcode = "0"
|
|||
visible_characters = -1
|
||||
percent_visible = 1.0
|
||||
|
||||
[node name="next_cowbell_timer" type="Timer" parent="Control/Cowbells"]
|
||||
|
||||
process_mode = 1
|
||||
wait_time = 0.6
|
||||
one_shot = true
|
||||
autostart = false
|
||||
|
||||
[node name="cold_down_timer" type="Timer" parent="Control/Cowbells"]
|
||||
|
||||
process_mode = 1
|
||||
wait_time = 0.005
|
||||
one_shot = false
|
||||
autostart = false
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Control/Cowbells"]
|
||||
|
||||
material/material = SubResource( 3 )
|
||||
|
|
@ -301,6 +316,18 @@ transform/scale = Vector2( 3, 3 )
|
|||
texture = ExtResource( 14 )
|
||||
hframes = 3
|
||||
|
||||
[node name="Animation" type="AnimationPlayer" parent="Control/Cowbells/Sprite"]
|
||||
|
||||
playback/process_mode = 0
|
||||
playback/default_blend_time = 0.0
|
||||
root/root = NodePath("..")
|
||||
anims/cowbell_animation_one_shot = ExtResource( 15 )
|
||||
anims/cowbell_animations = ExtResource( 16 )
|
||||
playback/active = false
|
||||
playback/speed = 2.0
|
||||
blend_times = [ ]
|
||||
autoplay = ""
|
||||
|
||||
[connection signal="pressed" from="Control/Buttons/Bttn_U" to="Control/Buttons" method="_on_Bttn_U_pressed"]
|
||||
|
||||
[connection signal="released" from="Control/Buttons/Bttn_U" to="Control/Buttons" method="_on_Bttn_U_released"]
|
||||
|
|
@ -337,4 +364,8 @@ hframes = 3
|
|||
|
||||
[connection signal="released" from="Control/Buttons/Bttn_L" to="Control/Buttons" method="_on_Bttn_L_released"]
|
||||
|
||||
[connection signal="timeout" from="Control/Cowbells/next_cowbell_timer" to="Control/Cowbells" method="_on_next_cowbell_timer_timeout"]
|
||||
|
||||
[connection signal="timeout" from="Control/Cowbells/cold_down_timer" to="Control/Cowbells" method="_on_cold_down_timer_timeout"]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,35 @@ extends Node2D
|
|||
# var b = "textvar"
|
||||
|
||||
onready var label = get_node("Counter")
|
||||
onready var animation = get_node("Sprite/Animation")
|
||||
onready var next_cowbell_timer = get_node("next_cowbell_timer")
|
||||
onready var cold_down_timer = get_node("cold_down_timer")
|
||||
onready var sprite = get_node("Sprite")
|
||||
onready var base_modulation = Color(1,1,1)
|
||||
|
||||
func set_counter (var quantity):
|
||||
label.set_bbcode(" " + String(quantity))
|
||||
var frame_number
|
||||
|
||||
func _ready():
|
||||
animation.play("cowbell_animations")
|
||||
var anim = animation.get_animation("cowbell_animations")
|
||||
next_cowbell_timer.set_wait_time(anim.get_length() / animation.get_speed() )
|
||||
animation.set_active(false)
|
||||
|
||||
func set_counter (var quantity, var acumulated):
|
||||
sprite.set_modulate(Color (1,1 - acumulated * 2,1 - acumulated * 2))
|
||||
label.set_bbcode(" " + String(quantity))
|
||||
animation.set_active(true)
|
||||
next_cowbell_timer.start()
|
||||
cold_down_timer.start()
|
||||
|
||||
func _on_next_cowbell_timer_timeout():
|
||||
sprite.set_frame(0)
|
||||
animation.set_active(false)
|
||||
|
||||
func _on_cold_down_timer_timeout():
|
||||
var current_modulation = sprite.get_modulate()
|
||||
if (current_modulation.g >= base_modulation.g && current_modulation.b >= base_modulation.b):
|
||||
sprite.set_modulate(base_modulation)
|
||||
cold_down_timer.stop()
|
||||
else:
|
||||
sprite.set_modulate(Color (1,current_modulation.g + 0.02 ,current_modulation.b + 0.02))
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 690 B After Width: | Height: | Size: 1.3 KiB |
|
|
@ -15,10 +15,10 @@ print_fps=true
|
|||
|
||||
[display]
|
||||
|
||||
use_2d_pixel_snap=true
|
||||
stretch_mode="viewport"
|
||||
width=1280
|
||||
height=720
|
||||
use_2d_pixel_snap=false
|
||||
emulate_touchscreen=true
|
||||
driver="GLES2"
|
||||
stretch_aspect="keep"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue