mirror of
https://github.com/Dariasteam/Cows-Revenge.git
synced 2026-01-23 02:15:17 +00:00
Basic multilevel support and minor tweaks
This commit is contained in:
parent
1d78c9d133
commit
024a766acd
26 changed files with 33448 additions and 150 deletions
BIN
Fonts/Cave-Story-Regular.fnt
Normal file
BIN
Fonts/Cave-Story-Regular.fnt
Normal file
Binary file not shown.
31000
Fonts/Cave-Story-Regular.inc
Normal file
31000
Fonts/Cave-Story-Regular.inc
Normal file
File diff suppressed because it is too large
Load diff
BIN
Fonts/Cave-Story-Regular.sv.png
Normal file
BIN
Fonts/Cave-Story-Regular.sv.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
BIN
Fonts/Cave-Story-Titles.fnt
Normal file
BIN
Fonts/Cave-Story-Titles.fnt
Normal file
Binary file not shown.
Binary file not shown.
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=15 format=1]
|
||||
[gd_scene load_steps=16 format=1]
|
||||
|
||||
[ext_resource path="res://Sprites/Effects/UFO-ray_1.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Sprites/Effects/UFO-ray_2.png" type="Texture" id=2]
|
||||
|
|
@ -6,10 +6,8 @@
|
|||
[ext_resource path="res://Sprites/Charasets/UFO.png" type="Texture" id=4]
|
||||
[ext_resource path="res://Scenes/Events/player_spawner.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://Sprites/Charasets/cow.png" type="Texture" id=6]
|
||||
|
||||
[sub_resource type="GDScript" id=9]
|
||||
|
||||
script/source = ""
|
||||
[ext_resource path="res://Sound/UFO_abduct.ogg" type="AudioStream" id=7]
|
||||
[ext_resource path="res://Fonts/Cave-Story-Regular.fnt" type="BitmapFont" id=8]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
|
||||
|
|
@ -43,7 +41,7 @@ points = Vector2Array( 66, 19.8991, 0, 23.8991, -57, -50.1009, -46, -67.1009, -2
|
|||
custom_solver_bias = 0.0
|
||||
points = Vector2Array( 134, -3.10092, 106, 12.8991, 66, 19.8991, 57, -50.1009, 83, -46.1009, 107, -39.1009, 123, -32.1009, 137, -19.1009, 139, -10.1009 )
|
||||
|
||||
[sub_resource type="Animation" id=6]
|
||||
[sub_resource type="Animation" id=5]
|
||||
|
||||
resource/name = "appear"
|
||||
length = 1.0
|
||||
|
|
@ -60,7 +58,7 @@ tracks/0/keys = {
|
|||
"values": [ 0.0, 0.4, 0.1, 1.0, 0.1, 0.5, 0.8, 0.4, 1.0, 0.0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=7]
|
||||
[sub_resource type="Animation" id=6]
|
||||
|
||||
resource/name = "unvanish"
|
||||
length = 1.0
|
||||
|
|
@ -77,15 +75,13 @@ tracks/0/keys = {
|
|||
"values": [ 1.0, 0.4, 0.8, 0.1, 0.5, 0.1, 1.0, 0.4, 0.0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=8]
|
||||
[sub_resource type="RectangleShape2D" id=7]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
extents = Vector2( 4.3399, 110.989 )
|
||||
|
||||
[node name="UFO" type="Node2D"]
|
||||
|
||||
script/script = SubResource( 9 )
|
||||
|
||||
[node name="Ray" type="Node2D" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
|
|
@ -434,11 +430,14 @@ trigger = false
|
|||
|
||||
[node name="player_spawner" parent="." instance=ExtResource( 5 )]
|
||||
|
||||
editor/display_folded = true
|
||||
transform/pos = Vector2( -1.5159, 199.14 )
|
||||
init_text = "Vuelve cuando hayas
|
||||
salvado a todas las gallinas."
|
||||
append_text = "Te quedan "
|
||||
|
||||
[node name="Sprite_cow" type="Sprite" parent="player_spawner"]
|
||||
|
||||
editor/display_folded = true
|
||||
visibility/opacity = 0.0
|
||||
visibility/behind_parent = true
|
||||
transform/pos = Vector2( 1.00537, -0.359009 )
|
||||
|
|
@ -452,8 +451,8 @@ region_rect = Rect2( 0, 0, 96, 96 )
|
|||
playback/process_mode = 1
|
||||
playback/default_blend_time = 0.0
|
||||
root/root = NodePath("..")
|
||||
anims/appear = SubResource( 6 )
|
||||
anims/unvanish = SubResource( 7 )
|
||||
anims/appear = SubResource( 5 )
|
||||
anims/unvanish = SubResource( 6 )
|
||||
playback/active = true
|
||||
playback/speed = 1.0
|
||||
blend_times = [ ]
|
||||
|
|
@ -461,9 +460,10 @@ autoplay = ""
|
|||
|
||||
[node name="Area2D" type="Area2D" parent="player_spawner"]
|
||||
|
||||
editor/display_folded = true
|
||||
transform/pos = Vector2( 1.00537, -57.1355 )
|
||||
input/pickable = true
|
||||
shapes/0/shape = SubResource( 8 )
|
||||
shapes/0/shape = SubResource( 7 )
|
||||
shapes/0/transform = Matrix32( 1, 0, 0, 1, -0.263519, 0 )
|
||||
shapes/0/trigger = false
|
||||
gravity_vec = Vector2( 0, 1 )
|
||||
|
|
@ -474,7 +474,7 @@ angular_damp = 1.0
|
|||
[node name="CollisionShape2D" type="CollisionShape2D" parent="player_spawner/Area2D"]
|
||||
|
||||
transform/pos = Vector2( -0.263519, 0 )
|
||||
shape = SubResource( 8 )
|
||||
shape = SubResource( 7 )
|
||||
trigger = false
|
||||
_update_shape_index = 0
|
||||
|
||||
|
|
@ -482,6 +482,33 @@ _update_shape_index = 0
|
|||
|
||||
transform/scale = Vector2( 0.5882, 0.5882 )
|
||||
|
||||
[node name="Sound" type="StreamPlayer" parent="player_spawner"]
|
||||
|
||||
stream/stream = ExtResource( 7 )
|
||||
stream/play = true
|
||||
stream/loop = false
|
||||
stream/volume_db = 10.0
|
||||
stream/autoplay = false
|
||||
stream/paused = false
|
||||
stream/loop_restart_time = 0.0
|
||||
stream/buffering_ms = 500
|
||||
|
||||
[node name="UFO_texts" type="Label" parent="player_spawner"]
|
||||
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = -206.484
|
||||
margin/top = -157.14
|
||||
margin/right = 201.516
|
||||
margin/bottom = -112.14
|
||||
custom_fonts/font = ExtResource( 8 )
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[connection signal="body_enter" from="player_spawner/Area2D" to="player_spawner" method="_on_Area2D_body_enter"]
|
||||
|
||||
[connection signal="body_exit" from="player_spawner/Area2D" to="player_spawner" method="_on_Area2D_body_exit"]
|
||||
|
|
|
|||
34
Scenes/Events/cage.tres.gd
Normal file
34
Scenes/Events/cage.tres.gd
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
extends StaticBody2D
|
||||
|
||||
export(String) var text
|
||||
|
||||
onready var foreground = get_node("Foreground")
|
||||
onready var background = get_node("Background")
|
||||
onready var particles_a = get_node("Bars")
|
||||
onready var particles_b = get_node("Dust")
|
||||
onready var sound = get_node("StreamPlayer")
|
||||
|
||||
onready var text_label = get_node("Text")
|
||||
onready var text_anim = get_node("Text/AnimationPlayer")
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
func open_cage():
|
||||
sound.play()
|
||||
|
||||
text_label.set_text(text)
|
||||
text_anim.play("Apear")
|
||||
|
||||
get_node("Area2D").queue_free()
|
||||
get_node("CollisionShape2D").queue_free()
|
||||
particles_a.set_emitting(true)
|
||||
particles_b.set_emitting(true)
|
||||
foreground.queue_free()
|
||||
background.queue_free()
|
||||
|
||||
|
||||
func _on_Area2D_body_enter( body ):
|
||||
if (body.is_in_group("player")):
|
||||
body.open_cage(1)
|
||||
open_cage()
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=4 format=1]
|
||||
|
||||
[ext_resource path="res://Fonts/Cave-Story.fnt" type="BitmapFont" id=1]
|
||||
[ext_resource path="res://Fonts/Cave-Story-Titles.fnt" type="BitmapFont" id=1]
|
||||
|
||||
[sub_resource type="GDScript" id=1]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,65 +1,39 @@
|
|||
[gd_scene load_steps=27 format=1]
|
||||
[gd_scene load_steps=29 format=1]
|
||||
|
||||
[ext_resource path="res://Sprites/Charasets/jail.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Sound/apple_sound.ogg" type="AudioStream" id=2]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0000.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0001.png" type="Texture" id=4]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0002.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0003.png" type="Texture" id=6]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0004.png" type="Texture" id=7]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0005.png" type="Texture" id=8]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0006.png" type="Texture" id=9]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0007.png" type="Texture" id=10]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0008.png" type="Texture" id=11]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0009.png" type="Texture" id=12]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0010.png" type="Texture" id=13]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0011.png" type="Texture" id=14]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0012.png" type="Texture" id=15]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0013.png" type="Texture" id=16]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0014.png" type="Texture" id=17]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0015.png" type="Texture" id=18]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0016.png" type="Texture" id=19]
|
||||
[ext_resource path="res://Sprites/Effects/jail_particles.png" type="Texture" id=20]
|
||||
[ext_resource path="res://Sprites/Effects/leche.png" type="Texture" id=21]
|
||||
[ext_resource path="res://Sound/cage_explosion.ogg" type="AudioStream" id=22]
|
||||
[ext_resource path="res://Scenes/Events/cage.tres.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Sprites/Charasets/jail.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Sound/apple_sound.ogg" type="AudioStream" id=3]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0000.png" type="Texture" id=4]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0001.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0002.png" type="Texture" id=6]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0003.png" type="Texture" id=7]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0004.png" type="Texture" id=8]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0005.png" type="Texture" id=9]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0006.png" type="Texture" id=10]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0007.png" type="Texture" id=11]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0008.png" type="Texture" id=12]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0009.png" type="Texture" id=13]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0010.png" type="Texture" id=14]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0011.png" type="Texture" id=15]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0012.png" type="Texture" id=16]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0013.png" type="Texture" id=17]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0014.png" type="Texture" id=18]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0015.png" type="Texture" id=19]
|
||||
[ext_resource path="res://Sprites/Charasets/chickens/chickens0016.png" type="Texture" id=20]
|
||||
[ext_resource path="res://Sprites/Effects/jail_particles.png" type="Texture" id=21]
|
||||
[ext_resource path="res://Sprites/Effects/leche.png" type="Texture" id=22]
|
||||
[ext_resource path="res://Sound/cage_explosion.ogg" type="AudioStream" id=23]
|
||||
[ext_resource path="res://Fonts/Cave-Story-Regular.fnt" type="BitmapFont" id=24]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
extents = Vector2( 16.0518, 11.0722 )
|
||||
|
||||
[sub_resource type="GDScript" id=3]
|
||||
|
||||
script/source = "extends StaticBody2D
|
||||
|
||||
onready var foreground = get_node(\"Foreground\")
|
||||
onready var background = get_node(\"Background\")
|
||||
onready var particles_a = get_node(\"Particles2D\")
|
||||
onready var particles_b = get_node(\"Particles2D1\")
|
||||
onready var sound = get_node(\"StreamPlayer\")
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
func open_cage():
|
||||
sound.play()
|
||||
get_node(\"Area2D\").queue_free()
|
||||
get_node(\"CollisionShape2D\").queue_free()
|
||||
particles_a.set_emitting(true)
|
||||
particles_b.set_emitting(true)
|
||||
foreground.queue_free()
|
||||
background.queue_free()
|
||||
|
||||
|
||||
func _on_Area2D_body_enter( body ):
|
||||
if (body.is_in_group(\"player\")):
|
||||
open_cage()
|
||||
"
|
||||
|
||||
[sub_resource type="SpriteFrames" id=2]
|
||||
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 3 ), ExtResource( 4 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 9 ), ExtResource( 10 ), ExtResource( 11 ), ExtResource( 12 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 18 ), ExtResource( 19 ) ],
|
||||
"frames": [ ExtResource( 4 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 9 ), ExtResource( 10 ), ExtResource( 11 ), ExtResource( 12 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 18 ), ExtResource( 19 ), ExtResource( 20 ) ],
|
||||
"loop": true,
|
||||
"name": "Idle",
|
||||
"speed": 20.0
|
||||
|
|
@ -70,7 +44,36 @@ animations = [ {
|
|||
offsets = FloatArray( 0, 0.00787402, 1 )
|
||||
colors = ColorArray( 0, 0, 0, 1, 0.71875, 0.71875, 0.71875, 1, 1, 1, 1, 0 )
|
||||
|
||||
[node name="Cage" type="StaticBody2D"]
|
||||
[sub_resource type="Animation" id=5]
|
||||
|
||||
resource/name = "Apear"
|
||||
length = 0.7
|
||||
loop = false
|
||||
step = 0.1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:visibility/opacity")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/imported = false
|
||||
tracks/0/keys = {
|
||||
"times": FloatArray( 0, 0.7 ),
|
||||
"transitions": FloatArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ 0.0, 1.0 ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath(".:rect/pos")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/imported = false
|
||||
tracks/1/keys = {
|
||||
"times": FloatArray( 0, 0.5 ),
|
||||
"transitions": FloatArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( -70, -44 ), Vector2( -70, -58 ) ]
|
||||
}
|
||||
|
||||
[node name="Cage" type="StaticBody2D" groups=[
|
||||
"cages",
|
||||
]]
|
||||
|
||||
input/pickable = false
|
||||
shapes/0/shape = SubResource( 1 )
|
||||
|
|
@ -82,19 +85,20 @@ constant_linear_velocity = Vector2( 0, 0 )
|
|||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
script/script = SubResource( 3 )
|
||||
script/script = ExtResource( 1 )
|
||||
text = null
|
||||
|
||||
[node name="Foreground" type="Sprite" parent="."]
|
||||
|
||||
z/z = 1
|
||||
texture = ExtResource( 1 )
|
||||
texture = ExtResource( 2 )
|
||||
hframes = 2
|
||||
region_rect = Rect2( 0, 0, 78, 61 )
|
||||
|
||||
[node name="Background" type="Sprite" parent="."]
|
||||
|
||||
z/z = -1
|
||||
texture = ExtResource( 1 )
|
||||
texture = ExtResource( 2 )
|
||||
hframes = 2
|
||||
frame = 1
|
||||
|
||||
|
|
@ -108,7 +112,7 @@ _update_shape_index = 0
|
|||
|
||||
[node name="Sound" type="StreamPlayer" parent="."]
|
||||
|
||||
stream/stream = ExtResource( 2 )
|
||||
stream/stream = ExtResource( 3 )
|
||||
stream/play = false
|
||||
stream/loop = false
|
||||
stream/volume_db = 5.0
|
||||
|
|
@ -121,10 +125,10 @@ stream/buffering_ms = 500
|
|||
|
||||
frames = SubResource( 2 )
|
||||
animation = "Idle"
|
||||
frame = 13
|
||||
frame = 11
|
||||
playing = true
|
||||
|
||||
[node name="Particles2D" type="Particles2D" parent="."]
|
||||
[node name="Bars" type="Particles2D" parent="."]
|
||||
|
||||
transform/pos = Vector2( 0, 1 )
|
||||
config/amount = 80
|
||||
|
|
@ -135,7 +139,7 @@ config/process_mode = 1
|
|||
config/half_extents = Vector2( 20, 20 )
|
||||
config/local_space = false
|
||||
config/explosiveness = 0.4
|
||||
config/texture = ExtResource( 20 )
|
||||
config/texture = ExtResource( 21 )
|
||||
params/direction = 180.0
|
||||
params/spread = 180.0
|
||||
params/linear_velocity = 200.0
|
||||
|
|
@ -157,7 +161,7 @@ randomness/spin_velocity = 0.2
|
|||
randomness/initial_angle = 10.0
|
||||
color/color_ramp = SubResource( 4 )
|
||||
|
||||
[node name="Particles2D1" type="Particles2D" parent="."]
|
||||
[node name="Dust" type="Particles2D" parent="."]
|
||||
|
||||
transform/pos = Vector2( 0, 1 )
|
||||
z/z = -1
|
||||
|
|
@ -169,7 +173,7 @@ config/process_mode = 1
|
|||
config/half_extents = Vector2( 20, 20 )
|
||||
config/local_space = false
|
||||
config/explosiveness = 0.4
|
||||
config/texture = ExtResource( 21 )
|
||||
config/texture = ExtResource( 22 )
|
||||
params/direction = 0.0
|
||||
params/spread = 180.0
|
||||
params/linear_velocity = 100.0
|
||||
|
|
@ -215,7 +219,7 @@ _update_shape_index = 0
|
|||
|
||||
[node name="StreamPlayer" type="StreamPlayer" parent="."]
|
||||
|
||||
stream/stream = ExtResource( 22 )
|
||||
stream/stream = ExtResource( 23 )
|
||||
stream/play = false
|
||||
stream/loop = false
|
||||
stream/volume_db = 7.0
|
||||
|
|
@ -224,6 +228,35 @@ stream/paused = false
|
|||
stream/loop_restart_time = 0.0
|
||||
stream/buffering_ms = 500
|
||||
|
||||
[node name="Text" type="Label" parent="."]
|
||||
|
||||
visibility/opacity = 0.0
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = -70.0
|
||||
margin/top = -44.0
|
||||
margin/right = 73.0
|
||||
margin/bottom = -23.0
|
||||
custom_fonts/font = ExtResource( 24 )
|
||||
text = "0"
|
||||
align = 1
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Text"]
|
||||
|
||||
playback/process_mode = 1
|
||||
playback/default_blend_time = 0.0
|
||||
root/root = NodePath("..")
|
||||
anims/Apear = SubResource( 5 )
|
||||
playback/active = true
|
||||
playback/speed = 1.0
|
||||
blend_times = [ ]
|
||||
autoplay = ""
|
||||
|
||||
[connection signal="body_enter" from="Area2D" to="." method="_on_Area2D_body_enter"]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ onready var hud_cowbell = get_tree().get_nodes_in_group("cowbell_hud")[0]
|
|||
onready var JUMP_SOUND = ResourceLoader.load("Sound/player_jump.ogg")
|
||||
onready var cowbell_collector = get_node("cowbell_collector")
|
||||
|
||||
|
||||
var can_jump = true
|
||||
var on_ground = true
|
||||
var jumping = false
|
||||
|
|
@ -57,6 +56,10 @@ export(int) var invulneravility_time = 16
|
|||
export var JUMP_SPEED = 400
|
||||
export var altitude = 0.5
|
||||
export(int) var cowbells_collected = 0
|
||||
export(int) var cages_open = 0
|
||||
|
||||
func open_cage(var number):
|
||||
cages_open += number
|
||||
|
||||
func add_cowbells(var number):
|
||||
cowbells_collected += number
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@
|
|||
[ext_resource path="res://Scenes/Events/cowbell_collector.gd" type="Script" id=6]
|
||||
[ext_resource path="res://Sound/player_jump.ogg" type="AudioStream" id=7]
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=1]
|
||||
[sub_resource type="ConvexPolygonShape2D" id=4]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
points = Vector2Array( -13.2061, 7.63341, -13.1494, -10.328, 11.2943, -10.3627, 11.4077, 7.42536, 1.19923, 13.0773, -3.50803, 13.0773 )
|
||||
points = Vector2Array( -13.2061, 7.63341, -13.26, -8.08105, 11.3331, -8.08105, 11.4077, 7.42536, 1.19923, 13.0773, -3.50803, 13.0773 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=2]
|
||||
[sub_resource type="ConvexPolygonShape2D" id=5]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
points = Vector2Array( -2.43698, 6.86286, -10.0513, 0.602652, -10.0513, -10.186, 9.7198, -10, 9.7198, 0.41664, 1.64128, 6.92704 )
|
||||
|
|
@ -42,10 +42,10 @@ tracks/0/keys = {
|
|||
transform/scale = Vector2( 1.8, 1.8 )
|
||||
z/relative = false
|
||||
input/pickable = true
|
||||
shapes/0/shape = SubResource( 1 )
|
||||
shapes/0/shape = SubResource( 4 )
|
||||
shapes/0/transform = Matrix32( 1.89755, 0, 0, 3.10364, 2.93931, -4.91934 )
|
||||
shapes/0/trigger = false
|
||||
shapes/1/shape = SubResource( 2 )
|
||||
shapes/1/shape = SubResource( 5 )
|
||||
shapes/1/transform = Matrix32( 2.35192, 0, 0, 2.68801, 1.63985, 16.8801 )
|
||||
shapes/1/trigger = true
|
||||
collision/layers = 1057
|
||||
|
|
@ -61,6 +61,7 @@ invulneravility_time = 8
|
|||
JUMP_SPEED = 620
|
||||
altitude = 0.5
|
||||
cowbells_collected = 0
|
||||
cages_open = 0
|
||||
|
||||
[node name="shooter" type="Node2D" parent="."]
|
||||
|
||||
|
|
@ -80,7 +81,7 @@ layer_mask = 30
|
|||
transform/pos = Vector2( 2.93931, -4.91934 )
|
||||
transform/scale = Vector2( 1.89755, 3.10364 )
|
||||
build_mode = 0
|
||||
polygon = Vector2Array( -3.50803, 13.0773, 1.19923, 13.0773, 11.4077, 7.42536, 11.2943, -10.3627, -13.1494, -10.328, -13.2061, 7.63341 )
|
||||
polygon = Vector2Array( -3.50803, 13.0773, 1.19923, 13.0773, 11.4077, 7.42536, 11.3331, -8.08105, -13.26, -8.08105, -13.2061, 7.63341 )
|
||||
shape_range = Vector2( 0, 0 )
|
||||
trigger = false
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
2106
Scenes/Maps/map_2.tscn
Normal file
2106
Scenes/Maps/map_2.tscn
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1131,7 +1131,6 @@ trigger = false
|
|||
|
||||
[node name="Tronco_rama_right" type="Sprite" parent="."]
|
||||
|
||||
visibility/visible = false
|
||||
transform/pos = Vector2( -64, -64 )
|
||||
z/z = 2
|
||||
texture = ExtResource( 1 )
|
||||
|
|
@ -1157,7 +1156,7 @@ shapes/3/shape = SubResource( 33 )
|
|||
shapes/3/transform = Matrix32( 1, 0, 0, 1, 0, 2 )
|
||||
shapes/3/trigger = false
|
||||
collision/layers = 2
|
||||
collision/mask = 12
|
||||
collision/mask = 15
|
||||
one_way_collision/direction = Vector2( 0, 1 )
|
||||
one_way_collision/max_depth = 1.0
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
|
|
@ -1324,6 +1323,7 @@ _update_shape_index = 0
|
|||
|
||||
[node name="Tronco_rama_doble" type="Sprite" parent="."]
|
||||
|
||||
editor/display_folded = true
|
||||
visibility/visible = false
|
||||
transform/pos = Vector2( -64, -64 )
|
||||
z/z = 2
|
||||
|
|
@ -1451,6 +1451,7 @@ region_rect = Rect2( 0, 256, 64, 64 )
|
|||
|
||||
[node name="hoja_8" type="Sprite" parent="."]
|
||||
|
||||
visibility/visible = false
|
||||
transform/pos = Vector2( -64, -64 )
|
||||
z/z = 3
|
||||
texture = ExtResource( 1 )
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<resource_file type="TileSet" subresource_count="47" version="2.1" version_name="Godot Engine v2.1.4.beta.official">
|
||||
<resource_file type="TileSet" subresource_count="47" version="2.1" version_name="Godot Engine v2.1.5.beta.build1">
|
||||
<ext_resource path="res://Sprites/Tilesets/tile full.png" type="Texture" index="0"></ext_resource>
|
||||
<resource type="ConvexPolygonShape2D" path="local://1">
|
||||
<real name="custom_solver_bias"> 0 </real>
|
||||
|
|
|
|||
8
Scenes/Menu/HUD.tres.gd
Normal file
8
Scenes/Menu/HUD.tres.gd
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
extends Viewport
|
||||
|
||||
export
|
||||
|
||||
func _ready():
|
||||
# Called every time the node is added to the scene.
|
||||
# Initialization here
|
||||
pass
|
||||
|
|
@ -1,21 +1,23 @@
|
|||
[gd_scene load_steps=20 format=1]
|
||||
[gd_scene load_steps=22 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]
|
||||
[ext_resource path="res://Scenes/Menu/buttons_hud.gd" type="Script" id=3]
|
||||
[ext_resource path="res://Sprites/GUI/Buttons/bttn_arrow.png" type="Texture" id=4]
|
||||
[ext_resource path="res://Sprites/GUI/Buttons/bttn_jump.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Sprites/GUI/Buttons/bttn.png" type="Texture" id=6]
|
||||
[ext_resource path="res://Sprites/GUI/Buttons/btn_shoot.png" type="Texture" id=7]
|
||||
[ext_resource path="res://Scenes/Menu/milk_botte_hud.gd" type="Script" id=8]
|
||||
[ext_resource path="res://Sprites/GUI/HUD/milbar_outter_2.png" type="Texture" id=9]
|
||||
[ext_resource path="res://Sprites/GUI/HUD/milkbar_outter_3.png" type="Texture" id=10]
|
||||
[ext_resource path="res://Sprites/GUI/HUD/milkbar_outter_1.png" type="Texture" id=11]
|
||||
[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]
|
||||
[ext_resource path="res://Scenes/Menu/level_selector.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Scenes/Maps/map_1.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://Scenes/Maps/map_2.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://Scenes/Menu/life_hud.gd" type="Script" id=4]
|
||||
[ext_resource path="res://Scenes/Menu/buttons_hud.gd" type="Script" id=5]
|
||||
[ext_resource path="res://Sprites/GUI/Buttons/bttn_arrow.png" type="Texture" id=6]
|
||||
[ext_resource path="res://Sprites/GUI/Buttons/bttn_jump.png" type="Texture" id=7]
|
||||
[ext_resource path="res://Sprites/GUI/Buttons/bttn.png" type="Texture" id=8]
|
||||
[ext_resource path="res://Sprites/GUI/Buttons/btn_shoot.png" type="Texture" id=9]
|
||||
[ext_resource path="res://Scenes/Menu/milk_botte_hud.gd" type="Script" id=10]
|
||||
[ext_resource path="res://Sprites/GUI/HUD/milbar_outter_2.png" type="Texture" id=11]
|
||||
[ext_resource path="res://Sprites/GUI/HUD/milkbar_outter_3.png" type="Texture" id=12]
|
||||
[ext_resource path="res://Sprites/GUI/HUD/milkbar_outter_1.png" type="Texture" id=13]
|
||||
[ext_resource path="res://Scenes/Menu/cowbells_hud.gd" type="Script" id=14]
|
||||
[ext_resource path="res://Fonts/Cave-Story-Titles.fnt" type="BitmapFont" id=15]
|
||||
[ext_resource path="res://Sprites/Charasets/cowbell.png" type="Texture" id=16]
|
||||
[ext_resource path="res://Scenes/Events/cowbell_animation_one_shot.tres" type="Animation" id=17]
|
||||
[ext_resource path="res://Scenes/Events/cowbell_animations.tres" type="Animation" id=18]
|
||||
|
||||
[sub_resource type="Environment" id=1]
|
||||
|
||||
|
|
@ -69,11 +71,13 @@ environment = SubResource( 1 )
|
|||
|
||||
shader/shading_mode = 0
|
||||
|
||||
[node name="Node2D" type="Node2D" groups=[
|
||||
[node name="Global" type="Node2D" groups=[
|
||||
"control",
|
||||
]]
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
[node name="Control" type="Control" parent="." groups=[
|
||||
"level_selector",
|
||||
]]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = false
|
||||
|
|
@ -83,10 +87,11 @@ margin/left = 0.0
|
|||
margin/top = 0.0
|
||||
margin/right = 1280.0
|
||||
margin/bottom = 768.0
|
||||
script/script = ExtResource( 1 )
|
||||
levels = [ ExtResource( 2 ), ExtResource( 3 ) ]
|
||||
|
||||
[node name="Viewport" type="Viewport" parent="Control"]
|
||||
|
||||
editor/display_folded = true
|
||||
rect = Rect2( 0, 0, 1280, 768 )
|
||||
own_world = false
|
||||
world = SubResource( 2 )
|
||||
|
|
@ -102,14 +107,12 @@ audio_listener/enable_3d = false
|
|||
physics/object_picking = false
|
||||
gui/disable_input = false
|
||||
|
||||
[node name="Level" parent="Control/Viewport" instance=ExtResource( 1 )]
|
||||
|
||||
[node name="Life" type="Node2D" parent="Control" groups=[
|
||||
"life_hud",
|
||||
]]
|
||||
|
||||
transform/pos = Vector2( 64, 64 )
|
||||
script/script = ExtResource( 2 )
|
||||
script/script = ExtResource( 4 )
|
||||
heart_inter_distance = 64
|
||||
initial_heart_pos = Vector2( 32, 0 )
|
||||
|
||||
|
|
@ -118,14 +121,14 @@ initial_heart_pos = Vector2( 32, 0 )
|
|||
]]
|
||||
|
||||
editor/display_folded = true
|
||||
script/script = ExtResource( 3 )
|
||||
script/script = ExtResource( 5 )
|
||||
|
||||
[node name="Bttn_U" type="TouchScreenButton" parent="Control/Buttons"]
|
||||
|
||||
visibility/opacity = 0.9
|
||||
transform/pos = Vector2( 160, 320 )
|
||||
transform/scale = Vector2( 0.474074, 0.481203 )
|
||||
normal = ExtResource( 4 )
|
||||
normal = ExtResource( 6 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
|
|
@ -140,7 +143,7 @@ visibility_mode = 0
|
|||
visibility/opacity = 0.8
|
||||
transform/pos = Vector2( 1088, 576 )
|
||||
transform/scale = Vector2( 0.474074, 0.481203 )
|
||||
normal = ExtResource( 5 )
|
||||
normal = ExtResource( 7 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
|
|
@ -155,7 +158,7 @@ visibility_mode = 0
|
|||
visibility/opacity = 0.8
|
||||
transform/pos = Vector2( 1088, 384 )
|
||||
transform/scale = Vector2( 0.474074, 0.481203 )
|
||||
normal = ExtResource( 6 )
|
||||
normal = ExtResource( 8 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
|
|
@ -170,7 +173,7 @@ visibility_mode = 0
|
|||
visibility/opacity = 0.9
|
||||
transform/pos = Vector2( 896, 576 )
|
||||
transform/scale = Vector2( 0.474074, 0.481203 )
|
||||
normal = ExtResource( 7 )
|
||||
normal = ExtResource( 9 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
|
|
@ -186,7 +189,7 @@ visibility/opacity = 0.9
|
|||
transform/pos = Vector2( 288, 704 )
|
||||
transform/rot = 180.0
|
||||
transform/scale = Vector2( 0.474074, 0.481203 )
|
||||
normal = ExtResource( 4 )
|
||||
normal = ExtResource( 6 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
|
|
@ -201,7 +204,7 @@ visibility_mode = 0
|
|||
visibility/opacity = 0.0
|
||||
transform/pos = Vector2( 288, 576 )
|
||||
transform/scale = Vector2( 0.474074, 0.481203 )
|
||||
normal = ExtResource( 4 )
|
||||
normal = ExtResource( 6 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
|
|
@ -216,7 +219,7 @@ visibility_mode = 0
|
|||
visibility/opacity = 0.0
|
||||
transform/pos = Vector2( 32, 576 )
|
||||
transform/scale = Vector2( 0.474074, 0.481203 )
|
||||
normal = ExtResource( 4 )
|
||||
normal = ExtResource( 6 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
|
|
@ -232,7 +235,7 @@ visibility/opacity = 0.9
|
|||
transform/pos = Vector2( 416, 448 )
|
||||
transform/rot = -90.0
|
||||
transform/scale = Vector2( 0.474074, 0.481203 )
|
||||
normal = ExtResource( 4 )
|
||||
normal = ExtResource( 6 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
|
|
@ -248,7 +251,7 @@ visibility/opacity = 0.9
|
|||
transform/pos = Vector2( 32, 576 )
|
||||
transform/rot = 90.0
|
||||
transform/scale = Vector2( 0.474074, 0.481203 )
|
||||
normal = ExtResource( 4 )
|
||||
normal = ExtResource( 6 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
|
|
@ -264,20 +267,20 @@ visibility_mode = 0
|
|||
|
||||
transform/pos = Vector2( 1205, 73 )
|
||||
transform/scale = Vector2( 2, 2 )
|
||||
script/script = ExtResource( 8 )
|
||||
script/script = ExtResource( 10 )
|
||||
each_bottle_value = 20.0
|
||||
bottle_inter_distance = 32
|
||||
initial_bottle_pos = Vector2( -10, -20 )
|
||||
sprite1 = ExtResource( 9 )
|
||||
sprite2 = ExtResource( 10 )
|
||||
sprite3 = ExtResource( 11 )
|
||||
sprite1 = ExtResource( 11 )
|
||||
sprite2 = ExtResource( 12 )
|
||||
sprite3 = ExtResource( 13 )
|
||||
|
||||
[node name="Cowbells" type="Node2D" parent="Control" groups=[
|
||||
"cowbell_hud",
|
||||
]]
|
||||
|
||||
transform/pos = Vector2( 3, 21 )
|
||||
script/script = ExtResource( 12 )
|
||||
script/script = ExtResource( 14 )
|
||||
|
||||
[node name="Counter" type="RichTextLabel" parent="Control/Cowbells"]
|
||||
|
||||
|
|
@ -289,7 +292,7 @@ margin/left = 630.0
|
|||
margin/top = 22.0
|
||||
margin/right = 830.0
|
||||
margin/bottom = 73.0
|
||||
custom_fonts/normal_font = ExtResource( 13 )
|
||||
custom_fonts/normal_font = ExtResource( 15 )
|
||||
bbcode/enabled = true
|
||||
bbcode/bbcode = "0"
|
||||
visible_characters = -1
|
||||
|
|
@ -318,7 +321,7 @@ autostart = false
|
|||
material/material = SubResource( 3 )
|
||||
transform/pos = Vector2( 586, 45 )
|
||||
transform/scale = Vector2( 3, 3 )
|
||||
texture = ExtResource( 14 )
|
||||
texture = ExtResource( 16 )
|
||||
hframes = 3
|
||||
|
||||
[node name="Animation" type="AnimationPlayer" parent="Control/Cowbells/Sprite"]
|
||||
|
|
@ -326,8 +329,8 @@ hframes = 3
|
|||
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 )
|
||||
anims/cowbell_animation_one_shot = ExtResource( 17 )
|
||||
anims/cowbell_animations = ExtResource( 18 )
|
||||
playback/active = false
|
||||
playback/speed = 2.0
|
||||
blend_times = [ ]
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ onready var instancer = get_node("bonus_instancer")
|
|||
|
||||
var frame_number
|
||||
|
||||
func reset_values():
|
||||
set_counter(0, 0)
|
||||
|
||||
func bonus(quantity):
|
||||
var bonus = BONUS.instance()
|
||||
bonus.set_text(str("+",quantity))
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=3 format=1]
|
||||
|
||||
[ext_resource path="res://Scenes/Menu/game_over.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Fonts/Cave-Story.fnt" type="BitmapFont" id=2]
|
||||
[ext_resource path="res://Fonts/Cave-Story-Regular.fnt" type="BitmapFont" id=2]
|
||||
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
|
|
|
|||
25
Scenes/Menu/level_selector.gd
Normal file
25
Scenes/Menu/level_selector.gd
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
extends Control
|
||||
|
||||
onready var viewport = get_node("Viewport")
|
||||
onready var life = get_node("Life")
|
||||
onready var milk = get_node("Milk_Bar")
|
||||
onready var cowbells = get_node("Cowbells")
|
||||
|
||||
export(Array) var levels
|
||||
var level_index = 1
|
||||
|
||||
func _ready():
|
||||
viewport.add_child(levels[0].instance())
|
||||
|
||||
func next_level():
|
||||
if (level_index < levels.size()):
|
||||
for element in viewport.get_children():
|
||||
element.queue_free()
|
||||
reset_hud()
|
||||
viewport.add_child(levels[level_index].instance())
|
||||
level_index += 1
|
||||
|
||||
func reset_hud():
|
||||
life.reset_values()
|
||||
milk.reset_values()
|
||||
cowbells.reset_values()
|
||||
|
|
@ -6,6 +6,9 @@ var n_hearts = 0
|
|||
export var heart_inter_distance = 64
|
||||
export var initial_heart_pos = Vector2(32, 0)
|
||||
|
||||
func reset_values():
|
||||
pass
|
||||
|
||||
func on_set_max_life(value):
|
||||
n_hearts = value
|
||||
var next_heart_pos = initial_heart_pos
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
[gd_scene load_steps=9 format=1]
|
||||
|
||||
[ext_resource path="res://Sprites/GUI/Buttons/btn_shoot.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Fonts/Cave-Story.fnt" type="BitmapFont" id=2]
|
||||
[ext_resource path="res://Fonts/Cave-Story-Titles.fnt" type="BitmapFont" id=2]
|
||||
[ext_resource path="res://Scenes/Menu/bttn_play.gd" type="Script" id=3]
|
||||
[ext_resource path="res://Scenes/Menu/about_button.gd" type="Script" id=4]
|
||||
[ext_resource path="res://Music/dangerous_hills.ogg" type="AudioStream" id=5]
|
||||
|
|
@ -108,7 +108,7 @@ texture = ExtResource( 6 )
|
|||
|
||||
[node name="Revenge" type="Sprite" parent="."]
|
||||
|
||||
transform/pos = Vector2( 1.07855, -1.84071 )
|
||||
transform/pos = Vector2( 1.87856, -1.84071 )
|
||||
transform/scale = Vector2( 0.0864583, 0.128739 )
|
||||
texture = ExtResource( 7 )
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ export(Texture) var sprite3
|
|||
|
||||
onready var sprites = [sprite1, sprite2, sprite3]
|
||||
|
||||
func reset_values():
|
||||
on_update_milk_bar(0)
|
||||
|
||||
func on_set_max_milk (maxm):
|
||||
max_value = maxm
|
||||
n_bottles = maxm / each_bottle_value
|
||||
|
|
|
|||
BIN
Sound/UFO_abduct.ogg
Normal file
BIN
Sound/UFO_abduct.ogg
Normal file
Binary file not shown.
|
|
@ -14,8 +14,9 @@ force_fps=60
|
|||
|
||||
[display]
|
||||
|
||||
use_2d_pixel_snap=true
|
||||
use_vsync=true
|
||||
stretch_mode="viewport"
|
||||
use_2d_pixel_snap=true
|
||||
width=1280
|
||||
height=720
|
||||
emulate_touchscreen=true
|
||||
|
|
@ -55,7 +56,6 @@ thread_model=1
|
|||
|
||||
[rasterizer]
|
||||
|
||||
shadow_filter=0
|
||||
low_memory_2d_mode=true
|
||||
|
||||
[rasterizer.Android]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,14 @@ extends Node2D
|
|||
|
||||
const PLAYER = preload("res://Scenes/Events/player.tscn")
|
||||
onready var anim = get_node("Sprite_cow/AnimationPlayer")
|
||||
onready var sound = get_node("Sound")
|
||||
onready var instancer = get_node("Instancer")
|
||||
onready var texts = get_node("UFO_texts")
|
||||
onready var total_cages = get_tree().get_nodes_in_group("cages").size()
|
||||
|
||||
export(String, MULTILINE) var init_text = "Vuelve cuando hayas\n salvado a todas las gallinas."
|
||||
export(String, MULTILINE) var append_text
|
||||
|
||||
var player
|
||||
|
||||
onready var cow_is_abducted = false
|
||||
|
|
@ -10,27 +17,42 @@ onready var cow_is_abducted = false
|
|||
var mission_acomplished = false
|
||||
|
||||
func _ready():
|
||||
texts.set_text(str(init_text, "\n", append_text, total_cages, "."))
|
||||
sound.play()
|
||||
anim.play("appear")
|
||||
player = PLAYER.instance()
|
||||
instancer.call_deferred("add_child", player)
|
||||
yield(anim, "finished")
|
||||
instancer.call_deferred("add_child", player)
|
||||
yield(anim, "finished")
|
||||
player.enable_player()
|
||||
|
||||
func _on_Area2D_body_enter( body ):
|
||||
if (body.is_in_group("player")):
|
||||
set_process_input(true)
|
||||
|
||||
func abduct():
|
||||
sound.play()
|
||||
player.disable_player()
|
||||
anim.play("unvanish")
|
||||
cow_is_abducted = true
|
||||
|
||||
var rest = total_cages - player.cages_open
|
||||
if (rest > 0):
|
||||
texts.set_text(str(init_text, "\n", append_text, rest, "."))
|
||||
else:
|
||||
get_tree().get_nodes_in_group("level_selector")[0].next_level()
|
||||
|
||||
func deploy():
|
||||
sound.play()
|
||||
anim.play("appear")
|
||||
yield(anim, "finished")
|
||||
player.enable_player()
|
||||
cow_is_abducted = false
|
||||
|
||||
func _input(ev):
|
||||
if (ev.is_action_pressed("ui_up") and !cow_is_abducted):
|
||||
player.disable_player()
|
||||
anim.play("unvanish")
|
||||
cow_is_abducted = true
|
||||
if (ev.is_action_pressed("ui_down") and cow_is_abducted):
|
||||
anim.play("appear")
|
||||
yield(anim, "finished")
|
||||
player.enable_player()
|
||||
cow_is_abducted = false
|
||||
|
||||
abduct()
|
||||
if (ev.is_action_pressed("ui_down") and cow_is_abducted):
|
||||
deploy()
|
||||
func _on_Area2D_body_exit(body):
|
||||
if (body.is_in_group("player") and !cow_is_abducted):
|
||||
set_process_input(false)
|
||||
Loading…
Add table
Add a link
Reference in a new issue