implented graze variable on new bullet
This commit is contained in:
parent
5ce3dc929b
commit
a103ddcb8a
1 changed files with 3 additions and 0 deletions
|
|
@ -39,6 +39,8 @@ const INITIAL_ALLOCATED_BULLETS: int = 2000
|
||||||
## The amount of time in seconds that the bullet has existed.
|
## The amount of time in seconds that the bullet has existed.
|
||||||
var time_elapsed: float = 0.0
|
var time_elapsed: float = 0.0
|
||||||
|
|
||||||
|
## If the bullet has been grazed before
|
||||||
|
var grazed: bool = false
|
||||||
|
|
||||||
static var _cached_bullets: Array[Bullet] = []
|
static var _cached_bullets: Array[Bullet] = []
|
||||||
static var _hitbox_shapes: Dictionary[Vector2i, RectangleShape2D] = {}
|
static var _hitbox_shapes: Dictionary[Vector2i, RectangleShape2D] = {}
|
||||||
|
|
@ -65,6 +67,7 @@ static func create(
|
||||||
bullet.direction = direction
|
bullet.direction = direction
|
||||||
bullet.face_direction = face_direction
|
bullet.face_direction = face_direction
|
||||||
bullet.time_elapsed = 0.0
|
bullet.time_elapsed = 0.0
|
||||||
|
bullet.grazed = false
|
||||||
|
|
||||||
return bullet
|
return bullet
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue