Basic animations for base drone model
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
@abstract
|
||||
extends Machine
|
||||
class_name Drone
|
||||
|
||||
@export_category("Dash")
|
||||
@export var dodge_cd : float
|
||||
|
||||
func _ready() -> void:
|
||||
add_on_slots = 1
|
||||
for a in MachineGlobals.drone_body_slots :
|
||||
machine_upgrades.set(a,null)
|
||||
|
||||
func class_ability() -> float:
|
||||
#do dash
|
||||
return dodge_cd
|
||||
@@ -0,0 +1 @@
|
||||
uid://cwocow55yssst
|
||||
@@ -0,0 +1,49 @@
|
||||
@abstract
|
||||
class_name Machine
|
||||
extends Node
|
||||
|
||||
@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 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
|
||||
@abstract func secondary_action() -> float
|
||||
|
||||
@abstract func model_ability() -> float
|
||||
@abstract func class_ability() -> float
|
||||
|
||||
func interact() -> void :
|
||||
pass
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
_movement(delta)
|
||||
_ability_process(delta)
|
||||
_action_process(delta)
|
||||
self_body.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 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 Input.is_action_just_pressed("class_ability") :
|
||||
ability_timer.start(class_ability())
|
||||
elif Input.is_action_just_pressed("model_ability") :
|
||||
ability_timer.start(model_ability())
|
||||
@@ -0,0 +1 @@
|
||||
uid://dyur6uu5di5ak
|
||||
@@ -0,0 +1,16 @@
|
||||
@abstract
|
||||
extends Machine
|
||||
class_name Mech
|
||||
|
||||
@export_category("Perry")
|
||||
@export var perry_cooldown : float
|
||||
@export var perry_damage_reduction : float
|
||||
|
||||
func _ready() -> void:
|
||||
add_on_slots = 3
|
||||
for a in MachineGlobals.mech_body_slots :
|
||||
machine_upgrades.set(a,null)
|
||||
|
||||
func class_ability() -> float:
|
||||
#do perry
|
||||
return perry_cooldown
|
||||
@@ -0,0 +1 @@
|
||||
uid://db7ysbxl5n433
|
||||
@@ -0,0 +1,18 @@
|
||||
@abstract
|
||||
extends Machine
|
||||
class_name Suit
|
||||
|
||||
@export_category("Overclock")
|
||||
@export_range(1,5,0.01) var overclock_fuel_mult : float
|
||||
@export var overclock_damage_mult : float
|
||||
@export var overclock_speed_mult : float
|
||||
@export var overclock_vulnerability_mult : float
|
||||
|
||||
func _ready() -> void:
|
||||
add_on_slots = 2
|
||||
for a in MachineGlobals.suit_body_slots :
|
||||
machine_upgrades.set(a,null)
|
||||
|
||||
func class_ability() -> float:
|
||||
#enter overclocked mode
|
||||
return 0
|
||||
@@ -0,0 +1 @@
|
||||
uid://dundnjnepv3e7
|
||||
42
rougelikeaboutmechs/Machines/Resources/Machine_Globals.gd
Normal file
42
rougelikeaboutmechs/Machines/Resources/Machine_Globals.gd
Normal file
@@ -0,0 +1,42 @@
|
||||
enum drone_body_slots{
|
||||
BRAIN,
|
||||
LEGS,
|
||||
BODY,
|
||||
FUELTANK,
|
||||
HEAD
|
||||
}
|
||||
|
||||
enum suit_body_slots{
|
||||
ARMS,
|
||||
LEGS,
|
||||
BODY,
|
||||
HELMET,
|
||||
FUELTANK,
|
||||
BACKPACK
|
||||
}
|
||||
|
||||
enum mech_body_slots{
|
||||
COCKPIT,
|
||||
LEFT_ARM,
|
||||
RIGHT_ARM,
|
||||
RIGHT_LEG,
|
||||
LEFT_LEG,
|
||||
CHEST,
|
||||
BACK,
|
||||
FUELTANK,
|
||||
TRUNK
|
||||
}
|
||||
|
||||
enum regular_states{
|
||||
IDLING,
|
||||
WALKING,
|
||||
DASHING,
|
||||
INTERACTING
|
||||
}
|
||||
|
||||
enum irregular_states{
|
||||
INVULNERABLE,
|
||||
OVERCLOCKED,
|
||||
STUNNED,
|
||||
SNARRED
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://bb8l1fmenh8j0
|
||||
@@ -0,0 +1,10 @@
|
||||
extends Drone
|
||||
|
||||
func primary_action() -> float:
|
||||
return -1
|
||||
|
||||
func secondary_action() -> float:
|
||||
return -1
|
||||
|
||||
func model_ability() -> float:
|
||||
return -1
|
||||
@@ -0,0 +1 @@
|
||||
uid://djmnqq6euiic8
|
||||
@@ -0,0 +1,260 @@
|
||||
[gd_scene format=3 uid="uid://fmfevetyh66i"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ct30i3w56w0lo" path="res://Machines/Resources/Models/Drones/drone_model_scene.tscn" id="1_j7lnw"]
|
||||
[ext_resource type="Texture2D" uid="uid://c3ks2krvhbeyx" path="res://Machines/Sprites/Drones/BaseDrone/BaseDroneBodyIdleFrontAndBack.png" id="2_1r2y7"]
|
||||
[ext_resource type="Script" uid="uid://djmnqq6euiic8" path="res://Machines/Resources/Models/Drones/BaseDrone/base_drone.gd" id="2_njeil"]
|
||||
[ext_resource type="Texture2D" uid="uid://dayqx8tgi4fj8" path="res://Machines/Sprites/Drones/BaseDrone/BaseDronBrain.png" id="2_tmd5t"]
|
||||
[ext_resource type="Texture2D" uid="uid://b8cx4fmrgb83" path="res://Machines/Sprites/Drones/BaseDrone/base_drone_head_front_idle.png" id="4_njeil"]
|
||||
[ext_resource type="Texture2D" uid="uid://bgr6yq60l5mjt" path="res://Machines/Sprites/Drones/BaseDrone/DefaultFuelTank.png" id="5_8l642"]
|
||||
[ext_resource type="Texture2D" uid="uid://dnthmyuq5e54" path="res://Machines/Sprites/Drones/BaseDrone/BaseDroneLegsFrontWalk.png" id="7_fkyu2"]
|
||||
[ext_resource type="Texture2D" uid="uid://ctio2sfemdbag" path="res://Machines/Sprites/Drones/BaseDrone/BaseDroneLegsIdleFront.png" id="7_ogmjm"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wbero"]
|
||||
atlas = ExtResource("2_1r2y7")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ny81s"]
|
||||
atlas = ExtResource("2_1r2y7")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1r2y7"]
|
||||
atlas = ExtResource("2_tmd5t")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_njeil"]
|
||||
atlas = ExtResource("2_tmd5t")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8l642"]
|
||||
atlas = ExtResource("2_tmd5t")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fkyu2"]
|
||||
atlas = ExtResource("2_tmd5t")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ogmjm"]
|
||||
atlas = ExtResource("2_tmd5t")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_033ny"]
|
||||
atlas = ExtResource("2_tmd5t")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hvx52"]
|
||||
atlas = ExtResource("2_tmd5t")
|
||||
region = Rect2(96, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_20g50"]
|
||||
atlas = ExtResource("2_tmd5t")
|
||||
region = Rect2(112, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_h54wi"]
|
||||
atlas = ExtResource("5_8l642")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ua5ps"]
|
||||
atlas = ExtResource("5_8l642")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cxe8u"]
|
||||
atlas = ExtResource("5_8l642")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2gr7l"]
|
||||
atlas = ExtResource("5_8l642")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_4jge0"]
|
||||
atlas = ExtResource("5_8l642")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_g4d1d"]
|
||||
atlas = ExtResource("5_8l642")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6y0om"]
|
||||
atlas = ExtResource("5_8l642")
|
||||
region = Rect2(96, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2wo2i"]
|
||||
atlas = ExtResource("4_njeil")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nb8bv"]
|
||||
atlas = ExtResource("4_njeil")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vbgkk"]
|
||||
atlas = ExtResource("7_ogmjm")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mubjp"]
|
||||
atlas = ExtResource("7_fkyu2")
|
||||
region = Rect2(0, 5, 16, 11)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vdtlk"]
|
||||
atlas = ExtResource("7_fkyu2")
|
||||
region = Rect2(16, 5, 16, 11)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vv87b"]
|
||||
atlas = ExtResource("7_fkyu2")
|
||||
region = Rect2(32, 5, 16, 11)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_d18jq"]
|
||||
atlas = ExtResource("7_fkyu2")
|
||||
region = Rect2(48, 5, 16, 11)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rqp7d"]
|
||||
atlas = ExtResource("7_fkyu2")
|
||||
region = Rect2(64, 5, 16, 11)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mvp03"]
|
||||
atlas = ExtResource("7_fkyu2")
|
||||
region = Rect2(80, 5, 16, 11)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_wbero"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wbero")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ny81s")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"base_body_idle_up_and_down",
|
||||
"speed": 1.5
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1r2y7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_njeil")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8l642")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_fkyu2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ogmjm")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_033ny")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hvx52")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_20g50")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"base_brain_idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_h54wi")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ua5ps")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_cxe8u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2gr7l")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_4jge0")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_g4d1d")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_6y0om")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"base_fueltank_idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2wo2i")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_nb8bv")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"base_head_idle_front",
|
||||
"speed": 4.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vbgkk")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"base_legs_idle_front",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mubjp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vdtlk")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vv87b")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_d18jq")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_rqp7d")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mvp03")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"base_legs_walking_front",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="BaseDrone" unique_id=872770085 instance=ExtResource("1_j7lnw")]
|
||||
script = ExtResource("2_njeil")
|
||||
model_name = &"Base"
|
||||
movement_speed = 5.0
|
||||
|
||||
[node name="Brain" parent="." index="0" unique_id=1086286463]
|
||||
position = Vector2(-4.7683716e-07, -0.9999995)
|
||||
scale = Vector2(0.3125, 0.3125)
|
||||
sprite_frames = SubResource("SpriteFrames_wbero")
|
||||
animation = &"base_head_idle_front"
|
||||
|
||||
[node name="Fueltank" parent="." index="1" unique_id=1785702520]
|
||||
position = Vector2(0, -1)
|
||||
scale = Vector2(0.75, 0.875)
|
||||
sprite_frames = SubResource("SpriteFrames_wbero")
|
||||
animation = &"base_fueltank_idle"
|
||||
frame_progress = 0.79189146
|
||||
|
||||
[node name="Body" parent="." index="2" unique_id=963903106]
|
||||
sprite_frames = SubResource("SpriteFrames_wbero")
|
||||
animation = &"base_body_idle_up_and_down"
|
||||
frame_progress = 0.20237787
|
||||
|
||||
[node name="Legs" parent="." index="3" unique_id=296150894]
|
||||
position = Vector2(0, 1)
|
||||
sprite_frames = SubResource("SpriteFrames_wbero")
|
||||
animation = &"base_legs_walking_front"
|
||||
|
||||
[node name="Head" parent="." index="4" unique_id=2124844687]
|
||||
position = Vector2(-2.842171e-14, -5.9604645e-08)
|
||||
scale = Vector2(0.6875, 0.6875)
|
||||
sprite_frames = SubResource("SpriteFrames_wbero")
|
||||
animation = &"base_head_idle_front"
|
||||
frame_progress = 0.7447344
|
||||
@@ -0,0 +1,27 @@
|
||||
[gd_scene format=3 uid="uid://ct30i3w56w0lo"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_bsvqd"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6pa52"]
|
||||
size = Vector2(10, 8)
|
||||
|
||||
[node name="Drone" type="CharacterBody2D" unique_id=19986915]
|
||||
texture_filter = 1
|
||||
|
||||
[node name="Brain" type="AnimatedSprite2D" parent="." unique_id=1086286463]
|
||||
sprite_frames = SubResource("SpriteFrames_bsvqd")
|
||||
|
||||
[node name="Fueltank" type="AnimatedSprite2D" parent="." unique_id=1785702520]
|
||||
sprite_frames = SubResource("SpriteFrames_bsvqd")
|
||||
|
||||
[node name="Body" type="AnimatedSprite2D" parent="." unique_id=963903106]
|
||||
sprite_frames = SubResource("SpriteFrames_bsvqd")
|
||||
|
||||
[node name="Legs" type="AnimatedSprite2D" parent="." unique_id=296150894]
|
||||
sprite_frames = SubResource("SpriteFrames_bsvqd")
|
||||
|
||||
[node name="Head" type="AnimatedSprite2D" parent="." unique_id=2124844687]
|
||||
sprite_frames = SubResource("SpriteFrames_bsvqd")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1475205819]
|
||||
shape = SubResource("RectangleShape2D_6pa52")
|
||||
Reference in New Issue
Block a user