first commit

This commit is contained in:
zoe-bat 2021-09-08 10:27:14 +02:00
commit fafcbd1530
223 changed files with 107395 additions and 0 deletions

32
Bucket/Bucket.gd Normal file
View file

@ -0,0 +1,32 @@
extends KinematicBody2D
enum {LEFT, RIGHT}
var state = RIGHT
export var speed = 0.75
func _physics_process(_delta):
match state:
LEFT: move_left()
RIGHT: move_right()
func move_right():
var collide = move_and_collide(Vector2(speed * Engine.time_scale, 0))
if collide:
state = LEFT
func move_left():
var collide = move_and_collide(Vector2(-speed * Engine.time_scale, 0))
if collide:
state = RIGHT
func _on_BallDetectionArea_body_entered(_body):
# shoot confetti
var Confetti = load("res://Bucket/Confetti.tscn")
var confetti = Confetti.instance()
var main = get_tree().current_scene
main.add_child(confetti)
confetti.position = position
GameStats.balls_left += 1

41
Bucket/Bucket.tscn Normal file
View file

@ -0,0 +1,41 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://Bucket/bucket.png" type="Texture" id=1]
[ext_resource path="res://Bucket/bucketback.png" type="Texture" id=2]
[ext_resource path="res://Bucket/Bucket.gd" type="Script" id=3]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 30, 1 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 1, 32 )
[node name="Bucket" type="KinematicBody2D"]
script = ExtResource( 3 )
[node name="BallDetectionArea" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="BallDetectionArea"]
light_mask = 0
position = Vector2( 0, 5 )
shape = SubResource( 1 )
[node name="Bucketback" type="Sprite" parent="."]
z_index = -10
texture = ExtResource( 2 )
[node name="Bucketfront" type="Sprite" parent="."]
z_index = 10
texture = ExtResource( 1 )
[node name="Left" type="CollisionShape2D" parent="."]
position = Vector2( -31, 28 )
shape = SubResource( 2 )
[node name="Right" type="CollisionShape2D" parent="."]
position = Vector2( 31, 28 )
shape = SubResource( 2 )
[connection signal="body_entered" from="BallDetectionArea" to="." method="_on_BallDetectionArea_body_entered"]

18
Bucket/Confetti.gd Normal file
View file

@ -0,0 +1,18 @@
extends Node2D
# 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():
$Green.emitting = true
$Yellow.emitting = true
$Pink.emitting = true
$AnimationPlayer.play("+1Ball")
func _on_KillTimer_timeout():
queue_free()

15
Bucket/Confetti.tres Normal file
View file

@ -0,0 +1,15 @@
[gd_resource type="ParticlesMaterial" format=2]
[resource]
emission_shape = 2
emission_box_extents = Vector3( 30, 1, 0 )
flag_disable_z = true
direction = Vector3( 0, -100, 0 )
gravity = Vector3( 0, 98, 0 )
initial_velocity = 100.0
angular_velocity = 360.0
angular_velocity_random = 1.0
orbit_velocity = 0.0
orbit_velocity_random = 0.0
anim_offset = 1.0
anim_offset_random = 1.0

91
Bucket/Confetti.tscn Normal file
View file

@ -0,0 +1,91 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://Effects/confetti2.png" type="Texture" id=1]
[ext_resource path="res://Bucket/Confetti.tres" type="Material" id=2]
[ext_resource path="res://Effects/confetti3.png" type="Texture" id=3]
[ext_resource path="res://Effects/confetti1.png" type="Texture" id=4]
[ext_resource path="res://Bucket/Confetti.gd" type="Script" id=5]
[ext_resource path="res://Menu/Theme.tres" type="Theme" id=6]
[ext_resource path="res://Ball/sprite.png" type="Texture" id=7]
[sub_resource type="Animation" id=1]
resource_name = "+1Ball"
length = 2.0
tracks/0/type = "bezier"
tracks/0/path = NodePath("Label:position:y")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, -60, -0.25, 0, 0.25, 0, -69, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 1, 2 )
}
[node name="Confetti" type="Node2D"]
script = ExtResource( 5 )
[node name="Green" type="Particles2D" parent="."]
position = Vector2( 0, -2 )
emitting = false
amount = 9
lifetime = 3.0
one_shot = true
explosiveness = 0.9
local_coords = false
process_material = ExtResource( 2 )
texture = ExtResource( 3 )
[node name="Pink" type="Particles2D" parent="."]
position = Vector2( 0, -2 )
emitting = false
amount = 9
lifetime = 3.0
one_shot = true
explosiveness = 0.9
local_coords = false
process_material = ExtResource( 2 )
texture = ExtResource( 1 )
[node name="Yellow" type="Particles2D" parent="."]
position = Vector2( 0, -2 )
emitting = false
amount = 9
lifetime = 3.0
one_shot = true
explosiveness = 0.9
local_coords = false
process_material = ExtResource( 2 )
texture = ExtResource( 4 )
[node name="KillTimer" type="Timer" parent="."]
wait_time = 2.0
one_shot = true
autostart = true
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/+1Ball = SubResource( 1 )
[node name="Label" type="Node2D" parent="."]
position = Vector2( 0, -69 )
z_index = 9
[node name="Label" type="Label" parent="Label"]
margin_left = -40.0
margin_top = -16.0
margin_right = 40.0
margin_bottom = 2.0
theme = ExtResource( 6 )
custom_colors/font_color = Color( 0.454902, 0.337255, 0.607843, 1 )
custom_colors/font_outline_modulate = Color( 0, 0, 0, 1 )
text = "+ 1"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Sprite" type="Sprite" parent="Label"]
position = Vector2( -13, -5 )
texture = ExtResource( 7 )
[connection signal="timeout" from="KillTimer" to="." method="_on_KillTimer_timeout"]

BIN
Bucket/bucket.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

34
Bucket/bucket.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bucket.png-dbd711fd083337c7d4cdca1838d7ff42.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Bucket/bucket.png"
dest_files=[ "res://.import/bucket.png-dbd711fd083337c7d4cdca1838d7ff42.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

BIN
Bucket/bucketback.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bucketback.png-529ca955e073c9a4f3ef3bc44756b85c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Bucket/bucketback.png"
dest_files=[ "res://.import/bucketback.png-529ca955e073c9a4f3ef3bc44756b85c.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