mirror of
https://git.kittycat.homes/zoe/pegchamp.git
synced 2024-08-15 03:15:39 +00:00
added basic level selection menu
This commit is contained in:
parent
8639876921
commit
2637008a33
54 changed files with 756 additions and 32 deletions
5
Pegs/Green/BarHitParticles.tscn
Normal file
5
Pegs/Green/BarHitParticles.tscn
Normal 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 )]
|
||||
6
Pegs/Green/GraceTimer.tscn
Normal file
6
Pegs/Green/GraceTimer.tscn
Normal 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
33
Pegs/Green/GreenBar.gd
Normal 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
47
Pegs/Green/GreenBar.tscn
Normal 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"]
|
||||
|
|
@ -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
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
34
Pegs/Green/bar.png.import
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue