implented graze variable on new bullet

This commit is contained in:
pennyrigate 2026-01-01 17:58:17 -05:00
parent 5ce3dc929b
commit a103ddcb8a

View file

@ -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