added basic level selection menu

This commit is contained in:
zoe 2021-09-11 22:35:58 +02:00
parent 8639876921
commit 2637008a33
54 changed files with 756 additions and 32 deletions

View File

@ -0,0 +1,3 @@
source_md5="000a0d387258c9454df3dcd59f7a1172"
dest_md5="80a414f3b0bc016e071a6cead064b338"

Binary file not shown.

View File

@ -0,0 +1,3 @@
source_md5="b8061f41ff77ea12d25fb5fd5c693a2f"
dest_md5="8a1cd2297a98c4e82e29968c429962c2"

Binary file not shown.

View File

@ -0,0 +1,3 @@
source_md5="a66aa5e5d30dd4fe39f12f8566543d5b"
dest_md5="aa5d1e034b28f72075b0112377e1d137"

Binary file not shown.

View File

@ -0,0 +1,3 @@
source_md5="5b9c414a91c9bff53be09be1edd454b4"
dest_md5="25ca27b3c85bfc8f8677a8b581c20c11"

View File

@ -0,0 +1,3 @@
source_md5="a94dc667572a9d3e0622a1ab00f9897f"
dest_md5="8b7a370c9f12d9073759f88ee8c88d8e"

View File

@ -0,0 +1,3 @@
source_md5="329c6530d4d663edfdd3963d862bef4d"
dest_md5="25990b2bdd6261fa0112d708889d59c5"

BIN
Aseprite/homeIcon.ase Normal file

Binary file not shown.

View File

@ -0,0 +1,63 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://Ball/sprite.png" type="Texture" id=1]
[ext_resource path="res://Ball/Ball.gd" type="Script" id=2]
[ext_resource path="res://Ball/Ball.tres" type="PhysicsMaterial" id=3]
[ext_resource path="res://Ball/BallCollision.tscn" type="PackedScene" id=4]
[sub_resource type="Animation" id=1]
resource_name = "reset"
length = 1.5
step = 0.05
tracks/0/type = "method"
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 1.5 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "reset_done"
} ]
}
tracks/1/type = "bezier"
tracks/1/path = NodePath("Sprite:position:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"points": PoolRealArray( -10, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 1.5 )
}
[node name="Ball" type="RigidBody2D"]
collision_layer = 4
mass = 90.0
physics_material_override = ExtResource( 3 )
continuous_cd = 2
contacts_reported = 4
contact_monitor = true
linear_velocity = Vector2( 0, -10 )
script = ExtResource( 2 )
[node name="CameraTransform" type="RemoteTransform2D" parent="."]
remote_path = NodePath("../../../Camera2D")
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -10 )
texture = ExtResource( 1 )
[node name="BallCollision" parent="." instance=ExtResource( 4 )]
visible = true
[node name="TrajectoryTimer" type="Timer" parent="."]
wait_time = 0.1
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/reset = SubResource( 1 )
[connection signal="timeout" from="TrajectoryTimer" to="." method="_on_TrajectoryTimer_timeout"]

View File

@ -0,0 +1,18 @@
extends Node2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
$Green.emitting = true
$Yellow.emitting = true
$Pink.emitting = true
$AnimationPlayer.play("+1Ball")
func _on_KillTimer_timeout():
queue_free()

View File

@ -64,6 +64,7 @@ tracks/1/keys = {
}
[node name="Transition" type="CanvasLayer"]
layer = 128
script = ExtResource( 2 )
[node name="TransitionSprite" type="Sprite" parent="."]

View File

@ -0,0 +1,12 @@
extends Sprite
func _ready():
var _balls_connection = GameStats.connect("balls_changed", self, "set_balls")
set_balls()
func set_balls():
if GameStats.balls_left >= 1:
var old_region_size = get_region_rect().size.y
var new_region = Rect2(0, 0, old_region_size * GameStats.balls_left - old_region_size, old_region_size)
set_region_rect(new_region)
else: set_region_rect(Rect2(0,0,0,0))

2
Menu/Button.gd Normal file
View File

@ -0,0 +1,2 @@
extends Button

View File

@ -0,0 +1,14 @@
extends Button
export var scene = "res://Menu/MainMenu.tscn"
func _on_LevelSelectButton_pressed():
disabled = true
GameStats.reset_board()
var main = get_tree().current_scene
var Fadeout = load("res://Effects/FadeOut.tscn")
var fadeout = Fadeout.instance()
fadeout.scene_to_load = scene
main.add_child(fadeout)

View File

@ -0,0 +1,11 @@
extends TextureButton
export var scene = "res://Menu/MainMenu.tscn"
func _on_LevelSelectIconButton_pressed():
disabled = true
var main = get_tree().current_scene
var Fadeout = load("res://Effects/FadeOut.tscn")
var fadeout = Fadeout.instance()
fadeout.scene_to_load = scene
main.add_child(fadeout)

View File

@ -0,0 +1,13 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Menu/Buttons/LevelSelectIconButton.gd" type="Script" id=1]
[node name="LevelSelectIconButton" type="TextureButton"]
margin_right = 40.0
margin_bottom = 40.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="." to="." method="_on_LevelSelectIconButton_pressed"]

View File

@ -0,0 +1,17 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Menu/Theme.tres" type="Theme" id=1]
[ext_resource path="res://Menu/Buttons/LevelSelectButton.gd" type="Script" id=2]
[node name="LevelSelectButton" type="Button"]
margin_right = 34.0
margin_bottom = 23.0
theme = ExtResource( 1 )
text = "01"
flat = true
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="." to="." method="_on_LevelSelectButton_pressed"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/homeIcon1.png-9461cd3b2e92e824230b000d1af9b2a8.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Menu/Icons/Home/homeIcon1.png"
dest_files=[ "res://.import/homeIcon1.png-9461cd3b2e92e824230b000d1af9b2a8.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=false
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
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/homeIcon2.png-20e23dfb7c52fef1e79c04a9e1da5755.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Menu/Icons/Home/homeIcon2.png"
dest_files=[ "res://.import/homeIcon2.png-20e23dfb7c52fef1e79c04a9e1da5755.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=false
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
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/homeIcon3.png-8340fa6ee8ceed36a6efe6c6775e76cc.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Menu/Icons/Home/homeIcon3.png"
dest_files=[ "res://.import/homeIcon3.png-8340fa6ee8ceed36a6efe6c6775e76cc.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=false
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
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

63
Menu/MainMenu.tscn Normal file
View File

@ -0,0 +1,63 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Menu/Theme.tres" type="Theme" id=1]
[ext_resource path="res://Menu/Buttons/SceneSelectButton.tscn" type="PackedScene" id=2]
[ext_resource path="res://Effects/FadeIn.tscn" type="PackedScene" id=3]
[node name="CanvasLayer" type="CanvasLayer"]
[node name="Control" type="Control" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TabContainer" type="TabContainer" parent="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Main Menu" type="Tabs" parent="Control/TabContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
theme = ExtResource( 1 )
[node name="Levels" type="Tabs" parent="Control/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
theme = ExtResource( 1 )
[node name="GridContainer" type="GridContainer" parent="Control/TabContainer/Levels"]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="LevelSelectButton" parent="Control/TabContainer/Levels/GridContainer" instance=ExtResource( 2 )]
flat = false
scene = "res://Stages/EmptyStage.tscn"
[node name="Settings" type="Tabs" parent="Control/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
theme = ExtResource( 1 )
[node name="Transition" parent="." instance=ExtResource( 3 )]

View File

@ -30,23 +30,17 @@ __meta__ = {
}
[node name="CenterContainer" type="CenterContainer" parent="Control/Panel"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -160.0
margin_top = -76.0
margin_right = 160.0
margin_bottom = 76.0
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="GridContainer" type="GridContainer" parent="Control/Panel/CenterContainer"]
margin_left = 117.0
margin_top = 65.0
margin_right = 203.0
margin_bottom = 87.0
margin_left = 123.0
margin_top = 71.0
margin_right = 209.0
margin_bottom = 93.0
[node name="Heading" type="Label" parent="Control/Panel/CenterContainer/GridContainer"]
margin_right = 86.0
@ -55,8 +49,8 @@ theme = ExtResource( 1 )
text = "you won!"
align = 1
[node name="ButtonRow" type="GridContainer" parent="Control/Panel/CenterContainer/GridContainer"]
[node name="ButtonRow" type="HBoxContainer" parent="Control/Panel/CenterContainer/GridContainer"]
margin_top = 22.0
margin_right = 86.0
margin_bottom = 22.0
columns = 4
alignment = 1

View File

@ -1,11 +1,9 @@
[gd_resource type="Theme" load_steps=7 format=2]
[gd_resource type="Theme" load_steps=6 format=2]
[ext_resource path="res://Font/Papercut/Papercut.ttf" type="DynamicFontData" id=1]
[ext_resource path="res://Font/Yoster-island/Yoster.ttf" type="DynamicFontData" id=2]
[sub_resource type="DynamicFont" id=1]
size = 24
font_data = ExtResource( 1 )
font_data = ExtResource( 2 )
[sub_resource type="DynamicFont" id=2]
size = 18

View File

@ -4,7 +4,7 @@ func _ready():
$AnimationPlayer.play("win")
func _on_AnimationPlayer_animation_finished(anim_name):
func _on_AnimationPlayer_animation_finished(_anim_name):
$Congratulations.visible = false
$Congratulations2.visible = false
$Control.visible = true

View File

@ -1,9 +1,13 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=10 format=2]
[ext_resource path="res://Menu/MenuPage.tscn" type="PackedScene" id=1]
[ext_resource path="res://Menu/Buttons/RestartButton.tscn" type="PackedScene" id=2]
[ext_resource path="res://Menu/Theme.tres" type="Theme" id=3]
[ext_resource path="res://Menu/WinScreen.gd" type="Script" id=4]
[ext_resource path="res://Menu/Buttons/LevelSelectIconButton.tscn" type="PackedScene" id=5]
[ext_resource path="res://Menu/Icons/Home/homeIcon1.png" type="Texture" id=6]
[ext_resource path="res://Menu/Icons/Home/homeIcon2.png" type="Texture" id=7]
[ext_resource path="res://Menu/Icons/Home/homeIcon3.png" type="Texture" id=8]
[sub_resource type="Animation" id=1]
resource_name = "win"
@ -36,15 +40,25 @@ script = ExtResource( 4 )
visible = false
[node name="GridContainer" parent="Control/Panel/CenterContainer" index="0"]
margin_top = 49.0
margin_bottom = 103.0
margin_top = 55.0
margin_bottom = 109.0
[node name="ButtonRow" parent="Control/Panel/CenterContainer/GridContainer" index="1"]
margin_bottom = 54.0
[node name="RestartButton" parent="Control/Panel/CenterContainer/GridContainer/ButtonRow" index="0" instance=ExtResource( 2 )]
margin_left = 9.0
margin_right = 41.0
margin_bottom = 32.0
[node name="LevelSelectIconButton" parent="Control/Panel/CenterContainer/GridContainer/ButtonRow" index="1" instance=ExtResource( 5 )]
margin_left = 45.0
margin_right = 77.0
margin_bottom = 32.0
texture_normal = ExtResource( 6 )
texture_pressed = ExtResource( 8 )
texture_hover = ExtResource( 7 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="." index="1"]
anims/win = SubResource( 1 )

View File

@ -0,0 +1,5 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Pegs/Green/HitParticles.tscn" type="PackedScene" id=1]
[node name="BarHitParticles" instance=ExtResource( 1 )]

View File

@ -0,0 +1,6 @@
[gd_scene format=2]
[node name="GraceTimer" type="Timer"]
wait_time = 0.25
one_shot = true
autostart = true

33
Pegs/Green/GreenBar.gd Normal file
View File

@ -0,0 +1,33 @@
extends StaticBody2D
var can_be_destroyed = false
var particle_emitting_direction = Vector2.ZERO
func _ready():
$AnimationPlayer.play("spawn")
func make_green():
explode()
func explode():
if can_be_destroyed:
spawn_hit_particles(particle_emitting_direction)
queue_free()
func _on_GraceTimer_timeout():
can_be_destroyed = true
func set_particle_direction(vector):
particle_emitting_direction = vector
# spawns particles
func spawn_hit_particles(vector):
set_particle_direction(vector)
var Hit_effect = load("res://Pegs/Green/BarHitParticles.tscn")
var hit_effect = Hit_effect.instance()
var main = get_tree().current_scene
hit_effect.position = position
hit_effect.emitting_direction = particle_emitting_direction
main.add_child(hit_effect)

47
Pegs/Green/GreenBar.tscn Normal file
View File

@ -0,0 +1,47 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://Pegs/Green/bar.png" type="Texture" id=1]
[ext_resource path="res://Pegs/Green/GreenBar.gd" type="Script" id=2]
[ext_resource path="res://Pegs/Green/GraceTimer.tscn" type="PackedScene" id=3]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 16, 3 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 15, 4 )
[sub_resource type="Animation" id=3]
resource_name = "spawn"
length = 0.25
step = 0.025
tracks/0/type = "value"
tracks/0/path = NodePath(".:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.025, 0.05, 0.1, 0.25 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 0,
"values": [ Vector2( 0.75, 0.75 ), Vector2( 1.25, 1.25 ), Vector2( 0.9, 0.9 ), Vector2( 1.1, 1.1 ), Vector2( 1, 1 ) ]
}
[node name="Node2D" type="StaticBody2D"]
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[node name="CollisionShape2D2" type="CollisionShape2D" parent="."]
shape = SubResource( 2 )
[node name="GraceTimer" parent="." instance=ExtResource( 3 )]
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/spawn = SubResource( 3 )
[connection signal="timeout" from="GraceTimer" to="." method="_on_GraceTimer_timeout"]

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://Pegs/Green/green.png" type="Texture" id=1]
[ext_resource path="res://Pegs/Green/GreenPeg.gd" type="Script" id=2]
[ext_resource path="res://Pegs/Green/GraceTimer.tscn" type="PackedScene" id=3]
[ext_resource path="res://Pegs/DefaultPegCollisionShape.tscn" type="PackedScene" id=4]
[ext_resource path="res://Pegs/Green/GreenPegAnimationPlayer.gd" type="Script" id=5]
@ -37,9 +38,6 @@ texture = ExtResource( 1 )
anims/GetBigger = SubResource( 2 )
script = ExtResource( 5 )
[node name="GraceTimer" type="Timer" parent="."]
wait_time = 0.25
one_shot = true
autostart = true
[node name="GraceTimer" parent="." instance=ExtResource( 3 )]
[connection signal="timeout" from="GraceTimer" to="." method="_on_GraceTimer_timeout"]

BIN
Pegs/Green/bar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

34
Pegs/Green/bar.png.import Normal file
View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bar.png-d7e4d2024b19e469331d30811843a8f1.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Pegs/Green/bar.png"
dest_files=[ "res://.import/bar.png-d7e4d2024b19e469331d30811843a8f1.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=false
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
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
Pegs/Pink/bar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

34
Pegs/Pink/bar.png.import Normal file
View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bar.png-1f38d96b5a928fd170ebbc045a7a03a7.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Pegs/Pink/bar.png"
dest_files=[ "res://.import/bar.png-1f38d96b5a928fd170ebbc045a7a03a7.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=false
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
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

15
Pegs/Purple/PurpleBar.gd Normal file
View File

@ -0,0 +1,15 @@
extends StaticBody2D
func make_green():
var main = get_tree().current_scene
var Green_bar = preload("res://Pegs/Green/GreenBar.tscn")
var green_bar = Green_bar.instance()
green_bar.global_position = global_position
green_bar.global_rotation = global_rotation
main.add_child(green_bar)
queue_free()
func bouncy():
pass

View File

@ -0,0 +1,27 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://Pegs/Purple/PurpleBar.gd" type="Script" id=1]
[ext_resource path="res://Pegs/Purple/bar.png" type="Texture" id=2]
[sub_resource type="PhysicsMaterial" id=1]
friction = 5.0
absorbent = true
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 15, 4 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 16, 3 )
[node name="PurpleBar" type="StaticBody2D"]
physics_material_override = SubResource( 1 )
script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 2 )
[node name="CollisionShape2D2" type="CollisionShape2D" parent="."]
shape = SubResource( 3 )

View File

@ -12,4 +12,3 @@ script = ExtResource( 1 )
texture = ExtResource( 2 )
[node name="DefaultPegCollisionShape" parent="." instance=ExtResource( 3 )]
visible = false

BIN
Pegs/Purple/bar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bar.png-8143f2de97cbe2af35e481c665501058.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Pegs/Purple/bar.png"
dest_files=[ "res://.import/bar.png-8143f2de97cbe2af35e481c665501058.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=false
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
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=25 format=2]
[gd_scene load_steps=26 format=2]
[ext_resource path="res://Cannon/Cannon.tscn" type="PackedScene" id=1]
[ext_resource path="res://Borders/tileset.png" type="Texture" id=2]
@ -12,6 +12,7 @@
[ext_resource path="res://Stages/World.gd" type="Script" id=10]
[ext_resource path="res://Effects/FadeIn.tscn" type="PackedScene" id=11]
[ext_resource path="res://Stages/Background.png" type="Texture" id=12]
[ext_resource path="res://Pegs/Purple/PurpleBar.tscn" type="PackedScene" id=13]
[sub_resource type="ConvexPolygonShape2D" id=1]
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
@ -281,6 +282,22 @@ position = Vector2( 111, 47 )
[node name="PinkPeg2" parent="Pegs" instance=ExtResource( 8 )]
position = Vector2( 168, 160 )
[node name="StaticBody2D" parent="Pegs" instance=ExtResource( 13 )]
position = Vector2( 283, 80 )
rotation = -0.785397
[node name="StaticBody2D2" parent="Pegs" instance=ExtResource( 13 )]
position = Vector2( 259, 104 )
rotation = -0.785397
[node name="StaticBody2D3" parent="Pegs" instance=ExtResource( 13 )]
position = Vector2( 235, 128 )
rotation = -0.785397
[node name="StaticBody2D4" parent="Pegs" instance=ExtResource( 13 )]
position = Vector2( 83, 62 )
rotation = 0.785397
[node name="PinkPeg4" parent="Pegs" instance=ExtResource( 8 )]
position = Vector2( 216, 160 )

View File

@ -30,6 +30,10 @@ func restart_level():
var fadeout = Fadeout.instance()
fadeout.scene_to_load = current_stage
main.add_child(fadeout)
reset_board()
func reset_board():
balls_left = max_balls
pinks_left = 0
level_won = false

View File

@ -0,0 +1,35 @@
extends Node
signal balls_changed()
var max_balls = 2
var balls_left
var pinks_left = 0
var level_won = false
var current_stage = "res://Stages/EmptyStage.tscn"
func add_balls(balls):
balls_left += balls
decide_game()
emit_signal("balls_changed")
func decide_game():
# game is won
if (pinks_left <= 0):
var main = get_tree().current_scene
var Winscreen = preload("res://Menu/WinScreen.tscn")
var winscreen = Winscreen.instance()
main.add_child(winscreen)
# game is lost
elif (balls_left <= 0):
restart_level()
func restart_level():
pinks_left = 0
level_won = false
var main = get_tree().current_scene
var Fadeout = load("res://Effects/FadeOut.tscn")
var fadeout = Fadeout.instance()
fadeout.scene_to_load = current_stage
main.add_child(fadeout)

View File

@ -2,7 +2,7 @@
name="Linux/X11"
platform="Linux/X11"
runnable=false
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
@ -22,3 +22,76 @@ texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
[preset.1]
name="Windows Desktop"
platform="Windows Desktop"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
script_export_mode=1
script_encryption_key=""
[preset.1.options]
custom_template/debug=""
custom_template/release=""
binary_format/64_bits=true
binary_format/embed_pck=true
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
codesign/enable=false
codesign/identity=""
codesign/password=""
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PoolStringArray( )
application/icon=""
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""
[preset.2]
name="Mac OSX"
platform="Mac OSX"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
script_export_mode=1
script_encryption_key=""
[preset.2.options]
custom_template/debug=""
custom_template/release=""
application/name=""
application/info="Made with Godot Engine"
application/icon=""
application/identifier=""
application/signature=""
application/short_version="1.0"
application/version="1.0"
application/copyright=""
display/high_res=false
privacy/camera_usage_description=""
privacy/microphone_usage_description=""
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false

Binary file not shown.

Binary file not shown.

View File

@ -11,7 +11,7 @@ config_version=4
[application]
config/name="pegchamp"
run/main_scene="res://Stages/EmptyStage.tscn"
run/main_scene="res://Menu/MainMenu.tscn"
boot_splash/image="res://icon.png"
boot_splash/fullsize=false
boot_splash/use_filter=false
@ -32,6 +32,29 @@ mouse_cursor/custom_image="res://icon.png"
window/stretch/mode="2d"
window/stretch/aspect="keep"
[importer_defaults]
texture={
"compress/bptc_ldr": 0,
"compress/hdr_mode": 0,
"compress/lossy_quality": 0.7,
"compress/mode": 0,
"compress/normal_map": 0,
"detect_3d": false,
"flags/anisotropic": false,
"flags/filter": false,
"flags/mipmaps": false,
"flags/repeat": 0,
"flags/srgb": 2,
"process/HDR_as_SRGB": false,
"process/fix_alpha_border": true,
"process/invert_color": false,
"process/premult_alpha": false,
"size_limit": 0,
"stream": false,
"svg/scale": 1.0
}
[input]
shoot={