mirror of
https://github.com/jwinterm/MoonLaunch.git
synced 2026-10-17 05:41:29 +02:00
Got menu and explosion working
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
+1
-1
@@ -1,7 +1,7 @@
|
||||
[application]
|
||||
|
||||
name="MoonLaunch"
|
||||
main_scene="res://game/levels/1/Level1.tscn"
|
||||
main_scene="res://game/gui/menu/Menu.tscn"
|
||||
boot_splash="res://art/rocket.png"
|
||||
icon="res://art/rocket.png"
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
extends VBoxContainer
|
||||
|
||||
# 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_QuitButton_pressed():
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _on_PlayButton_pressed():
|
||||
get_tree().change_scene("res://game/levels/1/Level1.tscn")
|
||||
@@ -0,0 +1,158 @@
|
||||
[gd_scene load_steps=8 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]
|
||||
[ext_resource path="res://fonts/computerspeakfont.fnt" type="BitmapFont" id=3]
|
||||
[ext_resource path="res://art/rocket.png" type="Texture" id=4]
|
||||
[ext_resource path="res://art/1311069131-800px.png" type="Texture" id=5]
|
||||
[ext_resource path="res://art/Earth-800px.png" type="Texture" id=6]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
|
||||
resource/name = "move"
|
||||
length = 10.0
|
||||
loop = true
|
||||
step = 0.1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:transform/pos")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/imported = false
|
||||
tracks/0/keys = {
|
||||
"times": FloatArray( 0, 10 ),
|
||||
"transitions": FloatArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( -170.357, 855.319 ), Vector2( 2050, 855.319 ) ]
|
||||
}
|
||||
|
||||
[node name="MenuButtonsVbox" type="Node2D"]
|
||||
|
||||
[node name="SpaceBG" type="Sprite" parent="."]
|
||||
|
||||
transform/pos = Vector2( 955.795, 531.653 )
|
||||
transform/scale = Vector2( 1.94871, 1.12392 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="VButtonArray" type="VBoxContainer" parent="."]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 2
|
||||
margin/left = 547.0
|
||||
margin/top = 450.0
|
||||
margin/right = 1322.0
|
||||
margin/bottom = 942.0
|
||||
alignment = 0
|
||||
script/script = ExtResource( 2 )
|
||||
|
||||
[node name="PlayButton" type="MenuButton" parent="VButtonArray"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 3
|
||||
size_flags/stretch_ratio = 5.0
|
||||
margin/left = 0.0
|
||||
margin/top = 0.0
|
||||
margin/right = 775.0
|
||||
margin/bottom = 161.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
toggle_mode = false
|
||||
click_on_press = true
|
||||
enabled_focus_mode = 0
|
||||
shortcut = null
|
||||
text = "Play!"
|
||||
flat = true
|
||||
items = [ ]
|
||||
|
||||
[node name="HelpButton" type="MenuButton" parent="VButtonArray"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 3
|
||||
size_flags/stretch_ratio = 5.0
|
||||
margin/left = 0.0
|
||||
margin/top = 165.0
|
||||
margin/right = 775.0
|
||||
margin/bottom = 326.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
toggle_mode = false
|
||||
click_on_press = true
|
||||
enabled_focus_mode = 0
|
||||
shortcut = null
|
||||
text = "Help"
|
||||
flat = true
|
||||
items = [ ]
|
||||
|
||||
[node name="QuitButton" type="MenuButton" parent="VButtonArray"]
|
||||
|
||||
focus/ignore_mouse = false
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 3
|
||||
size_flags/stretch_ratio = 5.0
|
||||
margin/left = 0.0
|
||||
margin/top = 330.0
|
||||
margin/right = 775.0
|
||||
margin/bottom = 492.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
toggle_mode = false
|
||||
click_on_press = true
|
||||
enabled_focus_mode = 0
|
||||
shortcut = null
|
||||
text = "Quit"
|
||||
flat = true
|
||||
items = [ ]
|
||||
|
||||
[node name="RocketSprite" type="Sprite" parent="."]
|
||||
|
||||
transform/pos = Vector2( -170.357, 855.319 )
|
||||
transform/rot = -90.0
|
||||
transform/scale = Vector2( 0.3, 0.3 )
|
||||
texture = ExtResource( 4 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="RocketSprite"]
|
||||
|
||||
playback/process_mode = 1
|
||||
playback/default_blend_time = 0.0
|
||||
root/root = NodePath("..")
|
||||
anims/move = SubResource( 1 )
|
||||
playback/active = true
|
||||
playback/speed = 1.0
|
||||
blend_times = [ ]
|
||||
autoplay = "move"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
|
||||
rect/scale = Vector2( 10, 10 )
|
||||
focus/ignore_mouse = true
|
||||
focus/stop_mouse = true
|
||||
size_flags/horizontal = 2
|
||||
size_flags/vertical = 0
|
||||
margin/left = 298.0
|
||||
margin/top = 165.0
|
||||
margin/right = 436.0
|
||||
margin/bottom = 179.0
|
||||
text = "Monero Moon Launch"
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="Moon" type="Sprite" parent="."]
|
||||
|
||||
transform/pos = Vector2( 1752.97, 778.702 )
|
||||
transform/scale = Vector2( 0.385749, 0.385749 )
|
||||
texture = ExtResource( 5 )
|
||||
|
||||
[node name="Earth" type="Sprite" parent="."]
|
||||
|
||||
transform/pos = Vector2( 105.917, 976.718 )
|
||||
transform/scale = Vector2( 0.385749, 0.385749 )
|
||||
texture = ExtResource( 6 )
|
||||
|
||||
[connection signal="pressed" from="VButtonArray/PlayButton" to="VButtonArray" method="_on_PlayButton_pressed"]
|
||||
|
||||
[connection signal="pressed" from="VButtonArray/QuitButton" to="VButtonArray" method="_on_QuitButton_pressed"]
|
||||
|
||||
|
||||
+46
-11
@@ -1,9 +1,10 @@
|
||||
[gd_scene load_steps=9 format=1]
|
||||
[gd_scene load_steps=11 format=1]
|
||||
|
||||
[ext_resource path="res://game/rocket/rocket.gd" type="Script" id=1]
|
||||
[ext_resource path="res://art/rocket.png" type="Texture" id=2]
|
||||
[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]
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=1]
|
||||
|
||||
@@ -15,12 +16,29 @@ points = Vector2Array( -11.3815, 0.727529, -10.5982, -4.33918, -6.21178, -8.3797
|
||||
offsets = FloatArray( 0, 0.502924, 0.994152 )
|
||||
colors = ColorArray( 0.992188, 1, 0, 1, 0.90625, 0.390511, 0.0141602, 1, 0.90625, 0.0106201, 0.0106201, 1 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=3]
|
||||
[sub_resource type="Animation" id=3]
|
||||
|
||||
resource/name = "explode"
|
||||
length = 1.5
|
||||
loop = false
|
||||
step = 0.1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/imported = false
|
||||
tracks/0/keys = {
|
||||
"times": FloatArray( 0, 1.5 ),
|
||||
"transitions": FloatArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ 0, 13 ]
|
||||
}
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=4]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
points = Vector2Array( -0.383606, -41.7704, 7.97868, -32.9347, 17.1299, -17.7879, 18.3921, 2.72333, 11.7654, 32.3858, -12.0592, 32.7013, -18.8438, 2.72333, -15.8459, -16.0524, -10.0081, -29.4636 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=4]
|
||||
[sub_resource type="ConvexPolygonShape2D" id=5]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
points = Vector2Array( 8.6098, 32.5436, 10.5032, 39.3281, -10.6392, 39.3281, -8.43033, 32.5436 )
|
||||
@@ -78,7 +96,7 @@ params/anim_initial_pos = 0.0
|
||||
randomness/final_size = 1.0
|
||||
color/color_ramp = SubResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
[node name="RocketSprite" type="Sprite" parent="."]
|
||||
|
||||
transform/scale = Vector2( 0.1, 0.1 )
|
||||
texture = ExtResource( 2 )
|
||||
@@ -128,10 +146,32 @@ percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
[node name="SkullSprite" type="Sprite" parent="."]
|
||||
|
||||
transform/scale = Vector2( 0.1, 0.1 )
|
||||
texture = ExtResource( 4 )
|
||||
|
||||
[node name="ExplosionSprite" type="Sprite" parent="."]
|
||||
|
||||
texture = ExtResource( 5 )
|
||||
vframes = 4
|
||||
hframes = 4
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="ExplosionSprite"]
|
||||
|
||||
playback/process_mode = 1
|
||||
playback/default_blend_time = 0.0
|
||||
root/root = NodePath("..")
|
||||
anims/explode = SubResource( 3 )
|
||||
playback/active = true
|
||||
playback/speed = 1.0
|
||||
blend_times = [ ]
|
||||
autoplay = ""
|
||||
|
||||
[node name="ShipArea" type="Area2D" parent="."]
|
||||
|
||||
input/pickable = true
|
||||
shapes/0/shape = SubResource( 3 )
|
||||
shapes/0/shape = SubResource( 4 )
|
||||
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
|
||||
shapes/0/trigger = false
|
||||
gravity_vec = Vector2( 0, 1 )
|
||||
@@ -149,7 +189,7 @@ trigger = false
|
||||
[node name="FootArea" type="Area2D" parent="."]
|
||||
|
||||
input/pickable = true
|
||||
shapes/0/shape = SubResource( 4 )
|
||||
shapes/0/shape = SubResource( 5 )
|
||||
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
|
||||
shapes/0/trigger = false
|
||||
gravity_vec = Vector2( 0, 1 )
|
||||
@@ -164,9 +204,4 @@ polygon = Vector2Array( -8.43033, 32.5436, -10.6392, 39.3281, 10.5032, 39.3281,
|
||||
shape_range = Vector2( 0, 0 )
|
||||
trigger = false
|
||||
|
||||
[node name="Skull" type="Sprite" parent="."]
|
||||
|
||||
transform/scale = Vector2( 0.1, 0.1 )
|
||||
texture = ExtResource( 4 )
|
||||
|
||||
|
||||
|
||||
+26
-4
@@ -4,13 +4,20 @@ var thrust = Vector2(0, 450)
|
||||
var torque = 20000
|
||||
var shipoverlaps
|
||||
var footoverlaps
|
||||
var deathtimer
|
||||
|
||||
func _ready():
|
||||
#pass
|
||||
set_process(true)
|
||||
set_contact_monitor(true)
|
||||
set_max_contacts_reported(3)
|
||||
get_node("Skull").hide()
|
||||
get_node("SkullSprite").hide()
|
||||
get_node("ExplosionSprite").hide()
|
||||
deathtimer = Timer.new()
|
||||
deathtimer.set_wait_time(3)
|
||||
deathtimer.set_one_shot(true)
|
||||
deathtimer.connect("timeout", self, "switchtomenu")
|
||||
add_child(deathtimer)
|
||||
|
||||
func _integrate_forces(state):
|
||||
if Input.is_action_pressed("thrust"):
|
||||
@@ -30,9 +37,24 @@ func _process(delta):
|
||||
shipoverlaps = get_node("ShipArea").get_overlapping_bodies()
|
||||
footoverlaps = get_node("FootArea").get_overlapping_bodies()
|
||||
if (shipoverlaps.size() > 1):
|
||||
get_node("Skull").show()
|
||||
get_node("SkullSprite").show()
|
||||
get_node("RocketSprite").hide()
|
||||
death()
|
||||
else:
|
||||
get_node("Skull").hide()
|
||||
get_node("SkullSprite").hide()
|
||||
for i in footoverlaps:
|
||||
if(i.get_name() == "Moon"):
|
||||
get_node("Skull").show()
|
||||
get_node("SkullSprite").show()
|
||||
|
||||
func death():
|
||||
set_process(false)
|
||||
get_node("ExplosionSprite").show()
|
||||
get_node("ExplosionSprite").get_node("AnimationPlayer").play("explode")
|
||||
deathtimer.set_active(true)
|
||||
deathtimer.start()
|
||||
#while(deathtimer.get_wait_time() > 0.1):
|
||||
print(deathtimer.get_wait_time())
|
||||
|
||||
|
||||
func switchtomenu():
|
||||
get_tree().change_scene("res://game/gui/menu/Menu.tscn")
|
||||
|
||||
Reference in New Issue
Block a user