Cleaned up code around shooting logic to try to get it to work (didn't
help!)
This commit is contained in:
parent
4015e1c719
commit
97606c8233
2 changed files with 8 additions and 9 deletions
|
|
@ -7,7 +7,7 @@ var velocity: Vector2 = Vector2.ZERO
|
|||
var shield: int = 0: set = shield_set
|
||||
var can_shoot: bool = true
|
||||
var is_shooting: bool = false
|
||||
var previous_location: float = 0.0
|
||||
var previous_position: Vector2
|
||||
|
||||
@export var weapon_current : PackedScene
|
||||
#var weapon_current = load("res://scenes/stock_weapon.tscn")
|
||||
|
|
@ -81,7 +81,7 @@ func shoot():
|
|||
#if can_shoot:
|
||||
var bullet = weapon_current.instantiate()
|
||||
bullet.position = self.position + Vector2(0,-20)
|
||||
previous_location = self.position.y
|
||||
previous_position = self.position
|
||||
get_tree().root.add_child(bullet)
|
||||
weapon_rate = bullet.shot_data.rate
|
||||
#bullet.global_transform = self.global_transform
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue