Continues work on battle system

combat_refactor
Joey Pollack 1 year ago
parent 3cf39c7135
commit 6ecbd2e5a2

@ -0,0 +1,3 @@
class_name EnemyCharacter
extends Node2D

@ -3,10 +3,6 @@
[ext_resource type="Script" path="res://actors/player chars/player_character.gd" id="1_l60p5"]
[ext_resource type="Texture2D" uid="uid://cs6uqgpyvwy7r" path="res://assets/art/character sprites/alex.png" id="2_2yoh5"]
[sub_resource type="AtlasTexture" id="AtlasTexture_fdxoe"]
atlas = ExtResource("2_2yoh5")
region = Rect2(48, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_u1hru"]
atlas = ExtResource("2_2yoh5")
region = Rect2(48, 144, 48, 48)
@ -15,18 +11,10 @@ region = Rect2(48, 144, 48, 48)
atlas = ExtResource("2_2yoh5")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_6y8f1"]
atlas = ExtResource("2_2yoh5")
region = Rect2(0, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_fkjvm"]
[sub_resource type="AtlasTexture" id="AtlasTexture_fdxoe"]
atlas = ExtResource("2_2yoh5")
region = Rect2(48, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_xbpqv"]
atlas = ExtResource("2_2yoh5")
region = Rect2(96, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_mya52"]
atlas = ExtResource("2_2yoh5")
region = Rect2(0, 144, 48, 48)
@ -51,18 +39,22 @@ region = Rect2(48, 0, 48, 48)
atlas = ExtResource("2_2yoh5")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_igt71"]
atlas = ExtResource("2_2yoh5")
region = Rect2(0, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_bf443"]
atlas = ExtResource("2_2yoh5")
region = Rect2(48, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ucyt6"]
atlas = ExtResource("2_2yoh5")
region = Rect2(96, 48, 48, 48)
[sub_resource type="SpriteFrames" id="SpriteFrames_vu5b1"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_fdxoe")
}],
"loop": true,
"name": &"Idle_East",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_u1hru")
}],
"loop": true,
@ -79,19 +71,10 @@ animations = [{
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_6y8f1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fkjvm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xbpqv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fkjvm")
"texture": SubResource("AtlasTexture_fdxoe")
}],
"loop": true,
"name": &"Walk_East",
"name": &"Idle_West",
"speed": 5.0
}, {
"frames": [{
@ -127,12 +110,30 @@ animations = [{
"loop": true,
"name": &"Walk_South",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_igt71")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bf443")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ucyt6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bf443")
}],
"loop": true,
"name": &"Walk_West",
"speed": 5.0
}]
[node name="Alex" type="Node2D" node_paths=PackedStringArray("sprite")]
script = ExtResource("1_l60p5")
char_name = "Alex"
sprite = NodePath("AnimatedSprite2D")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_vu5b1")
animation = &"Walk_East"
animation = &"Idle_West"

@ -36,10 +36,10 @@ func _validate_animations():
var expected_animations = [
"Idle_North",
"Idle_South",
"Idle_East",
"Idle_West",
"Walk_North",
"Walk_South",
"Walk_East",
"Walk_West",
]
for anim in expected_animations:
@ -62,15 +62,15 @@ func _process_input():
if Input.is_action_just_pressed("Move_Left"):
_is_moving = true
_was_moving = true
facing_direction = FacingDirection.EAST
sprite.play("Walk_East")
facing_direction = FacingDirection.WEST
sprite.play("Walk_West")
sprite.flip_h = false
if Input.is_action_just_pressed("Move_Right"):
_is_moving = true
_was_moving = true
facing_direction = FacingDirection.WEST
sprite.play("Walk_East")
facing_direction = FacingDirection.EAST
sprite.play("Walk_West")
sprite.flip_h = true
if Input.is_action_just_released("Move_Down") \
@ -89,10 +89,11 @@ func _process_input():
if facing_direction == FacingDirection.SOUTH:
sprite.play("Idle_South")
if facing_direction == FacingDirection.EAST:
sprite.play("Idle_East")
sprite.flip_h = false
if facing_direction == FacingDirection.WEST:
sprite.play("Idle_East")
sprite.play("Idle_West")
sprite.flip_h = false
if facing_direction == FacingDirection.EAST:
sprite.play("Idle_West")
sprite.flip_h = true

Binary file not shown.

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://uvm83t4gchb7"
path="res://.godot/imported/Female1.png-751b04120ba1352265921310378ca8c2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/character sprites/Szadi NPCs/Female1.png"
dest_files=["res://.godot/imported/Female1.png-751b04120ba1352265921310378ca8c2.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cgc15eklb3nu"
path="res://.godot/imported/Female2.png-c21c085d5b87f05b39035afefe476932.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/character sprites/Szadi NPCs/Female2.png"
dest_files=["res://.godot/imported/Female2.png-c21c085d5b87f05b39035afefe476932.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://4h8n71pv0rte"
path="res://.godot/imported/Male1.png-7e24926694ba397cd822ce2fe47dd922.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/character sprites/Szadi NPCs/Male1.png"
dest_files=["res://.godot/imported/Male1.png-7e24926694ba397cd822ce2fe47dd922.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://daq5hi7v0qbys"
path="res://.godot/imported/Male2.png-383cd63349d8e1441ed489d992446ce6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/character sprites/Szadi NPCs/Male2.png"
dest_files=["res://.godot/imported/Male2.png-383cd63349d8e1441ed489d992446ce6.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cj13x130gdhv3"
path="res://.godot/imported/Male3.png-30f6f69b4fbf36e0cd2cc492c4dbe0f2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/character sprites/Szadi NPCs/Male3.png"
dest_files=["res://.godot/imported/Male3.png-30f6f69b4fbf36e0cd2cc492c4dbe0f2.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://biv828180br3o"
path="res://.godot/imported/Male4.png-4f84124cbebb5fd4c9ec637846a7c80c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/character sprites/Szadi NPCs/Male4.png"
dest_files=["res://.godot/imported/Male4.png-4f84124cbebb5fd4c9ec637846a7c80c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,3 @@
The first four frames are idle, the next four walk.
Each block is in the size 32x48.

@ -0,0 +1,14 @@
>>> License for Everyone.
You can use the Licensed Asset to create Public domain and free to use, personal or commercial.
You can use the Licensed Asset:
(a) edit and modify, cut and change the asset used for commercial purposes;
(b) sell works created with the assets;
(c) publish on websites related to graphics, games and similar.
>>> A Licence does not allow the Purchaser to:
(d) Use the Licensed Asset or Derivative Works in a logo, trademark or service mark
(e) Resell it, original or modified; Credit is not required but appreciated.
Credit is not required but appreciated.

@ -0,0 +1,3 @@
class_name CombatAction
extends Resource

@ -2,6 +2,8 @@
class_name CombatTeam
extends Node
## Manages a team of combatants
##
##
var team: Array[Combatant] = []

@ -2,7 +2,15 @@
class_name Combatant
extends Node
## This class/component represents anything that can particpate in combat
##
## This class is responsible for things like combat animations,
## tracking combat stats, executing combat actions, etc.
## Anything that can take a turn in combat needs to use this component:
## Player characters, enemys, allies, neutral units, etc.
@export var combat_stats: CombatStats
@export var actions: Array[CombatAction] = []
# current state
var hp: int = 0 # Health Points

@ -2,12 +2,17 @@
extends Node2D
@export var player_team: Array[PlayerCharacter] = []
@export var enemy_team: Array[EnemyCharacter] = []
@onready var game_state: GameState = $CombatState
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
game_state.state_enter({})
# Called every frame. 'delta' is the elapsed time since the previous frame.

Loading…
Cancel
Save