zwischenstand
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
@abstract
|
||||
class_name Machine
|
||||
extends Node
|
||||
extends CharacterBody2D
|
||||
|
||||
@export var model_name : StringName
|
||||
@export var carry_capacity : float
|
||||
@export var hit_points : float
|
||||
@export var fuel_tank_capacity : float
|
||||
@export var movement_speed : float
|
||||
var look_dir : MachineGlobals.look_direction
|
||||
var states : Array
|
||||
var add_on_slots : int
|
||||
var machine_upgrades : Dictionary
|
||||
var ability_timer : Timer
|
||||
var action_timer : Timer
|
||||
var self_body : CharacterBody2D
|
||||
var current_fuel_in_tank : float
|
||||
|
||||
@abstract func primary_action() -> float
|
||||
@@ -28,21 +28,21 @@ func _physics_process(delta: float) -> void:
|
||||
_movement(delta)
|
||||
_ability_process(delta)
|
||||
_action_process(delta)
|
||||
self_body.move_and_slide()
|
||||
move_and_slide()
|
||||
|
||||
func _movement(delta: float) -> void :
|
||||
var input_direction = Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
||||
self.velocity = input_direction * movement_speed
|
||||
|
||||
func _action_process(delta:float) -> void :
|
||||
if !action_timer.is_stopped() :
|
||||
if action_timer != null && action_timer.is_stopped():
|
||||
if Input.is_action_just_pressed("primary_action") :
|
||||
action_timer.start(primary_action())
|
||||
elif Input.is_action_just_pressed("secondary_action") :
|
||||
action_timer.start(secondary_action())
|
||||
|
||||
func _ability_process(delta:float) -> void :
|
||||
if !ability_timer.is_stopped() :
|
||||
if ability_timer != null && ability_timer.is_stopped() :
|
||||
if Input.is_action_just_pressed("class_ability") :
|
||||
ability_timer.start(class_ability())
|
||||
elif Input.is_action_just_pressed("model_ability") :
|
||||
|
||||
@@ -40,3 +40,10 @@ enum irregular_states{
|
||||
STUNNED,
|
||||
SNARRED
|
||||
}
|
||||
|
||||
enum look_direction{
|
||||
UP,
|
||||
DOWN,
|
||||
LEFT,
|
||||
RIGHT
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
extends Drone
|
||||
|
||||
func _ready() -> void:
|
||||
self_body = self
|
||||
|
||||
func primary_action() -> float:
|
||||
return -1
|
||||
|
||||
|
||||
@@ -226,7 +226,11 @@ animations = [{
|
||||
|
||||
[node name="BaseDrone" unique_id=872770085 instance=ExtResource("1_j7lnw")]
|
||||
script = ExtResource("2_njeil")
|
||||
dodge_cd = null
|
||||
model_name = &"Base"
|
||||
carry_capacity = null
|
||||
hit_points = null
|
||||
fuel_tank_capacity = null
|
||||
movement_speed = 5.0
|
||||
|
||||
[node name="Brain" parent="." index="0" unique_id=1086286463]
|
||||
|
||||
Reference in New Issue
Block a user