powerup system

This commit is contained in:
zoe 2021-10-05 21:55:34 +02:00
parent c8747328cf
commit 77ca16be36
149 changed files with 2472 additions and 331 deletions

5
Ball/Arrow.gd Normal file
View file

@ -0,0 +1,5 @@
extends Sprite
func _process(_delta):
if !visible: pass
look_at(get_global_mouse_position())

View file

@ -59,6 +59,9 @@ func aim():
state = FALL
# stop showing arrow
$Arrow.visible = false
# calculate shot speed and direction
var direction = get_local_mouse_position().normalized()
var speed = position.distance_to(get_global_mouse_position())
@ -97,3 +100,4 @@ func reset_ball():
animation.play("reset")
func reset_done():
state = AIM
$Arrow.visible = true

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=11 format=2]
[ext_resource path="res://Ball/sprite.png" type="Texture" id=1]
[ext_resource path="res://Ball/Ball.gd" type="Script" id=2]
@ -6,6 +6,8 @@
[ext_resource path="res://Ball/BallCollision.tscn" type="PackedScene" id=4]
[ext_resource path="res://SFX/Scratch/BallReset.wav" type="AudioStream" id=5]
[ext_resource path="res://Effects/greenParticle.png" type="Texture" id=6]
[ext_resource path="res://Ball/aimingArrow.png" type="Texture" id=7]
[ext_resource path="res://Ball/Arrow.gd" type="Script" id=8]
[sub_resource type="ParticlesMaterial" id=1]
lifetime_randomness = 0.5
@ -100,4 +102,9 @@ anims/reset = SubResource( 2 )
stream = ExtResource( 5 )
bus = "SFX"
[node name="Arrow" type="Sprite" parent="."]
texture = ExtResource( 7 )
offset = Vector2( 4, 0 )
script = ExtResource( 8 )
[connection signal="timeout" from="TrajectoryTimer" to="." method="_on_TrajectoryTimer_timeout"]

BIN
Ball/aimingArrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

View file

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