Skip to content

Commit

Permalink
Added WIP Plander mini game
Browse files Browse the repository at this point in the history
- Added WIP Plander mini game.
- Flight is broken but fuel meter is working.
- Particles are not setup correctly
- There are no win lose conditions setup yet.
  • Loading branch information
pokeparadox committed Dec 5, 2021
1 parent 9ccf463 commit 0b81799
Show file tree
Hide file tree
Showing 52 changed files with 775 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Games/ExampleGameA.tscn
@@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Games/ExampleGameA.gd" type="Script" id=1]
[ext_resource path="res://Games/ExampleGameA/ExampleGameA.gd" type="Script" id=1]

[sub_resource type="CanvasItemMaterial" id=1]

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Games/ExampleGameB.tscn
@@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Games/ExampleGameB.gd" type="Script" id=1]
[ext_resource path="res://Games/ExampleGameB/ExampleGameB.gd" type="Script" id=1]

[sub_resource type="CanvasItemMaterial" id=1]

Expand Down
File renamed without changes.
38 changes: 38 additions & 0 deletions Games/RocketEscape.tscn
@@ -0,0 +1,38 @@
[gd_scene load_steps=10 format=2]

[ext_resource path="res://Games/RocketEscape/RocketEscape.gd" type="Script" id=1]
[ext_resource path="res://Games/RocketEscape/Stars/LittleStarField.tscn" type="PackedScene" id=2]
[ext_resource path="res://Games/RocketEscape/Stars/StarField.tscn" type="PackedScene" id=3]
[ext_resource path="res://Games/RocketEscape/Planet/Planet.tscn" type="PackedScene" id=4]
[ext_resource path="res://Games/RocketEscape/Ground/Ground.tscn" type="PackedScene" id=5]
[ext_resource path="res://Games/RocketEscape/Rocket/Rocket.tscn" type="PackedScene" id=6]
[ext_resource path="res://Games/RocketEscape/Platform/Platform.tscn" type="PackedScene" id=7]
[ext_resource path="res://Games/RocketEscape/Fuel/FuelBar.tscn" type="PackedScene" id=8]

[sub_resource type="PhysicsMaterial" id=1]
friction = 0.8
bounce = 0.1

[node name="RocketEscape" type="Node2D"]
script = ExtResource( 1 )

[node name="LittleStarField" parent="." instance=ExtResource( 2 )]
NumStars = 50

[node name="StarField" parent="." instance=ExtResource( 3 )]
NumStars = 15

[node name="Planet" parent="." instance=ExtResource( 4 )]

[node name="Ground" parent="." instance=ExtResource( 5 )]
position = Vector2( 400, 421 )

[node name="Rocket" parent="." instance=ExtResource( 6 )]
position = Vector2( 45, 343 )
physics_material_override = SubResource( 1 )
gravity_scale = 0.6
contacts_reported = 2

[node name="Platform" parent="." instance=ExtResource( 7 )]

[node name="FuelBar" parent="." instance=ExtResource( 8 )]
19 changes: 19 additions & 0 deletions Games/RocketEscape/Fuel/FuelBar.gd
@@ -0,0 +1,19 @@
extends Node2D
signal FuelLevelChanged
export var FuelLevel = 100
export var Dimensions = Vector2(150, 15)
export var BackgroundColour = Color(1,1,1)
export var ForegroundColour = Color(1,0,0)
export var BorderSize = 1

func _draw():
draw_rect(Rect2(position, Dimensions), BackgroundColour)
var scale = FuelLevel/100.0
var dims = Dimensions
dims.x = dims.x * scale
var offset = Vector2(BorderSize, BorderSize)
draw_rect(Rect2(position+offset, dims-(offset*2)), ForegroundColour)

func OnFuelLevelChanged(var fuel):
self.FuelLevel = fuel
self.update()
6 changes: 6 additions & 0 deletions Games/RocketEscape/Fuel/FuelBar.tscn
@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]

[ext_resource path="res://Games/RocketEscape/Fuel/FuelBar.gd" type="Script" id=1]

[node name="FuelBar" type="Node2D"]
script = ExtResource( 1 )
Binary file added Games/RocketEscape/Ground/Ground.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions Games/RocketEscape/Ground/Ground.png.import
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/Ground.png-112c67b0ed0e8020afd6d96e04d8fde5.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Games/RocketEscape/Ground/Ground.png"
dest_files=[ "res://.import/Ground.png-112c67b0ed0e8020afd6d96e04d8fde5.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=true
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
14 changes: 14 additions & 0 deletions Games/RocketEscape/Ground/Ground.tscn
@@ -0,0 +1,14 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Games/RocketEscape/Ground/Ground.png" type="Texture" id=2]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 398.959, 45.3712 )

[node name="Ground" type="StaticBody2D"]

[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
7 changes: 7 additions & 0 deletions Games/RocketEscape/Planet/Planet.gd
@@ -0,0 +1,7 @@
extends Sprite

func _ready():
var pos = Resolution.GetResolution()
pos.x = pos.x * randf()
pos.y = pos.y * randf()
position = pos
Binary file added Games/RocketEscape/Planet/Planet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Games/RocketEscape/Planet/Planet.png.flags
@@ -0,0 +1,2 @@
filter=false
gen_mipmaps=false
35 changes: 35 additions & 0 deletions Games/RocketEscape/Planet/Planet.png.import
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/Planet.png-cf04a1b0bbf47fd82708e3589d58b210.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Games/RocketEscape/Planet/Planet.png"
dest_files=[ "res://.import/Planet.png-cf04a1b0bbf47fd82708e3589d58b210.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=true
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
8 changes: 8 additions & 0 deletions Games/RocketEscape/Planet/Planet.tscn
@@ -0,0 +1,8 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Games/RocketEscape/Planet/Planet.png" type="Texture" id=2]
[ext_resource path="res://Games/RocketEscape/Planet/Planet.gd" type="Script" id=3]

[node name="Planet" type="Sprite"]
texture = ExtResource( 2 )
script = ExtResource( 3 )
31 changes: 31 additions & 0 deletions Games/RocketEscape/Platform/LeftSegment.tscn
@@ -0,0 +1,31 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Games/RocketEscape/Platform/leftlight.png" type="Texture" id=2]

[sub_resource type="Animation" id=2]
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5, 1 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 1,
"values": [ 0, 1, 0 ]
}

[node name="LeftSegment" type="StaticBody2D"]

[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
hframes = 2
frame = 1

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
polygon = PoolVector2Array( 12.0556, 11.102, 12.0556, -3.02903, -2.70341, -3.02903, -2.91276, -5.12251, -10.9727, -5.12251, -10.9727, -1.87762, -9.1932, -1.04023, -9.1932, 5.76358, -11.81, 9.53185, -10.554, 11.102 )

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/Flash = SubResource( 2 )
14 changes: 14 additions & 0 deletions Games/RocketEscape/Platform/MiddleSegment.tscn
@@ -0,0 +1,14 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Games/RocketEscape/Platform/platform.png" type="Texture" id=2]

[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 12.0368, 7.15685 )

[node name="MiddleSegment" type="StaticBody2D"]

[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 2 )
22 changes: 22 additions & 0 deletions Games/RocketEscape/Platform/Platform.gd
@@ -0,0 +1,22 @@
extends Node2D

var middleSegs = []

func _ready():
var numSegs = 3
var beginNode = get_node("LeftSegment")
var leftAnim = get_node("LeftSegment/AnimationPlayer").play("Flash")
var middle = get_node("MiddleSegment")
var rightNode = get_node("RightSegment")
var rightAnim = get_node("RightSegment/AnimationPlayer").play("Flash")
var width = get_node("MiddleSegment/Sprite").get_texture().get_width()
middleSegs.append(middle)
for i in range(1, numSegs):
var ins = preload("res://Games/RocketEscape/Platform/MiddleSegment.tscn").instance()
ins.position = (middle.position + Vector2(width*i, 0))
middleSegs.append(ins)


rightNode.position = (middleSegs.back().position + Vector2(width, 0))
for i in middleSegs:
self.add_child(i)
15 changes: 15 additions & 0 deletions Games/RocketEscape/Platform/Platform.tscn
@@ -0,0 +1,15 @@
[gd_scene load_steps=5 format=2]

[ext_resource path="res://Games/RocketEscape/Platform/Platform.gd" type="Script" id=1]
[ext_resource path="res://Games/RocketEscape/Platform/LeftSegment.tscn" type="PackedScene" id=2]
[ext_resource path="res://Games/RocketEscape/Platform/MiddleSegment.tscn" type="PackedScene" id=3]
[ext_resource path="res://Games/RocketEscape/Platform/RightSegment.tscn" type="PackedScene" id=4]

[node name="Platform" type="Node2D"]
script = ExtResource( 1 )

[node name="LeftSegment" parent="." instance=ExtResource( 2 )]

[node name="MiddleSegment" parent="." instance=ExtResource( 3 )]

[node name="RightSegment" parent="." instance=ExtResource( 4 )]
30 changes: 30 additions & 0 deletions Games/RocketEscape/Platform/RightSegment.tscn
@@ -0,0 +1,30 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Games/RocketEscape/Platform/rightlight.png" type="Texture" id=2]

[sub_resource type="Animation" id=5]
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5, 1 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 1,
"values": [ 0, 1, 0 ]
}

[node name="RightSegment" type="StaticBody2D"]

[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
hframes = 2

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
polygon = PoolVector2Array( -11.8837, -3.134, -11.8837, 10.997, 11.0399, 11.1017, 11.6679, 9.53156, 9.15577, 5.65862, 9.15577, -0.935842, 10.9352, -2.08726, 11.1446, -5.01813, 2.98001, -5.01813, 2.98001, -3.134 )

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/Flash = SubResource( 5 )
Binary file added Games/RocketEscape/Platform/leftlight.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Games/RocketEscape/Platform/leftlight.png.flags
@@ -0,0 +1,2 @@
filter=false
gen_mipmaps=false
35 changes: 35 additions & 0 deletions Games/RocketEscape/Platform/leftlight.png.import
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/leftlight.png-d1f4af530fd3a39b3e187afced45b496.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Games/RocketEscape/Platform/leftlight.png"
dest_files=[ "res://.import/leftlight.png-d1f4af530fd3a39b3e187afced45b496.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=true
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
Binary file added Games/RocketEscape/Platform/platform.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Games/RocketEscape/Platform/platform.png.flags
@@ -0,0 +1,2 @@
filter=false
gen_mipmaps=false
35 changes: 35 additions & 0 deletions Games/RocketEscape/Platform/platform.png.import
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/platform.png-10d77cfe26e3672e48be8f456330e05e.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Games/RocketEscape/Platform/platform.png"
dest_files=[ "res://.import/platform.png-10d77cfe26e3672e48be8f456330e05e.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=true
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
Binary file added Games/RocketEscape/Platform/pole.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0b81799

Please sign in to comment.