diff --git a/.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.md5 b/.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.md5 new file mode 100644 index 0000000..8639608 --- /dev/null +++ b/.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.md5 @@ -0,0 +1,3 @@ +source_md5="f3ededfe15c0a0b8aa0a6ee26d47da04" +dest_md5="c08cfee8bf27820a7edb3d6201230baf" + diff --git a/.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.stex b/.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.stex new file mode 100644 index 0000000..1849512 Binary files /dev/null and b/.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.stex differ diff --git a/Aseprite/spring.ase b/Aseprite/spring.ase new file mode 100644 index 0000000..5e62a07 Binary files /dev/null and b/Aseprite/spring.ase differ diff --git a/Ball/Ball.gd b/Ball/Ball.gd index 9733570..f53f6f0 100644 --- a/Ball/Ball.gd +++ b/Ball/Ball.gd @@ -47,8 +47,10 @@ func set_particle_direction(collider): collider.set_particle_direction(linear_velocity.normalized() * -1) func bounce_of(collider): - if (collider.has_method("bouncy")): + if collider.has_method("bouncy"): apply_central_impulse(linear_velocity.normalized() * shotspeed / 6) + if (collider).has_method("spring"): + apply_central_impulse(Vector2(0, -64)) func aim(): cameraTransform.position = Vector2.ZERO + get_local_mouse_position().normalized() * 10 diff --git a/Ball/Ball.tscn b/Ball/Ball.tscn index ef41f63..5feb9ae 100644 --- a/Ball/Ball.tscn +++ b/Ball/Ball.tscn @@ -64,7 +64,7 @@ tracks/2/keys = { [node name="Ball" type="RigidBody2D"] collision_layer = 4 -collision_mask = 5 +collision_mask = 13 mass = 90.0 physics_material_override = ExtResource( 3 ) continuous_cd = 2 diff --git a/Menu/Buttons/SceneSelectButton.tscn b/Menu/Buttons/SceneSelectButton.tscn index 5ff6e7b..cea06bf 100644 --- a/Menu/Buttons/SceneSelectButton.tscn +++ b/Menu/Buttons/SceneSelectButton.tscn @@ -15,6 +15,7 @@ script = ExtResource( 2 ) __meta__ = { "_edit_use_anchors_": false } +powerup_card = "res://Pegs/Yellow/PowerupCards/Scattershot.tscn" [node name="ButtonSFX" parent="." instance=ExtResource( 3 )] diff --git a/Menu/LevelList.tscn b/Menu/LevelList.tscn index bc852d2..b299cb9 100644 --- a/Menu/LevelList.tscn +++ b/Menu/LevelList.tscn @@ -28,7 +28,6 @@ margin_right = 168.0 margin_bottom = 40.0 icon = ExtResource( 2 ) scene = "res://Stages/EmptyStage.tscn" -powerup_card = "res://Pegs/Yellow/PowerupCards/Scattershot.tscn" [node name="SceneSelectButton2" parent="LevelListHBox" instance=ExtResource( 5 )] anchor_right = 0.0 diff --git a/Pegs/Green/HitParticles.tscn b/Pegs/Green/HitParticles.tscn index 49da0da..cc3c87f 100644 --- a/Pegs/Green/HitParticles.tscn +++ b/Pegs/Green/HitParticles.tscn @@ -1,11 +1,39 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://Pegs/HitParticles.gd" type="Script" id=1] [ext_resource path="res://Effects/greenParticle.png" type="Texture" id=2] [ext_resource path="res://SFX/greenExplodes.wav" type="AudioStream" id=3] [ext_resource path="res://Pegs/Green/HitSFX.gd" type="Script" id=4] -[sub_resource type="ParticlesMaterial" id=1] +[sub_resource type="VisualShader" id=1] +code = "shader_type spatial; +render_mode blend_add, specular_schlick_ggx, unshaded; + + + + +void vertex() { +// Output:0 + +} + +void fragment() { +// Output:0 + +} + +void light() { +// Output:0 + +} +" +modes/blend = 1 +flags/unshaded = true + +[sub_resource type="ShaderMaterial" id=2] +shader = SubResource( 1 ) + +[sub_resource type="ParticlesMaterial" id=3] emission_shape = 1 emission_sphere_radius = 2.0 flag_disable_z = true @@ -21,6 +49,7 @@ damping = 50.0 damping_random = 0.5 [node name="HitParticles" type="Particles2D"] +material = SubResource( 2 ) scale = Vector2( 1.6, 1.6 ) z_index = -10 emitting = false @@ -29,7 +58,7 @@ lifetime = 5.0 one_shot = true explosiveness = 0.95 local_coords = false -process_material = SubResource( 1 ) +process_material = SubResource( 3 ) texture = ExtResource( 2 ) script = ExtResource( 1 ) diff --git a/Pegs/Yellow/PowerupCards.gd b/Pegs/Yellow/PowerupCards.gd index 0805073..d9e75ec 100644 --- a/Pegs/Yellow/PowerupCards.gd +++ b/Pegs/Yellow/PowerupCards.gd @@ -5,7 +5,7 @@ var scenes = [] func _ready(): GameStats.connect("powerup_picked", self, "queue_free") scenes.append("res://Pegs/Yellow/PowerupCards/Scattershot.tscn") - scenes.append("res://Pegs/Yellow/PowerupCards/ExtraBall.tscn") + scenes.append("res://Pegs/Yellow/PowerupCards/Spring.tscn") spawn_powerups(2) get_tree().paused = true diff --git a/Pegs/Yellow/PowerupCards/ExtraBall.tscn b/Pegs/Yellow/PowerupCards/ExtraBall.tscn deleted file mode 100644 index eaa1ce3..0000000 --- a/Pegs/Yellow/PowerupCards/ExtraBall.tscn +++ /dev/null @@ -1,9 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://Pegs/Yellow/PowerupCard.tscn" type="PackedScene" id=1] -[ext_resource path="res://Ball/sprite.png" type="Texture" id=2] - -[node name="TextureButton" instance=ExtResource( 1 )] - -[node name="Sprite" parent="." index="0"] -texture = ExtResource( 2 ) diff --git a/Pegs/Yellow/PowerupCards/Spring.tscn b/Pegs/Yellow/PowerupCards/Spring.tscn new file mode 100644 index 0000000..891dbd5 --- /dev/null +++ b/Pegs/Yellow/PowerupCards/Spring.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://Pegs/Yellow/PowerupCard.tscn" type="PackedScene" id=1] +[ext_resource path="res://Pegs/Yellow/Powerups/Spring/spring-Sheet.png" type="Texture" id=2] + +[node name="Spring" instance=ExtResource( 1 )] +powerup = "res://Pegs/Yellow/Powerups/Spring/Springs.tscn" + +[node name="Sprite" parent="." index="0"] +texture = ExtResource( 2 ) +hframes = 9 diff --git a/Pegs/Yellow/Powerups/Spring/Spring.gd b/Pegs/Yellow/Powerups/Spring/Spring.gd new file mode 100644 index 0000000..59f12a2 --- /dev/null +++ b/Pegs/Yellow/Powerups/Spring/Spring.gd @@ -0,0 +1,4 @@ +extends Sprite + +func animate(): + $AnimationPlayer.play("Spring") diff --git a/Pegs/Yellow/Powerups/Spring/Spring.tscn b/Pegs/Yellow/Powerups/Spring/Spring.tscn new file mode 100644 index 0000000..9bdfb1c --- /dev/null +++ b/Pegs/Yellow/Powerups/Spring/Spring.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Pegs/Yellow/Powerups/Spring/spring-Sheet.png" type="Texture" id=1] +[ext_resource path="res://Pegs/Yellow/Powerups/Spring/Spring.gd" type="Script" id=2] + +[sub_resource type="Animation" id=1] +resource_name = "Spring" +step = 0.01 +tracks/0/type = "value" +tracks/0/path = NodePath(".: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.01, 0.02, 0.03, 0.04, 0.05, 0.06 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ 0, 4, 6, 8, 6, 2, 0 ] +} + +[node name="Sprite" type="Sprite"] +texture = ExtResource( 1 ) +centered = false +hframes = 9 +region_rect = Rect2( 0, 0, 32, 32 ) +script = ExtResource( 2 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/Spring = SubResource( 1 ) diff --git a/Pegs/Yellow/Powerups/Spring/Springs.gd b/Pegs/Yellow/Powerups/Spring/Springs.gd new file mode 100644 index 0000000..18f31d9 --- /dev/null +++ b/Pegs/Yellow/Powerups/Spring/Springs.gd @@ -0,0 +1,16 @@ +extends StaticBody2D + +func _ready() -> void: + position = Vector2(0, 184) + +func explode(): + queue_free() + +func make_green(): + for child in get_children(): + if child.has_method("animate"): + child.animate() + $DeathTimer.start() + +func spring(): + pass diff --git a/Pegs/Yellow/Powerups/Spring/Springs.tscn b/Pegs/Yellow/Powerups/Spring/Springs.tscn new file mode 100644 index 0000000..04c7e63 --- /dev/null +++ b/Pegs/Yellow/Powerups/Spring/Springs.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Pegs/Yellow/Powerups/Spring/Spring.tscn" type="PackedScene" id=1] +[ext_resource path="res://Pegs/Yellow/Powerups/Spring/Springs.gd" type="Script" id=2] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 192, 16 ) + +[node name="Springs" type="StaticBody2D"] +z_index = -24 +collision_layer = 8 +collision_mask = 0 +script = ExtResource( 2 ) + +[node name="Spring" parent="." instance=ExtResource( 1 )] + +[node name="Spring2" parent="." instance=ExtResource( 1 )] +position = Vector2( 32, 0 ) + +[node name="Spring3" parent="." instance=ExtResource( 1 )] +position = Vector2( 64, 0 ) + +[node name="Spring4" parent="." instance=ExtResource( 1 )] +position = Vector2( 96, 0 ) + +[node name="Spring5" parent="." instance=ExtResource( 1 )] +position = Vector2( 128, 0 ) + +[node name="Spring6" parent="." instance=ExtResource( 1 )] +position = Vector2( 160, 0 ) + +[node name="Spring7" parent="." instance=ExtResource( 1 )] +position = Vector2( 192, 0 ) + +[node name="Spring8" parent="." instance=ExtResource( 1 )] +position = Vector2( 224, 0 ) + +[node name="Spring9" parent="." instance=ExtResource( 1 )] +position = Vector2( 256, 0 ) + +[node name="Spring10" parent="." instance=ExtResource( 1 )] +position = Vector2( 288, 0 ) + +[node name="Spring11" parent="." instance=ExtResource( 1 )] +position = Vector2( 320, 0 ) + +[node name="Spring12" parent="." instance=ExtResource( 1 )] +position = Vector2( 352, 0 ) + +[node name="CollisionShape2D2" type="CollisionShape2D" parent="."] +position = Vector2( 192, 16 ) +shape = SubResource( 1 ) + +[node name="DeathTimer" type="Timer" parent="."] +wait_time = 0.24 +one_shot = true + +[connection signal="timeout" from="DeathTimer" to="." method="explode"] diff --git a/Pegs/Yellow/Powerups/Spring/spring-Sheet.png b/Pegs/Yellow/Powerups/Spring/spring-Sheet.png new file mode 100644 index 0000000..c7080aa Binary files /dev/null and b/Pegs/Yellow/Powerups/Spring/spring-Sheet.png differ diff --git a/Pegs/Yellow/Powerups/Spring/spring-Sheet.png.import b/Pegs/Yellow/Powerups/Spring/spring-Sheet.png.import new file mode 100644 index 0000000..4e5b777 --- /dev/null +++ b/Pegs/Yellow/Powerups/Spring/spring-Sheet.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Pegs/Yellow/Powerups/Spring/spring-Sheet.png" +dest_files=[ "res://.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.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 diff --git a/project.godot b/project.godot index 1ee104d..fb2d7d2 100644 --- a/project.godot +++ b/project.godot @@ -89,6 +89,7 @@ pointing/emulate_touch_from_mouse=true 2d_physics/layer_1="World" 2d_physics/layer_2="Zones" 2d_physics/layer_3="BallDetection" +2d_physics/layer_4="Powerups" [physics] diff --git a/todo.md b/todo.md new file mode 100644 index 0000000..abd3114 --- /dev/null +++ b/todo.md @@ -0,0 +1,6 @@ +#powerups +- change the balls direction +- super bulldozer ball +- spring +- +#levels