Attempting to translate pseudocode to useable code…
This commit is contained in:
parent
e5eea103ab
commit
4015e1c719
2 changed files with 12 additions and 1 deletions
|
|
@ -7,6 +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
|
||||
|
||||
@export var weapon_current : PackedScene
|
||||
#var weapon_current = load("res://scenes/stock_weapon.tscn")
|
||||
|
|
@ -80,6 +81,7 @@ func shoot():
|
|||
#if can_shoot:
|
||||
var bullet = weapon_current.instantiate()
|
||||
bullet.position = self.position + Vector2(0,-20)
|
||||
previous_location = self.position.y
|
||||
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