Added pause and mute.

Improved fonts and font scaling
Added level editor
This commit is contained in:
2024-05-05 22:36:32 +01:00
parent fef3ae9d8e
commit 81d8e14746
355 changed files with 3231 additions and 5428 deletions

View File

@@ -3,10 +3,35 @@ class_name Paddle
var width : int :
get:
return $CollisionShape2D.shape.size.x
func _on_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void:
pass # Replace with function body.
return $CollisionShape2D.shape.height
func hit() -> void:
pass
func big() -> void:
$Normal.visible = false
$Small.visible = false
$Big.visible = true
$CollisionShape2D.shape.height = 40
$EffectTimer.start(30)
$GrowSound.play()
pass
func small() -> void:
$Normal.visible = false
$Small.visible = true
$Big.visible = false
$CollisionShape2D.shape.height = 24
$EffectTimer.start(30)
$ShrinkSound.play()
pass
func normal() -> void:
$Normal.visible = true
$Small.visible = false
$Big.visible = false
$CollisionShape2D.shape.height = 32
pass
func _on_effect_timer_timeout() -> void:
normal()

View File

@@ -1,20 +1,80 @@
[gd_scene load_steps=3 format=3 uid="uid://dndemjw7up2r6"]
[gd_scene load_steps=9 format=3 uid="uid://dndemjw7up2r6"]
[ext_resource type="PhysicsMaterial" uid="uid://cql6t5hd40fgn" path="res://CorePhysics.tres" id="1_oa72h"]
[ext_resource type="Script" path="res://Paddle/Paddle.gd" id="1_swo0j"]
[ext_resource type="Texture2D" uid="uid://0pjgtr5e102q" path="res://Paddle/PaddleNormal.png" id="2_po2us"]
[ext_resource type="Texture2D" uid="uid://cjp5oq8ors5ua" path="res://Paddle/PaddleSmall.png" id="3_jvb7q"]
[ext_resource type="Texture2D" uid="uid://dx3a3rva5g7ex" path="res://Paddle/PaddleBig.png" id="5_w5k41"]
[ext_resource type="AudioStream" uid="uid://ds7om6qbk3p6l" path="res://Sounds/Grow.wav" id="6_hpb6a"]
[ext_resource type="AudioStream" uid="uid://bd2o8lynhy3wn" path="res://Sounds/Shrink.wav" id="7_3krfd"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_3bg1o"]
size = Vector2(32, 8)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_tamfm"]
radius = 4.0
height = 32.0
[node name="Paddle" type="StaticBody2D"]
collision_layer = 3
input_pickable = true
constant_linear_velocity = Vector2(0, -50)
physics_material_override = ExtResource("1_oa72h")
script = ExtResource("1_swo0j")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_3bg1o")
rotation = 1.5708
shape = SubResource("CapsuleShape2D_tamfm")
[node name="Polygon2D" type="Polygon2D" parent="."]
polygon = PackedVector2Array(-16, -4, 16, -4, 16, 4, -16, 4)
[node name="Small" type="Node2D" parent="."]
visible = false
[connection signal="input_event" from="." to="." method="_on_input_event"]
[node name="Polygon2D" type="Polygon2D" parent="Small"]
z_index = -1
position = Vector2(2, 4)
color = Color(0, 0, 0, 0.247059)
polygon = PackedVector2Array(-10, -4, 10, -4, 12, -2, 12, 2, 10, 4, -10, 4, -12, 2, -12, -2)
[node name="TextureRect" type="TextureRect" parent="Small"]
offset_left = -12.0
offset_top = -4.0
offset_right = 12.0
offset_bottom = 4.0
texture = ExtResource("3_jvb7q")
[node name="Normal" type="Node2D" parent="."]
[node name="Polygon2D" type="Polygon2D" parent="Normal"]
z_index = -1
position = Vector2(2, 4)
color = Color(0, 0, 0, 0.247059)
polygon = PackedVector2Array(-14, -4, 14, -4, 16, -2, 16, 2, 14, 4, -14, 4, -16, 2, -16, -2)
[node name="TextureRect" type="TextureRect" parent="Normal"]
offset_left = -16.0
offset_top = -4.0
offset_right = 16.0
offset_bottom = 4.0
texture = ExtResource("2_po2us")
[node name="Big" type="Node2D" parent="."]
visible = false
[node name="Polygon2D" type="Polygon2D" parent="Big"]
z_index = -1
position = Vector2(2, 4)
color = Color(0, 0, 0, 0.247059)
polygon = PackedVector2Array(-18, -4, 18, -4, 20, -2, 20, 2, 18, 4, -18, 4, -20, 2, -20, -2)
[node name="TextureRect" type="TextureRect" parent="Big"]
offset_left = -20.0
offset_top = -4.0
offset_right = 20.0
offset_bottom = 4.0
texture = ExtResource("5_w5k41")
[node name="EffectTimer" type="Timer" parent="."]
[node name="GrowSound" type="AudioStreamPlayer" parent="."]
stream = ExtResource("6_hpb6a")
[node name="ShrinkSound" type="AudioStreamPlayer" parent="."]
stream = ExtResource("7_3krfd")
[connection signal="timeout" from="EffectTimer" to="." method="_on_effect_timer_timeout"]

BIN
Paddle/PaddleBig.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dx3a3rva5g7ex"
path="res://.godot/imported/PaddleBig.png-d2273c8ccef26c1da6e845f85d64a641.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Paddle/PaddleBig.png"
dest_files=["res://.godot/imported/PaddleBig.png-d2273c8ccef26c1da6e845f85d64a641.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
Paddle/PaddleNormal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://0pjgtr5e102q"
path="res://.godot/imported/PaddleNormal.png-55f91da7329a555debe949f02446445a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Paddle/PaddleNormal.png"
dest_files=["res://.godot/imported/PaddleNormal.png-55f91da7329a555debe949f02446445a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
Paddle/PaddleSmall.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cjp5oq8ors5ua"
path="res://.godot/imported/PaddleSmall.png-35860c1ece29536829cef69e0af45298.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Paddle/PaddleSmall.png"
dest_files=["res://.godot/imported/PaddleSmall.png-35860c1ece29536829cef69e0af45298.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1