mirror of
https://git.kittycat.homes/zoe/pegchamp.git
synced 2024-08-15 03:15:39 +00:00
first commit
This commit is contained in:
commit
fafcbd1530
223 changed files with 107395 additions and 0 deletions
31
Pegs/Green/GreenPeg.gd
Normal file
31
Pegs/Green/GreenPeg.gd
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
extends StaticBody2D
|
||||
|
||||
var can_be_exploded = false
|
||||
var particle_emitting_direction = Vector2.ZERO
|
||||
|
||||
# turns the pegs green
|
||||
func make_green():
|
||||
explode()
|
||||
|
||||
func explode():
|
||||
if(can_be_exploded):
|
||||
spawn_hit_particles(particle_emitting_direction)
|
||||
queue_free()
|
||||
|
||||
func _on_GraceTimer_timeout():
|
||||
can_be_exploded = 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/HitParticles.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)
|
||||
45
Pegs/Green/GreenPeg.tscn
Normal file
45
Pegs/Green/GreenPeg.tscn
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
[gd_scene load_steps=7 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/DefaultPegCollisionShape.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://Pegs/Green/GreenPegAnimationPlayer.gd" type="Script" id=5]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id=1]
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
length = 0.5
|
||||
step = 0.05
|
||||
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.01, 0.1, 0.2, 0.3, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 1, 1 ), Vector2( 1.75, 1.75 ), Vector2( 0.5, 0.5 ), Vector2( 1.5, 1.5 ), Vector2( 0.75, 0.75 ), Vector2( 1, 1 ) ]
|
||||
}
|
||||
|
||||
[node name="GreenPeg" type="StaticBody2D"]
|
||||
collision_mask = 0
|
||||
physics_material_override = SubResource( 1 )
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="DefaultPegCollisionShape" parent="." instance=ExtResource( 4 )]
|
||||
|
||||
[node name="GreenPegAnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
anims/GetBigger = SubResource( 2 )
|
||||
script = ExtResource( 5 )
|
||||
|
||||
[node name="GraceTimer" type="Timer" parent="."]
|
||||
wait_time = 0.25
|
||||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[connection signal="timeout" from="GraceTimer" to="." method="_on_GraceTimer_timeout"]
|
||||
11
Pegs/Green/GreenPegAnimationPlayer.gd
Normal file
11
Pegs/Green/GreenPegAnimationPlayer.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
extends AnimationPlayer
|
||||
|
||||
|
||||
# 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():
|
||||
play("GetBigger")
|
||||
32
Pegs/Green/HitParticles.tscn
Normal file
32
Pegs/Green/HitParticles.tscn
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://Pegs/HitParticles.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Effects/greenParticle.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=1]
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 2.0
|
||||
flag_disable_z = true
|
||||
direction = Vector3( 0, 0, 0 )
|
||||
spread = 24.0
|
||||
gravity = Vector3( 0, 100, 0 )
|
||||
initial_velocity = 100.0
|
||||
initial_velocity_random = 0.5
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
radial_accel_random = 1.0
|
||||
damping = 50.0
|
||||
damping_random = 0.5
|
||||
|
||||
[node name="HitParticles" type="Particles2D"]
|
||||
scale = Vector2( 1.6, 1.6 )
|
||||
z_index = -10
|
||||
emitting = false
|
||||
amount = 16
|
||||
lifetime = 5.0
|
||||
one_shot = true
|
||||
explosiveness = 0.95
|
||||
local_coords = false
|
||||
process_material = SubResource( 1 )
|
||||
texture = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
||||
BIN
Pegs/Green/green.png
Normal file
BIN
Pegs/Green/green.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 148 B |
34
Pegs/Green/green.png.import
Normal file
34
Pegs/Green/green.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/green.png-7bc01a95ef40770eb0d9b5e6c38ddf7f.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Pegs/Green/green.png"
|
||||
dest_files=[ "res://.import/green.png-7bc01a95ef40770eb0d9b5e6c38ddf7f.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