mirror of
https://github.com/jwinterm/MoonLaunch.git
synced 2026-10-17 05:41:29 +02:00
Finished Level 1
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
extends VButtonArray
|
||||
|
||||
# class member variables go here, for example:
|
||||
# var a = 2
|
||||
# var b = "textvar"
|
||||
|
||||
func _ready():
|
||||
# Called every time the node is added to the scene.
|
||||
# Initialization here
|
||||
pass
|
||||
|
||||
|
||||
func _on_Label_Quit_pressed():
|
||||
get_tree().change_scene("res://game/gui/menu/Menu.tscn")
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 150 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 96 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,6 +5,10 @@ main_scene="res://game/gui/menu/Menu.tscn"
|
||||
boot_splash="res://art/rocket.png"
|
||||
icon="res://art/rocket.png"
|
||||
|
||||
[autoload]
|
||||
|
||||
globalvar="*res://globalvar.gd"
|
||||
|
||||
[display]
|
||||
|
||||
width=800
|
||||
@@ -16,6 +20,7 @@ resizable=true
|
||||
|
||||
[input]
|
||||
|
||||
quit=[key(Q)]
|
||||
thrust=[key(Up)]
|
||||
revthrust=[key(Down)]
|
||||
bear_right=[key(Right)]
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
extends Node2D
|
||||
|
||||
# class member variables go here, for example:
|
||||
# var a = 2
|
||||
# var b = "textvar"
|
||||
|
||||
func _ready():
|
||||
# Called every time the node is added to the scene.
|
||||
# Initialization here
|
||||
pass
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
[gd_scene load_steps=5 format=1]
|
||||
|
||||
[ext_resource path="res://game/gui/help/Help.gd" type="Script" id=1]
|
||||
[ext_resource path="res://art/starfield.jpg" type="Texture" id=2]
|
||||
[ext_resource path="res://fonts/computerspeakfont.fnt" type="BitmapFont" id=3]
|
||||
[ext_resource path="res://helpbuttons.gd" type="Script" id=4]
|
||||
|
||||
[node name="Help" type="Node2D"]
|
||||
|
||||
script/script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite_spacefield" type="Sprite" parent="."]
|
||||
|
||||
transform/pos = Vector2( 412.188, 313.573 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
|
||||
rect/scale = Vector2( 1.7, 1.7 )
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 14.0
|
||||
margin/top = 151.0
|
||||
margin/right = 470.0
|
||||
margin/bottom = 283.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Use W/UpArrow to activate forward boosters.
|
||||
Use S/DownArrow to activate reverse boosters.
|
||||
A/LeftArrow and D/RightArrow to adjust bearing.
|
||||
|
||||
Objective - land your rocket gently on the moon!"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="VButtonArray" type="VButtonArray" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 406.0
|
||||
margin/top = 483.0
|
||||
margin/right = 445.0
|
||||
margin/bottom = 522.0
|
||||
flat = false
|
||||
button/count = 0
|
||||
button/min_button_size = -1.0
|
||||
button/align = 110
|
||||
script/script = ExtResource( 4 )
|
||||
|
||||
[node name="MenuButton" type="MenuButton" parent="VButtonArray"]
|
||||
|
||||
rect/scale = Vector2( 2, 2 )
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = -199.0
|
||||
margin/top = -11.0
|
||||
margin/right = -2.0
|
||||
margin/bottom = 19.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
toggle_mode = false
|
||||
click_on_press = true
|
||||
enabled_focus_mode = 0
|
||||
shortcut = null
|
||||
text = "Return to main menu"
|
||||
flat = true
|
||||
items = [ ]
|
||||
|
||||
[connection signal="pressed" from="VButtonArray/MenuButton" to="." method="_on_MenuButton_pressed"]
|
||||
|
||||
[connection signal="pressed" from="VButtonArray/MenuButton" to="VButtonArray" method="_on_MenuButton_pressed"]
|
||||
|
||||
|
||||
@@ -16,3 +16,7 @@ func _on_QuitButton_pressed():
|
||||
|
||||
func _on_PlayButton_pressed():
|
||||
get_tree().change_scene("res://game/levels/1/Level1.tscn")
|
||||
|
||||
|
||||
func _on_HelpButton_pressed():
|
||||
get_tree().change_scene("res://game/gui/help/Help.tscn")
|
||||
|
||||
+16
-2
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=8 format=1]
|
||||
[gd_scene load_steps=9 format=1]
|
||||
|
||||
[ext_resource path="res://art/starfield.jpg" type="Texture" id=1]
|
||||
[ext_resource path="res://game/gui/menu/Menu.gd" type="Script" id=2]
|
||||
@@ -6,6 +6,7 @@
|
||||
[ext_resource path="res://art/Earth-800px.png" type="Texture" id=4]
|
||||
[ext_resource path="res://art/rocket.png" type="Texture" id=5]
|
||||
[ext_resource path="res://art/1311069131-800px.png" type="Texture" id=6]
|
||||
[ext_resource path="res://art/introwavybgm.ogg" type="AudioStream" id=7]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
|
||||
@@ -113,7 +114,7 @@ texture = ExtResource( 4 )
|
||||
|
||||
[node name="RocketSprite" type="Sprite" parent="."]
|
||||
|
||||
transform/pos = Vector2( -270.814, 493.711 )
|
||||
transform/pos = Vector2( 533.554, 491.003 )
|
||||
transform/rot = -90.0
|
||||
transform/scale = Vector2( 0.3, 0.3 )
|
||||
texture = ExtResource( 5 )
|
||||
@@ -152,8 +153,21 @@ transform/pos = Vector2( 765.781, 384.52 )
|
||||
transform/scale = Vector2( 0.2, 0.2 )
|
||||
texture = ExtResource( 6 )
|
||||
|
||||
[node name="StreamPlayer" type="StreamPlayer" parent="."]
|
||||
|
||||
stream/stream = ExtResource( 7 )
|
||||
stream/play = false
|
||||
stream/loop = false
|
||||
stream/volume_db = 0.0
|
||||
stream/autoplay = true
|
||||
stream/paused = false
|
||||
stream/loop_restart_time = 0.0
|
||||
stream/buffering_ms = 500
|
||||
|
||||
[connection signal="pressed" from="VButtonArray/PlayButton" to="VButtonArray" method="_on_PlayButton_pressed"]
|
||||
|
||||
[connection signal="pressed" from="VButtonArray/HelpButton" to="VButtonArray" method="_on_HelpButton_pressed"]
|
||||
|
||||
[connection signal="pressed" from="VButtonArray/QuitButton" to="VButtonArray" method="_on_QuitButton_pressed"]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
extends Node2D
|
||||
|
||||
var finaltime
|
||||
var timerflag = false
|
||||
var labeltimer
|
||||
var astrotimer
|
||||
var colortimer
|
||||
var finishtimer
|
||||
var templabels = []
|
||||
var done = false
|
||||
|
||||
|
||||
func _ready():
|
||||
# set_process(true)
|
||||
get_node("Sprite_Astronaut").hide()
|
||||
get_node("Label_Score").hide()
|
||||
get_node("ButtonNode").hide()
|
||||
finaltime = globalvar.finaltime
|
||||
get_node("Label_Score").set_text("Final Time: " + str(finaltime))
|
||||
labeltimer = Timer.new()
|
||||
labeltimer.set_wait_time(2.5)
|
||||
labeltimer.set_one_shot(true)
|
||||
labeltimer.connect("timeout", self, "astroanim")
|
||||
add_child(labeltimer)
|
||||
astrotimer = Timer.new()
|
||||
astrotimer.set_wait_time(2.5)
|
||||
astrotimer.set_one_shot(true)
|
||||
astrotimer.connect("timeout", self, "colors")
|
||||
add_child(astrotimer)
|
||||
colortimer = Timer.new()
|
||||
colortimer.set_wait_time(1)
|
||||
colortimer.set_one_shot(true)
|
||||
colortimer.connect("timeout", self, "presskey")
|
||||
add_child(colortimer)
|
||||
labelanim()
|
||||
set_process(true)
|
||||
set_process_input(true)
|
||||
|
||||
|
||||
func labelanim():
|
||||
print("label anim started")
|
||||
get_node("Label_Score").get_node("AnimationPlayer").seek(0)
|
||||
get_node("Label_Score").show()
|
||||
get_node("Label_Score").get_node("AnimationPlayer").play("scroll")
|
||||
labeltimer.set_active(true)
|
||||
labeltimer.start()
|
||||
print("label anim started")
|
||||
|
||||
func astroanim():
|
||||
print("astro anim started")
|
||||
get_node("Sprite_Astronaut").get_node("AnimationPlayer").play("grow")
|
||||
get_node("Sprite_Astronaut").show()
|
||||
get_node("Sample_victory").play("victory", true)
|
||||
astrotimer.set_active(true)
|
||||
astrotimer.start()
|
||||
|
||||
func colors():
|
||||
get_node("Sample_victory").stop_all()
|
||||
for i in range(77):
|
||||
var new_x = randf()*800
|
||||
var new_y = randf()*600
|
||||
var new_pos = Vector2(new_x, new_y)
|
||||
var new_color1 = randf()
|
||||
var new_color2 = randf()
|
||||
var new_color3 = randf()
|
||||
var new_color = Color(new_color1, new_color2, new_color3, 1)
|
||||
var text = get_node("Label_Score").get_text()
|
||||
templabels.append(Label.new())
|
||||
templabels[-1].set_name("templabel"+String(i))
|
||||
templabels[-1].set_text(text)
|
||||
templabels[-1].set_pos(Vector2(new_x, new_y))
|
||||
templabels[-1].add_color_override("font_color", new_color)
|
||||
get_node("ScoreNode").add_child(templabels[-1])
|
||||
colortimer.set_active(true)
|
||||
colortimer.start()
|
||||
|
||||
|
||||
func presskey():
|
||||
#get_node("ButtonNode").set_z(0)
|
||||
get_node("ButtonNode").show()
|
||||
get_node("ButtonNode").set_process(true)
|
||||
#get_node("ButtonNode/QuitArray/Label_Quit").set_as_toplevel(true)
|
||||
done = true
|
||||
|
||||
func _process(delta):
|
||||
if done == true and Input.is_action_pressed("quit"):
|
||||
get_tree().change_scene("res://game/gui/menu/Menu.tscn")
|
||||
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
[gd_scene load_steps=10 format=1]
|
||||
|
||||
[ext_resource path="res://game/gui/victory/Victory.gd" type="Script" id=1]
|
||||
[ext_resource path="res://art/starfield.jpg" type="Texture" id=2]
|
||||
[ext_resource path="res://art/Cartoon-Astronaut.png" type="Texture" id=3]
|
||||
[ext_resource path="res://fonts/computerspeakfont.fnt" type="BitmapFont" id=4]
|
||||
[ext_resource path="res://QuitButton.gd" type="Script" id=5]
|
||||
[ext_resource path="res://art/victory.smp" type="Sample" id=6]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
|
||||
resource/name = "grow"
|
||||
length = 1.0
|
||||
loop = false
|
||||
step = 0.1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:transform/scale")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/imported = false
|
||||
tracks/0/keys = {
|
||||
"times": FloatArray( 0, 1 ),
|
||||
"transitions": FloatArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 1e-05, 1e-05 ), Vector2( 0.5, 0.5 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
|
||||
resource/name = "scroll"
|
||||
length = 2.0
|
||||
loop = false
|
||||
step = 0.1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:percent_visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/imported = false
|
||||
tracks/0/keys = {
|
||||
"times": FloatArray( 0, 2 ),
|
||||
"transitions": FloatArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ 0.0, 1.0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="SampleLibrary" id=3]
|
||||
|
||||
samples/victory = {
|
||||
"db": 0.0,
|
||||
"pitch": 1.0,
|
||||
"priority": 0,
|
||||
"sample": ExtResource( 6 )
|
||||
}
|
||||
|
||||
[node name="Victory" type="Node2D"]
|
||||
|
||||
script/script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite_Starfield" type="Sprite" parent="."]
|
||||
|
||||
transform/pos = Vector2( 399.831, 323.003 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite_Astronaut" type="Sprite" parent="."]
|
||||
|
||||
transform/pos = Vector2( 404.184, 298.895 )
|
||||
transform/scale = Vector2( 1e-05, 1e-05 )
|
||||
texture = ExtResource( 3 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Sprite_Astronaut"]
|
||||
|
||||
playback/process_mode = 1
|
||||
playback/default_blend_time = 0.0
|
||||
root/root = NodePath("..")
|
||||
anims/grow = SubResource( 1 )
|
||||
playback/active = true
|
||||
playback/speed = 1.0
|
||||
blend_times = [ ]
|
||||
autoplay = ""
|
||||
|
||||
[node name="Label_Victory" type="Label" parent="."]
|
||||
|
||||
rect/scale = Vector2( 4, 4 )
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 109.0
|
||||
margin/top = 37.0
|
||||
margin/right = 259.0
|
||||
margin/bottom = 61.0
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
text = "Victory Comrade!"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Label_Score" type="Label" parent="."]
|
||||
|
||||
rect/scale = Vector2( 3, 3 )
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 133.0
|
||||
margin/top = 501.0
|
||||
margin/right = 248.0
|
||||
margin/bottom = 525.0
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
text = "Final time: "
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Label_Score"]
|
||||
|
||||
playback/process_mode = 1
|
||||
playback/default_blend_time = 0.0
|
||||
root/root = NodePath("..")
|
||||
anims/scroll = SubResource( 2 )
|
||||
playback/active = true
|
||||
playback/speed = 1.0
|
||||
blend_times = [ ]
|
||||
autoplay = ""
|
||||
|
||||
[node name="ScoreNode" type="Node2D" parent="."]
|
||||
|
||||
[node name="ButtonNode" type="Node2D" parent="."]
|
||||
|
||||
[node name="QuitArray" type="VButtonArray" parent="ButtonNode"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 0.0
|
||||
margin/top = 0.0
|
||||
margin/right = 40.0
|
||||
margin/bottom = 40.0
|
||||
flat = false
|
||||
button/count = 0
|
||||
button/min_button_size = -1.0
|
||||
button/align = 110
|
||||
script/script = ExtResource( 5 )
|
||||
|
||||
[node name="Label_Quit" type="Button" parent="ButtonNode/QuitArray"]
|
||||
|
||||
rect/scale = Vector2( 3, 3 )
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 80.0
|
||||
margin/top = 246.0
|
||||
margin/right = 291.0
|
||||
margin/bottom = 276.0
|
||||
custom_fonts/font = ExtResource( 4 )
|
||||
toggle_mode = false
|
||||
enabled_focus_mode = 2
|
||||
shortcut = null
|
||||
text = "Press \"Q\" to quit"
|
||||
flat = false
|
||||
|
||||
[node name="Sample_victory" type="SamplePlayer" parent="."]
|
||||
|
||||
config/polyphony = 1
|
||||
config/samples = SubResource( 3 )
|
||||
default/volume_db = 0.0
|
||||
default/pitch_scale = 1.0
|
||||
default/pan = 0.0
|
||||
default/depth = 0.0
|
||||
default/height = 0.0
|
||||
default/filter/type = 0
|
||||
default/filter/cutoff = 5000.0
|
||||
default/filter/resonance = 1.0
|
||||
default/filter/gain = 1.0
|
||||
default/reverb_room = 2
|
||||
default/reverb_send = 0.0
|
||||
default/chorus_send = 0.0
|
||||
|
||||
[connection signal="button_down" from="ButtonNode/QuitArray/Label_Quit" to="." method="_on_Label_Quit_button_down"]
|
||||
|
||||
[connection signal="pressed" from="ButtonNode/QuitArray/Label_Quit" to="ButtonNode/QuitArray" method="_on_Label_Quit_pressed"]
|
||||
|
||||
|
||||
+112
-3
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=10 format=1]
|
||||
[gd_scene load_steps=16 format=1]
|
||||
|
||||
[ext_resource path="res://game/levels/1/Level1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://fonts/computerspeakfont.fnt" type="BitmapFont" id=2]
|
||||
@@ -8,6 +8,9 @@
|
||||
[ext_resource path="res://game/earth/Earth.tscn" type="PackedScene" id=6]
|
||||
[ext_resource path="res://game/moon/Moon.tscn" type="PackedScene" id=7]
|
||||
[ext_resource path="res://game/rocket/Rocket.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://art/thrust.smp" type="Sample" id=9]
|
||||
[ext_resource path="res://art/explosion.smp" type="Sample" id=10]
|
||||
[ext_resource path="res://art/ancientbgm.ogg" type="AudioStream" id=11]
|
||||
|
||||
[sub_resource type="ImageTexture" id=1]
|
||||
|
||||
@@ -17,6 +20,33 @@ size = Vector2( 1024, 1024 )
|
||||
storage = 0
|
||||
lossy_quality = 0.7
|
||||
|
||||
[sub_resource type="SampleLibrary" id=2]
|
||||
|
||||
samples/thrust = {
|
||||
"db": 0.0,
|
||||
"pitch": 1.0,
|
||||
"priority": 0,
|
||||
"sample": ExtResource( 9 )
|
||||
}
|
||||
|
||||
[sub_resource type="SampleLibrary" id=3]
|
||||
|
||||
samples/thrust = {
|
||||
"db": 0.01,
|
||||
"pitch": 1.86,
|
||||
"priority": 0,
|
||||
"sample": ExtResource( 9 )
|
||||
}
|
||||
|
||||
[sub_resource type="SampleLibrary" id=4]
|
||||
|
||||
samples/explosion = {
|
||||
"db": 0.0,
|
||||
"pitch": 1.0,
|
||||
"priority": 0,
|
||||
"sample": ExtResource( 10 )
|
||||
}
|
||||
|
||||
[node name="MoonSpace" type="Node2D"]
|
||||
|
||||
script/script = ExtResource( 1 )
|
||||
@@ -96,7 +126,7 @@ motion/mirroring = Vector2( 0, 0 )
|
||||
|
||||
[node name="Sun" type="Sprite" parent="ParallaxBackground/SunParallax"]
|
||||
|
||||
transform/pos = Vector2( 95.5348, 20.8754 )
|
||||
transform/pos = Vector2( 31.9165, -76.8239 )
|
||||
transform/scale = Vector2( 0.181912, 0.181912 )
|
||||
texture = ExtResource( 5 )
|
||||
|
||||
@@ -112,6 +142,85 @@ transform/pos = Vector2( 693.151, -5.9408 )
|
||||
|
||||
transform/pos = Vector2( 399.203, 303.565 )
|
||||
transform/rot = -70.0
|
||||
transform/scale = Vector2( 1, 1 )
|
||||
|
||||
[node name="Sample_thrust" type="SamplePlayer" parent="Rocket"]
|
||||
|
||||
config/polyphony = 1
|
||||
config/samples = SubResource( 2 )
|
||||
default/volume_db = 0.0
|
||||
default/pitch_scale = 1.0
|
||||
default/pan = 0.0
|
||||
default/depth = 0.0
|
||||
default/height = 0.0
|
||||
default/filter/type = 0
|
||||
default/filter/cutoff = 5000.0
|
||||
default/filter/resonance = 1.0
|
||||
default/filter/gain = 1.0
|
||||
default/reverb_room = 0
|
||||
default/reverb_send = 0.0
|
||||
default/chorus_send = 0.0
|
||||
|
||||
[node name="Sample_revthrust" type="SamplePlayer" parent="Rocket"]
|
||||
|
||||
config/polyphony = 1
|
||||
config/samples = SubResource( 3 )
|
||||
default/volume_db = 2.0
|
||||
default/pitch_scale = 1.0
|
||||
default/pan = 0.0
|
||||
default/depth = 0.0
|
||||
default/height = 0.0
|
||||
default/filter/type = 0
|
||||
default/filter/cutoff = 5000.0
|
||||
default/filter/resonance = 1.0
|
||||
default/filter/gain = 1.0
|
||||
default/reverb_room = 2
|
||||
default/reverb_send = 0.0
|
||||
default/chorus_send = 0.0
|
||||
|
||||
[node name="Sample_explosion" type="SamplePlayer" parent="Rocket"]
|
||||
|
||||
config/polyphony = 1
|
||||
config/samples = SubResource( 4 )
|
||||
default/volume_db = 0.0
|
||||
default/pitch_scale = 1.0
|
||||
default/pan = 0.0
|
||||
default/depth = 0.0
|
||||
default/height = 0.0
|
||||
default/filter/type = 0
|
||||
default/filter/cutoff = 5000.0
|
||||
default/filter/resonance = 1.0
|
||||
default/filter/gain = 1.0
|
||||
default/reverb_room = 2
|
||||
default/reverb_send = 0.0
|
||||
default/chorus_send = 0.0
|
||||
|
||||
[node name="VictoryCanvas" type="CanvasLayer" parent="."]
|
||||
|
||||
layer = 200
|
||||
offset = Vector2( 0, 0 )
|
||||
rotation = 0.0
|
||||
scale = Vector2( 1, 1 )
|
||||
|
||||
[node name="VictoryControl" type="Control" parent="VictoryCanvas"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 0.0
|
||||
margin/top = 0.0
|
||||
margin/right = 40.0
|
||||
margin/bottom = 40.0
|
||||
|
||||
[node name="StreamPlayer" type="StreamPlayer" parent="."]
|
||||
|
||||
stream/stream = ExtResource( 11 )
|
||||
stream/play = false
|
||||
stream/loop = false
|
||||
stream/volume_db = 0.0
|
||||
stream/autoplay = true
|
||||
stream/paused = false
|
||||
stream/loop_restart_time = 0.0
|
||||
stream/buffering_ms = 500
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -5,7 +5,7 @@
|
||||
[ext_resource path="res://game/rocket/DebugDraw.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://art/skull.png" type="Texture" id=4]
|
||||
[ext_resource path="res://art/explosjon3.png" type="Texture" id=5]
|
||||
[ext_resource path="res://art/cosmonaut.png" type="Texture" id=6]
|
||||
[ext_resource path="res://art/Cartoon-Astronaut.png" type="Texture" id=6]
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=1]
|
||||
|
||||
@@ -179,13 +179,11 @@ max_lines_visible = -1
|
||||
|
||||
[node name="SkullSprite" type="Sprite" parent="."]
|
||||
|
||||
visibility/visible = false
|
||||
transform/scale = Vector2( 0.1, 0.1 )
|
||||
texture = ExtResource( 4 )
|
||||
|
||||
[node name="ExplosionSprite" type="Sprite" parent="."]
|
||||
|
||||
visibility/visible = false
|
||||
texture = ExtResource( 5 )
|
||||
vframes = 4
|
||||
hframes = 4
|
||||
@@ -239,7 +237,8 @@ trigger = false
|
||||
|
||||
[node name="CosmonautSprite" type="Sprite" parent="."]
|
||||
|
||||
transform/scale = Vector2( 0.05, 0.05 )
|
||||
transform/pos = Vector2( 1.8245, 2.46402 )
|
||||
transform/scale = Vector2( 0.0557921, 0.0564672 )
|
||||
texture = ExtResource( 6 )
|
||||
|
||||
|
||||
|
||||
+32
-13
@@ -10,11 +10,12 @@ var landingspeed = 40
|
||||
# Timer variables
|
||||
var deathtimer
|
||||
var moontimer
|
||||
var moontimerdefault = 3
|
||||
var landattempttimer
|
||||
# Mission variables
|
||||
var moonlandstart = false
|
||||
var landattemptnow = true
|
||||
var flagplaced = false
|
||||
|
||||
|
||||
func _ready():
|
||||
# Turn on processes and monitors
|
||||
set_process(true)
|
||||
@@ -31,24 +32,31 @@ func _ready():
|
||||
deathtimer.connect("timeout", self, "switchtomenu")
|
||||
add_child(deathtimer)
|
||||
moontimer = Timer.new()
|
||||
moontimer.set_wait_time(1)
|
||||
moontimer.set_wait_time(moontimerdefault)
|
||||
moontimer.set_one_shot(true)
|
||||
moontimer.connect("timeout", self, "flagplanted")
|
||||
add_child(moontimer)
|
||||
#print(get_node("../../MoonSpace").get_name())
|
||||
|
||||
func _integrate_forces(state):
|
||||
if Input.is_action_pressed("thrust"):
|
||||
set_applied_force(state.get_total_gravity() - thrust.rotated(get_rot()))
|
||||
get_node("RearThrust").show()
|
||||
get_node("RevThrust").hide()
|
||||
if not get_node("Sample_thrust").is_active():
|
||||
get_node("Sample_thrust").play("thrust", true)
|
||||
elif Input.is_action_pressed("revthrust"):
|
||||
set_applied_force(state.get_total_gravity() + thrust.rotated(get_rot()))
|
||||
get_node("RearThrust").hide()
|
||||
get_node("RevThrust").show()
|
||||
if not get_node("Sample_revthrust").is_active():
|
||||
get_node("Sample_revthrust").play("thrust", true)
|
||||
else:
|
||||
set_applied_force(state.get_total_gravity() + Vector2())
|
||||
get_node("RearThrust").hide()
|
||||
get_node("RevThrust").hide()
|
||||
get_node("Sample_thrust").stop_all()
|
||||
get_node("Sample_revthrust").stop_all()
|
||||
var t = Input.is_action_pressed("bear_right") - Input.is_action_pressed("bear_left")
|
||||
set_applied_torque(torque * t)
|
||||
|
||||
@@ -57,43 +65,54 @@ func _process(delta):
|
||||
shipoverlaps = get_node("ShipArea").get_overlapping_bodies()
|
||||
footoverlaps = get_node("FootArea").get_overlapping_bodies()
|
||||
if (shipoverlaps.size() > 1):
|
||||
print("Ship overlaps")
|
||||
get_node("RocketSprite").hide()
|
||||
death()
|
||||
else:
|
||||
get_node("SkullSprite").hide()
|
||||
for i in footoverlaps:
|
||||
#print(i.get_name())
|
||||
if (get_linear_velocity().length() > crashspeed and i.get_name() != "Rocket"):
|
||||
death()
|
||||
if(i.get_name() == "Moon" and get_linear_velocity().length() < landingspeed and flagplaced == false):
|
||||
print("LANDED!")
|
||||
if(i.get_name() == "Moon" and get_linear_velocity().length() < landingspeed and flagplaced == false and landattemptnow == false):
|
||||
#print("LANDED!")
|
||||
moonland()
|
||||
|
||||
if moontimer.is_active() and footoverlaps.size() < 2:
|
||||
moontimer.stop()
|
||||
moontimer.set_wait_time(moontimerdefault)
|
||||
landattemptnow = false
|
||||
|
||||
|
||||
func death():
|
||||
moontimer.disconnect("timeout", self, "flagplanted")
|
||||
get_node("ExplosionSprite").show()
|
||||
get_node("RocketSprite").hide()
|
||||
get_node("ExplosionSprite").get_node("AnimationPlayer").play("explode")
|
||||
get_node("Sample_explosion").play("explosion", true)
|
||||
get_node("SkullSprite").show()
|
||||
set_process(false)
|
||||
deathtimer.set_active(true)
|
||||
deathtimer.start()
|
||||
#while(deathtimer.get_wait_time() > 0.1):
|
||||
print(deathtimer.get_wait_time())
|
||||
#print(deathtimer.get_wait_time())
|
||||
|
||||
func moonland():
|
||||
print("START MOONLAND")
|
||||
set_process(false)
|
||||
#set_process(false)
|
||||
landattemptnow = true
|
||||
moontimer.set_active(true)
|
||||
moonlandstart = true
|
||||
get_tree().get_root().set_disable_input(true)
|
||||
#get_tree().get_root().set_disable_input(true)
|
||||
moontimer.start()
|
||||
|
||||
func flagplanted():
|
||||
globalvar.finaltime = get_node("../../MoonSpace/CanvasLayer/TimeLabel").time
|
||||
#finaltime = get_node("../../CanvasLayer/TimeLabel").time
|
||||
flagplaced = true
|
||||
print("FLAG PLACED")
|
||||
get_tree().get_root().set_disable_input(false)
|
||||
#get_tree().get_root().set_disable_input(false)
|
||||
get_node("CosmonautSprite").show()
|
||||
set_process(true)
|
||||
# get_tree().set_pause(true)
|
||||
get_tree().change_scene("res://game/gui/victory/Victory.tscn")
|
||||
#set_process(true)
|
||||
|
||||
func switchtomenu():
|
||||
get_tree().change_scene("res://game/gui/menu/Menu.tscn")
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
extends Node
|
||||
|
||||
# class member variables go here, for example:
|
||||
# var a = 2
|
||||
# var b = "textvar"
|
||||
|
||||
var finaltime = 0
|
||||
|
||||
func _ready():
|
||||
# Called every time the node is added to the scene.
|
||||
# Initialization here
|
||||
pass
|
||||
@@ -0,0 +1,14 @@
|
||||
extends VButtonArray
|
||||
|
||||
# class member variables go here, for example:
|
||||
# var a = 2
|
||||
# var b = "textvar"
|
||||
|
||||
func _ready():
|
||||
# Called every time the node is added to the scene.
|
||||
# Initialization here
|
||||
pass
|
||||
|
||||
|
||||
func _on_MenuButton_pressed():
|
||||
get_tree().change_scene("res://game/gui/menu/Menu.tscn")
|
||||
Reference in New Issue
Block a user