Adding player resourses with janky mod of aseprite wizard importer.

This commit is contained in:
Dustin 2025-03-16 10:02:17 -07:00
parent 1f2a5908c9
commit d7cb6fa877
15 changed files with 265 additions and 138 deletions

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://lib/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1] [ext_resource path="res://src/actors/players/playerE/PlayerE.tscn" type="PackedScene" id=1]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 208, 20 ) extents = Vector2( 208, 20 )
@ -18,5 +18,4 @@ margin_bottom = 200.0
position = Vector2( 208, 20 ) position = Vector2( 208, 20 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="ActorTemplate" parent="." instance=ExtResource( 1 )] [node name="PlayerE" parent="." instance=ExtResource( 1 )]
position = Vector2( 168, 32 )

View File

@ -0,0 +1,130 @@
[gd_resource type="SpriteFrames" load_steps=27 format=2]
[sub_resource type="StreamTexture" id=1]
load_path = "res://.import/idle.png-dac221ba43c70fde9cf788217116f029.stex"
[sub_resource type="AtlasTexture" id=2]
atlas = SubResource( 1 )
region = Rect2( 0, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=3]
atlas = SubResource( 1 )
region = Rect2( 48, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=4]
atlas = SubResource( 1 )
region = Rect2( 96, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=5]
atlas = SubResource( 1 )
region = Rect2( 0, 48, 48, 48 )
[sub_resource type="AtlasTexture" id=6]
atlas = SubResource( 1 )
region = Rect2( 48, 48, 48, 48 )
[sub_resource type="AtlasTexture" id=7]
atlas = SubResource( 1 )
region = Rect2( 96, 48, 48, 48 )
[sub_resource type="StreamTexture" id=8]
load_path = "res://.import/jump.png-e5e27a6608040d3526a151777807f18b.stex"
[sub_resource type="AtlasTexture" id=9]
atlas = SubResource( 8 )
region = Rect2( 0, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=10]
atlas = SubResource( 8 )
region = Rect2( 48, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=11]
atlas = SubResource( 8 )
region = Rect2( 0, 48, 48, 48 )
[sub_resource type="StreamTexture" id=12]
load_path = "res://.import/land.png-c462761c5fb4bf0befa8d4a5a879e2f5.stex"
[sub_resource type="AtlasTexture" id=13]
atlas = SubResource( 12 )
region = Rect2( 0, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=14]
atlas = SubResource( 12 )
region = Rect2( 48, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=15]
atlas = SubResource( 12 )
region = Rect2( 96, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=16]
atlas = SubResource( 12 )
region = Rect2( 0, 48, 48, 48 )
[sub_resource type="AtlasTexture" id=17]
atlas = SubResource( 12 )
region = Rect2( 48, 48, 48, 48 )
[sub_resource type="StreamTexture" id=18]
load_path = "res://.import/run.png-d086b4c01d4e3ff36f750b9aff5a303a.stex"
[sub_resource type="AtlasTexture" id=19]
atlas = SubResource( 18 )
region = Rect2( 0, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=20]
atlas = SubResource( 18 )
region = Rect2( 48, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=21]
atlas = SubResource( 18 )
region = Rect2( 96, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=22]
atlas = SubResource( 18 )
region = Rect2( 0, 48, 48, 48 )
[sub_resource type="AtlasTexture" id=23]
atlas = SubResource( 18 )
region = Rect2( 48, 48, 48, 48 )
[sub_resource type="AtlasTexture" id=24]
atlas = SubResource( 18 )
region = Rect2( 96, 48, 48, 48 )
[sub_resource type="AtlasTexture" id=25]
atlas = SubResource( 18 )
region = Rect2( 0, 96, 48, 48 )
[sub_resource type="AtlasTexture" id=26]
atlas = SubResource( 18 )
region = Rect2( 48, 96, 48, 48 )
[resource]
resource_name = "PlayerE"
animations = [ {
"frames": [ SubResource( 2 ) ],
"loop": true,
"name": "default",
"speed": 13.0
}, {
"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 5 ), SubResource( 6 ), SubResource( 2 ), SubResource( 7 ), SubResource( 7 ), SubResource( 7 ) ],
"loop": true,
"name": "idle",
"speed": 11.0
}, {
"frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ) ],
"loop": false,
"name": "jump",
"speed": 10.0
}, {
"frames": [ SubResource( 13 ), SubResource( 14 ), SubResource( 14 ), SubResource( 15 ), SubResource( 15 ), SubResource( 16 ), SubResource( 16 ), SubResource( 17 ), SubResource( 17 ) ],
"loop": false,
"name": "land",
"speed": 13.0
}, {
"frames": [ SubResource( 19 ), SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ), SubResource( 25 ), SubResource( 26 ) ],
"loop": true,
"name": "run",
"speed": 13.0
} ]

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -2,15 +2,15 @@
importer="texture" importer="texture"
type="StreamTexture" type="StreamTexture"
path="res://.import/template-jump.png-99a30c82ac7d2ef1ff0cd02512f1ee55.stex" path="res://.import/idle.png-dac221ba43c70fde9cf788217116f029.stex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/actors/players/playerE/template-jump.png" source_file="res://assets/actors/players/playerE/idle.png"
dest_files=[ "res://.import/template-jump.png-99a30c82ac7d2ef1ff0cd02512f1ee55.stex" ] dest_files=[ "res://.import/idle.png-dac221ba43c70fde9cf788217116f029.stex" ]
[params] [params]

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -2,15 +2,15 @@
importer="texture" importer="texture"
type="StreamTexture" type="StreamTexture"
path="res://.import/template.png-4288ca8cd0abcf2db7d00f52e5ba2170.stex" path="res://.import/jump.png-e5e27a6608040d3526a151777807f18b.stex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/actors/players/playerE/template.png" source_file="res://assets/actors/players/playerE/jump.png"
dest_files=[ "res://.import/template.png-4288ca8cd0abcf2db7d00f52e5ba2170.stex" ] dest_files=[ "res://.import/jump.png-e5e27a6608040d3526a151777807f18b.stex" ]
[params] [params]
@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0 compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
flags/repeat=0 flags/repeat=0
flags/filter=true flags/filter=false
flags/mipmaps=false flags/mipmaps=false
flags/anisotropic=false flags/anisotropic=false
flags/srgb=2 flags/srgb=2

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/land.png-c462761c5fb4bf0befa8d4a5a879e2f5.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/actors/players/playerE/land.png"
dest_files=[ "res://.import/land.png-c462761c5fb4bf0befa8d4a5a879e2f5.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -1,103 +0,0 @@
[gd_resource type="SpriteFrames" load_steps=20 format=2]
[sub_resource type="StreamTexture" id=1]
load_path = "res://.import/template-jump.png-99a30c82ac7d2ef1ff0cd02512f1ee55.stex"
[sub_resource type="AtlasTexture" id=2]
atlas = SubResource( 1 )
region = Rect2( 0, 48, 48, 48 )
[sub_resource type="StreamTexture" id=3]
load_path = "res://.import/template-jump.png-99a30c82ac7d2ef1ff0cd02512f1ee55.stex"
[sub_resource type="AtlasTexture" id=4]
atlas = SubResource( 3 )
region = Rect2( 0, 48, 48, 48 )
[sub_resource type="StreamTexture" id=5]
load_path = "res://.import/template-jump.png-99a30c82ac7d2ef1ff0cd02512f1ee55.stex"
[sub_resource type="AtlasTexture" id=6]
atlas = SubResource( 5 )
region = Rect2( 0, 48, 48, 48 )
[sub_resource type="AtlasTexture" id=7]
atlas = SubResource( 1 )
region = Rect2( 0, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=8]
atlas = SubResource( 3 )
region = Rect2( 0, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=9]
atlas = SubResource( 5 )
region = Rect2( 0, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=10]
atlas = SubResource( 1 )
region = Rect2( 48, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=11]
atlas = SubResource( 3 )
region = Rect2( 48, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=12]
atlas = SubResource( 5 )
region = Rect2( 48, 0, 48, 48 )
[sub_resource type="StreamTexture" id=13]
flags = 4
load_path = "res://.import/template.png-4288ca8cd0abcf2db7d00f52e5ba2170.stex"
[sub_resource type="AtlasTexture" id=14]
flags = 4
atlas = SubResource( 13 )
region = Rect2( 0, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=15]
flags = 4
atlas = SubResource( 13 )
region = Rect2( 48, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=16]
flags = 4
atlas = SubResource( 13 )
region = Rect2( 96, 0, 48, 48 )
[sub_resource type="AtlasTexture" id=17]
flags = 4
atlas = SubResource( 13 )
region = Rect2( 0, 48, 48, 48 )
[sub_resource type="AtlasTexture" id=18]
flags = 4
atlas = SubResource( 13 )
region = Rect2( 48, 48, 48, 48 )
[sub_resource type="AtlasTexture" id=19]
flags = 4
atlas = SubResource( 13 )
region = Rect2( 96, 48, 48, 48 )
[resource]
animations = [ {
"frames": [ SubResource( 2 ), SubResource( 4 ), SubResource( 6 ) ],
"loop": true,
"name": "Jump Down",
"speed": 10.0
}, {
"frames": [ SubResource( 7 ), SubResource( 8 ), SubResource( 9 ) ],
"loop": true,
"name": "Jump up",
"speed": 10.0
}, {
"frames": [ SubResource( 10 ), SubResource( 11 ), SubResource( 12 ) ],
"loop": true,
"name": "Max Height",
"speed": 10.0
}, {
"frames": [ SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 17 ), SubResource( 18 ), SubResource( 14 ), SubResource( 19 ), SubResource( 19 ), SubResource( 19 ) ],
"loop": false,
"name": "idle",
"speed": 11.0
} ]

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/run.png-d086b4c01d4e3ff36f750b9aff5a303a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/actors/players/playerE/run.png"
dest_files=[ "res://.import/run.png-d086b4c01d4e3ff36f750b9aff5a303a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -15,6 +15,7 @@ export var debug_actor: bool = false
onready var sound_effect_player: AudioStreamPlayer = $SE_Player onready var sound_effect_player: AudioStreamPlayer = $SE_Player
#onready var movement_component: MovementComponent = $movement_component #onready var movement_component: MovementComponent = $movement_component
onready var movement_component: Movement_StateReceiver = $Movement_StateReceiver
#onready var movement_state_machine: StateMachineAnimatedActor = $movement_state_machine #onready var movement_state_machine: StateMachineAnimatedActor = $movement_state_machine
onready var movement_state_machine: StateMachine = $movement_state_machine onready var movement_state_machine: StateMachine = $movement_state_machine
@ -42,14 +43,13 @@ func _ready() -> void:
sound_effects_dict[i.animation_name + str(i.frame_number)] = i.sound sound_effects_dict[i.animation_name + str(i.frame_number)] = i.sound
print (sound_effects_dict) print (sound_effects_dict)
# Disable to test whether actually needed. func _unhandled_input(event: InputEvent) -> void:
#func _unhandled_input(event: InputEvent) -> void: if actor_type == "Player":
# if actor_type == "Player": movement_component.process_input(event)
# movement_component.process_input(event)
#movement_state_machine.process_input(event) #movement_state_machine.process_input(event)
#
#func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
# movement_component.process_physics(delta) movement_component.process_physics(delta)
#movement_state_machine.process_physics(delta) #movement_state_machine.process_physics(delta)
# #
#func _process(delta: float) -> void: #func _process(delta: float) -> void:

View File

@ -41,10 +41,14 @@ const LEFT = -1.0
const RIGHT = 1.0 const RIGHT = 1.0
func _ready(): func _ready():
pass request_state_change = funcref(get_node(callable_state_machine), 'change_to_known_state')
get_node(callable_state_machine).connect("state_changed", self,"_on_state_change")
############
# These get called by the parent
############
func process_physics(delta): func process_physics(delta):
pass move_actor_as_desired(delta)
# Shouldn't need a proces function # Shouldn't need a proces function
#func process(delta): #func process(delta):
@ -53,6 +57,8 @@ func process_physics(delta):
func process_input(event: InputEvent): func process_input(event: InputEvent):
pass pass
############
# A Series of helper functions # A Series of helper functions
func go_up(): func go_up():
desired_movement_vector.y = UP desired_movement_vector.y = UP
@ -92,6 +98,17 @@ func wants_climb() -> bool:
func get_climb_shape_location() -> Vector2: func get_climb_shape_location() -> Vector2:
return Vector2(-1,-1) return Vector2(-1,-1)
func _on_state_change(old_state_name:String, new_state :State):
print ("got the state change signal (MC) ", new_state.name)
# set current state to new_state
#TODO: Confirm that this is a reference to the state in the
###### State machine
if new_state is StateAnimatedActor: #Testing this. Update: It works
current_state = new_state
else:
push_warning("Received non animated Actor state.")
#current_state = new_state
func move_actor_as_desired(delta: float, x_move_direction_override: float = 0): func move_actor_as_desired(delta: float, x_move_direction_override: float = 0):

View File

@ -1,8 +1,6 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://lib/classes/animated_sprite_state_receiver.gd" type="Script" id=1]
[ext_resource path="res://lib/classes/state_machine.gd" type="Script" id=2] [ext_resource path="res://lib/classes/state_machine.gd" type="Script" id=2]
[ext_resource path="res://assets/actors/players/playerE/new_spriteframes.tres" type="SpriteFrames" id=3]
[ext_resource path="res://lib/classes/state_animated_actor.gd" type="Script" id=4] [ext_resource path="res://lib/classes/state_animated_actor.gd" type="Script" id=4]
[ext_resource path="res://lib/classes/movement_state_receiver.gd" type="Script" id=5] [ext_resource path="res://lib/classes/movement_state_receiver.gd" type="Script" id=5]
[ext_resource path="res://lib/classes/actor.gd" type="Script" id=8] [ext_resource path="res://lib/classes/actor.gd" type="Script" id=8]
@ -26,27 +24,25 @@ collision_layer = 2
script = ExtResource( 8 ) script = ExtResource( 8 )
[node name="AnimatedSprite_StateReceiver" type="AnimatedSprite" parent="."] [node name="AnimatedSprite_StateReceiver" type="AnimatedSprite" parent="."]
frames = ExtResource( 3 )
animation = "idle"
script = ExtResource( 1 )
__meta__ = { __meta__ = {
"_aseprite_wizard_config_": { "_aseprite_wizard_config_": {
"layer": "", "layer": "",
"o_ex_p": "BG", "o_ex_p": "-.*",
"o_folder": "res://assets/actors/players/playerE", "o_folder": "",
"o_name": "template-jump", "o_name": "",
"only_visible": true, "only_visible": true,
"op_exp": true, "op_exp": true,
"sf_name": "",
"slice": "", "slice": "",
"source": "/home/relay01/Assets/Library/Asset Packs 1-5/Asset Packs 1-4 (final)/Asset Pack-V1/Player Jump/player jump 48x48.aseprite" "source": ""
} }
} }
callable_state_machine = NodePath("../movement_state_machine")
[node name="Movement_StateReceiver" type="Node" parent="."] [node name="Movement_StateReceiver" type="Node" parent="."]
script = ExtResource( 5 ) script = ExtResource( 5 )
callable_state_machine = NodePath("../Movement_StateMachine")
[node name="movement_state_machine" type="Node" parent="."] [node name="Movement_StateMachine" type="Node" parent="."]
script = ExtResource( 2 ) script = ExtResource( 2 )
starting_state_name = "idle" starting_state_name = "idle"
states = [ SubResource( 1 ) ] states = [ SubResource( 1 ) ]

View File

@ -1,5 +1,23 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://lib/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1] [ext_resource path="res://lib/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/actors/players/playerE/PlayerE_SpriteFrames.tres" type="SpriteFrames" id=2]
[node name="PlayerE" instance=ExtResource( 1 )] [node name="PlayerE" instance=ExtResource( 1 )]
actor_type = "Player"
[node name="AnimatedSprite_StateReceiver" parent="." index="0"]
frames = ExtResource( 2 )
__meta__ = {
"_aseprite_wizard_config_": {
"layer": "",
"o_ex_p": "-.*",
"o_folder": "res://assets/actors/players/playerE",
"o_name": "run",
"only_visible": true,
"op_exp": true,
"sf_name": "PlayerE_SpriteFrames",
"slice": "",
"source": "/home/relay01/Assets/Library/Asset Packs 1-5/Asset Packs 1-4 (final)/Asset Pack-V1/Player Run/player run 48x48.aseprite"
}
}