mirror of
https://git.kittycat.homes/zoe/pegchamp.git
synced 2024-08-15 03:15:39 +00:00
added springs
This commit is contained in:
parent
62762082f7
commit
e08c2c3ef2
19 changed files with 201 additions and 16 deletions
|
@ -0,0 +1,3 @@
|
|||
source_md5="f3ededfe15c0a0b8aa0a6ee26d47da04"
|
||||
dest_md5="c08cfee8bf27820a7edb3d6201230baf"
|
||||
|
BIN
.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.stex
Normal file
BIN
.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.stex
Normal file
Binary file not shown.
BIN
Aseprite/spring.ase
Normal file
BIN
Aseprite/spring.ase
Normal file
Binary file not shown.
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
11
Pegs/Yellow/PowerupCards/Spring.tscn
Normal file
11
Pegs/Yellow/PowerupCards/Spring.tscn
Normal file
|
@ -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
|
4
Pegs/Yellow/Powerups/Spring/Spring.gd
Normal file
4
Pegs/Yellow/Powerups/Spring/Spring.gd
Normal file
|
@ -0,0 +1,4 @@
|
|||
extends Sprite
|
||||
|
||||
func animate():
|
||||
$AnimationPlayer.play("Spring")
|
30
Pegs/Yellow/Powerups/Spring/Spring.tscn
Normal file
30
Pegs/Yellow/Powerups/Spring/Spring.tscn
Normal file
|
@ -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 )
|
16
Pegs/Yellow/Powerups/Spring/Springs.gd
Normal file
16
Pegs/Yellow/Powerups/Spring/Springs.gd
Normal file
|
@ -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
|
58
Pegs/Yellow/Powerups/Spring/Springs.tscn
Normal file
58
Pegs/Yellow/Powerups/Spring/Springs.tscn
Normal file
|
@ -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"]
|
BIN
Pegs/Yellow/Powerups/Spring/spring-Sheet.png
Normal file
BIN
Pegs/Yellow/Powerups/Spring/spring-Sheet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 565 B |
34
Pegs/Yellow/Powerups/Spring/spring-Sheet.png.import
Normal file
34
Pegs/Yellow/Powerups/Spring/spring-Sheet.png.import
Normal file
|
@ -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
|
|
@ -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]
|
||||
|
||||
|
|
6
todo.md
Normal file
6
todo.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
#powerups
|
||||
- change the balls direction
|
||||
- super bulldozer ball
|
||||
- spring
|
||||
-
|
||||
#levels
|
Loading…
Reference in a new issue