Added AbstractProjectile
This commit is contained in:
@@ -8,7 +8,7 @@ var position : Vector2:
|
|||||||
return $Ship.position
|
return $Ship.position
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
var input_direction := Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
var input_direction := Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
||||||
$Ship.accelerate(input_direction, delta)
|
$Ship.accelerate(input_direction, delta)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
@abstract
|
||||||
|
class_name AbstractProjectile
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
|
||||||
|
@export var bullet_velocity : int
|
||||||
|
@export var bullet_acceleration : int
|
||||||
|
@export var distance : int
|
||||||
|
@export var bullet_max_livetime : int
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://ctmjb3nkxrepu
|
||||||
@@ -32,7 +32,7 @@ func _ready() -> void:
|
|||||||
_calculate_cool()
|
_calculate_cool()
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
if _heat > 0:
|
if _heat > 0:
|
||||||
_heat -= _cool_per_sec * delta
|
_heat -= _cool_per_sec * delta
|
||||||
if _heat < 0:
|
if _heat < 0:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ func _ready() -> void:
|
|||||||
_calculate_delay()
|
_calculate_delay()
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
if _cooldown > 0:
|
if _cooldown > 0:
|
||||||
_cooldown -= delta
|
_cooldown -= delta
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ func _ready() -> void:
|
|||||||
_calculate_reload_time_tenth()
|
_calculate_reload_time_tenth()
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
if _countdown > 0:
|
if _countdown > 0:
|
||||||
_countdown -= delta
|
_countdown -= delta
|
||||||
if _countdown <= 0:
|
if _countdown <= 0:
|
||||||
|
|||||||
@@ -2,12 +2,9 @@ extends Node2D
|
|||||||
|
|
||||||
|
|
||||||
@export var damage : int
|
@export var damage : int
|
||||||
@export var explosion_size : int
|
|
||||||
@export var bullet_velocity : int
|
|
||||||
@export var bullet_acceleration : int
|
|
||||||
@export var bullet_per_shot : int
|
@export var bullet_per_shot : int
|
||||||
@export var sector_angle : int
|
@export var sector_angle : int
|
||||||
@export var distance : int
|
@export var Projectile : AbstractProjectile
|
||||||
@export var reloaders : Array[AbstractReloader]
|
@export var reloaders : Array[AbstractReloader]
|
||||||
|
|
||||||
|
|
||||||
@@ -32,7 +29,6 @@ func _init() -> void:
|
|||||||
#add_child(energy_reloader)
|
#add_child(energy_reloader)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
var texture := PlaceholderTexture2D.new()
|
var texture := PlaceholderTexture2D.new()
|
||||||
texture.size = Vector2(10, 7)
|
texture.size = Vector2(10, 7)
|
||||||
|
|||||||
Reference in New Issue
Block a user