Limited shooting speed
This commit is contained in:
parent
e60c141d18
commit
26828da27b
BIN
art/Pedestal.png
Normal file
BIN
art/Pedestal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 331 B |
34
art/Pedestal.png.import
Normal file
34
art/Pedestal.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Pedestal.png-f6a4ccc42650ccc85d61ebbcd8e99b28.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/Pedestal.png"
|
||||
dest_files=[ "res://.import/Pedestal.png-f6a4ccc42650ccc85d61ebbcd8e99b28.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
|
|
@ -82,7 +82,7 @@ position = Vector2( 0, -6 )
|
|||
rotation = 1.5708
|
||||
|
||||
[node name="Wand" type="Sprite" parent="HoldPosition"]
|
||||
position = Vector2( 10, 0 )
|
||||
position = Vector2( 9, -4.76837e-007 )
|
||||
rotation = 1.5708
|
||||
texture = ExtResource( 4 )
|
||||
|
||||
|
@ -115,6 +115,10 @@ anims/Running = SubResource( 5 )
|
|||
wait_time = 0.1
|
||||
one_shot = true
|
||||
|
||||
[node name="ShootDelay" type="Timer" parent="."]
|
||||
wait_time = 0.4
|
||||
one_shot = true
|
||||
|
||||
[node name="Hitbox" type="Area2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2( 0, -7 )
|
||||
|
|
|
@ -10,5 +10,3 @@ position = Vector2( 152, 157 )
|
|||
|
||||
[node name="TileMap" parent="." instance=ExtResource( 2 )]
|
||||
tile_data = PoolIntArray( 0, 0, 8, 1, 0, 10, 2, 0, 10, 3, 0, 10, 4, 0, 10, 5, 0, 10, 6, 0, 10, 7, 0, 10, 8, 0, 10, 9, 0, 10, 10, 0, 10, 11, 0, 10, 12, 0, 10, 13, 0, 10, 14, 0, 10, 15, 0, 10, 16, 0, 10, 17, 0, 10, 18, 0, 10, 19, 0, 10, 20, 0, 10, 21, 0, 11, 65536, 0, 65544, 65537, 0, 131078, 65538, 0, 196617, 65539, 0, 196617, 65540, 0, 196617, 65541, 0, 196617, 65542, 0, 196617, 65543, 0, 196617, 65544, 0, 196617, 65545, 0, 196617, 65546, 0, 196617, 65547, 0, 196617, 65548, 0, 196617, 65549, 0, 196617, 65550, 0, 196617, 65551, 0, 196617, 65552, 0, 196617, 65553, 0, 196617, 65554, 0, 196617, 65555, 0, 196617, 65556, 0, 131077, 65557, 0, 131083, 131072, 0, 65544, 131073, 0, 131083, 131092, 0, 65544, 131093, 0, 131083, 196608, 0, 65544, 196609, 0, 131083, 196628, 0, 65544, 196629, 0, 131083, 262144, 0, 65544, 262145, 0, 131083, 262164, 0, 65544, 262165, 0, 131083, 327680, 0, 65544, 327681, 0, 131083, 327700, 0, 65544, 327701, 0, 131083, 393216, 0, 65544, 393217, 0, 131083, 393236, 0, 65544, 393237, 0, 131083, 458752, 0, 65544, 458753, 0, 131083, 458772, 0, 65544, 458773, 0, 131083, 524288, 0, 65544, 524289, 0, 131083, 524308, 0, 65544, 524309, 0, 131083, 589824, 0, 65544, 589825, 0, 131083, 589844, 0, 65544, 589845, 0, 131083, 655360, 0, 65544, 655361, 0, 131083, 655380, 0, 65544, 655381, 0, 131083, 720896, 0, 65544, 720897, 0, 65542, 720898, 0, 10, 720899, 0, 10, 720900, 0, 10, 720901, 0, 10, 720902, 0, 10, 720903, 0, 10, 720904, 0, 10, 720905, 0, 10, 720906, 0, 10, 720907, 0, 10, 720908, 0, 10, 720909, 0, 10, 720910, 0, 10, 720911, 0, 10, 720912, 0, 10, 720913, 0, 10, 720914, 0, 10, 720915, 0, 10, 720916, 0, 65541, 720917, 0, 131083, 786432, 0, 196616, 786433, 0, 196617, 786434, 0, 196617, 786435, 0, 196617, 786436, 0, 196617, 786437, 0, 196617, 786438, 0, 196617, 786439, 0, 196617, 786440, 0, 196617, 786441, 0, 196617, 786442, 0, 196617, 786443, 0, 196617, 786444, 0, 196617, 786445, 0, 196617, 786446, 0, 196617, 786447, 0, 196617, 786448, 0, 196617, 786449, 0, 196617, 786450, 0, 196617, 786451, 0, 196617, 786452, 0, 196617, 786453, 0, 196619 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
|
|
|
@ -21,11 +21,13 @@ onready var Spr: Sprite = $Sprite
|
|||
onready var Occluder: LightOccluder2D = $Sprite/LightOccluder2D
|
||||
onready var Anim: AnimationPlayer = $AnimationPlayer
|
||||
onready var CoyoteTimer: Timer = $CoyoteTimer
|
||||
onready var ShootDelay: Timer = $ShootDelay
|
||||
onready var StateMachine: Node = $PlayerStateMachine
|
||||
onready var HoldPosition: Node2D = $HoldPosition
|
||||
onready var ProjectileSpawn: Node2D = $HoldPosition/ProjectileSpawn
|
||||
|
||||
|
||||
|
||||
func _ready():
|
||||
gravity = 2 * max_jump_height / pow(jump_duration, 2)
|
||||
max_jump_velocity = -sqrt(2 * gravity * max_jump_height)
|
||||
|
@ -43,10 +45,8 @@ func handle_move_input():
|
|||
HoldPosition.look_at(get_global_mouse_position())
|
||||
HoldPosition.rotation_degrees
|
||||
|
||||
|
||||
if Input.is_action_just_pressed("shoot"):
|
||||
fire_projectile()
|
||||
print("fire")
|
||||
|
||||
if input_direction > 0:
|
||||
Spr.flip_h = false
|
||||
|
@ -61,17 +61,17 @@ func jump():
|
|||
CoyoteTimer.stop()
|
||||
|
||||
func fire_projectile():
|
||||
var temp = projectile_ps.instance()
|
||||
get_tree().current_scene.add_child(temp)
|
||||
temp.global_position = ProjectileSpawn.global_position
|
||||
temp.rotation_degrees = HoldPosition.rotation_degrees
|
||||
temp.launch()
|
||||
|
||||
if ShootDelay.is_stopped():
|
||||
var temp = projectile_ps.instance()
|
||||
get_tree().current_scene.add_child(temp)
|
||||
temp.global_position = ProjectileSpawn.global_position
|
||||
temp.rotation_degrees = HoldPosition.rotation_degrees
|
||||
temp.launch()
|
||||
ShootDelay.start()
|
||||
|
||||
func apply_gravity(delta, modifier = 1):
|
||||
velocity.y += gravity * delta * modifier
|
||||
|
||||
|
||||
func apply_movement():
|
||||
if velocity.x > -1 and velocity.x < 1:
|
||||
velocity.x = 0
|
||||
|
|
Loading…
Reference in a new issue