diff --git a/.gitignore b/.gitignore index 4a19f11..76ef295 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ saland !src/saland !data/saland nbproject +*.pyc \ No newline at end of file diff --git a/data/sprites/humans.sprite b/data/sprites/humans.sprite index 330a9e7..19550b8 100644 --- a/data/sprites/humans.sprite +++ b/data/sprites/humans.sprite @@ -2,7 +2,7 @@ "_comment" : "This file is generated with extra/scripts/build_sprites.sh. Do not edit." , "male_walkcycle_N" : { -"texture" : "male_walkcycle", +"texture" : "spritesheet/body/bodies/male/walk", "topx" : 64, "topy" : 0, "height" : 64, @@ -14,7 +14,7 @@ } , "male_walkcycle_W" : { -"texture" : "male_walkcycle", +"texture" : "spritesheet/body/bodies/male/walk", "topx" : 64, "topy" : 64, "height" : 64, @@ -26,7 +26,7 @@ } , "male_walkcycle_S" : { -"texture" : "male_walkcycle", +"texture" : "spritesheet/body/bodies/male/walk", "topx" : 64, "topy" : 128, "height" : 64, @@ -38,7 +38,7 @@ } , "male_walkcycle_E" : { -"texture" : "male_walkcycle", +"texture" : "spritesheet/body/bodies/male/walk", "topx" : 64, "topy" : 192, "height" : 64, @@ -50,7 +50,7 @@ } , "male_standing_N" : { -"texture" : "male_walkcycle", +"texture" : "spritesheet/body/bodies/male/idle", "topx" : 0, "topy" : 0, "height" : 64, @@ -62,7 +62,7 @@ } , "male_standing_W" : { -"texture" : "male_walkcycle", +"texture" : "spritesheet/body/bodies/male/idle", "topx" : 0, "topy" : 64, "height" : 64, @@ -74,7 +74,7 @@ } , "male_standing_S" : { -"texture" : "male_walkcycle", +"texture" : "spritesheet/body/bodies/male/idle", "topx" : 0, "topy" : 128, "height" : 64, @@ -86,7 +86,7 @@ } , "male_standing_E" : { -"texture" : "male_walkcycle", +"texture" : "spritesheet/body/bodies/male/idle", "topx" : 0, "topy" : 192, "height" : 64, @@ -98,7 +98,7 @@ } , "male_spellcast_N" : { -"texture" : "male_spellcast", +"texture" : "spritesheet/body/bodies/male/spellcast", "topx" : 0, "topy" : 0, "height" : 64, @@ -110,7 +110,7 @@ } , "male_spellcast_W" : { -"texture" : "male_spellcast", +"texture" : "spritesheet/body/bodies/male/spellcast", "topx" : 0, "topy" : 64, "height" : 64, @@ -122,7 +122,7 @@ } , "male_spellcast_S" : { -"texture" : "male_spellcast", +"texture" : "spritesheet/body/bodies/male/spellcast", "topx" : 0, "topy" : 128, "height" : 64, @@ -134,7 +134,7 @@ } , "male_spellcast_E" : { -"texture" : "male_spellcast", +"texture" : "spritesheet/body/bodies/male/spellcast", "topx" : 0, "topy" : 192, "height" : 64, @@ -146,7 +146,7 @@ } , "male_slash_N" : { -"texture" : "male_slash", +"texture" : "spritesheet/body/bodies/male/slash", "topx" : 0, "topy" : 0, "height" : 64, @@ -158,7 +158,7 @@ } , "male_slash_W" : { -"texture" : "male_slash", +"texture" : "spritesheet/body/bodies/male/slash", "topx" : 0, "topy" : 64, "height" : 64, @@ -170,7 +170,7 @@ } , "male_slash_S" : { -"texture" : "male_slash", +"texture" : "spritesheet/body/bodies/male/slash", "topx" : 0, "topy" : 128, "height" : 64, @@ -182,7 +182,7 @@ } , "male_slash_E" : { -"texture" : "male_slash", +"texture" : "spritesheet/body/bodies/male/slash", "topx" : 0, "topy" : 192, "height" : 64, @@ -194,7 +194,211 @@ } , "male_hurt_S" : { -"texture" : "male_hurt", +"texture" : "spritesheet/body/bodies/male/hurt", +"topx" : 0, +"topy" : 0, +"height" : 64, +"width" : 64, +"number_of_frames" : 6, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_walkcycle_N" : { +"texture" : "spritesheet/head/heads/human/male/walk", +"topx" : 64, +"topy" : 0, +"height" : 64, +"width" : 64, +"number_of_frames" : 8, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_walkcycle_W" : { +"texture" : "spritesheet/head/heads/human/male/walk", +"topx" : 64, +"topy" : 64, +"height" : 64, +"width" : 64, +"number_of_frames" : 8, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_walkcycle_S" : { +"texture" : "spritesheet/head/heads/human/male/walk", +"topx" : 64, +"topy" : 128, +"height" : 64, +"width" : 64, +"number_of_frames" : 8, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_walkcycle_E" : { +"texture" : "spritesheet/head/heads/human/male/walk", +"topx" : 64, +"topy" : 192, +"height" : 64, +"width" : 64, +"number_of_frames" : 8, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_standing_N" : { +"texture" : "spritesheet/head/heads/human/male/idle", +"topx" : 0, +"topy" : 0, +"height" : 64, +"width" : 64, +"number_of_frames" : 1, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_standing_W" : { +"texture" : "spritesheet/head/heads/human/male/idle", +"topx" : 0, +"topy" : 64, +"height" : 64, +"width" : 64, +"number_of_frames" : 1, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_standing_S" : { +"texture" : "spritesheet/head/heads/human/male/idle", +"topx" : 0, +"topy" : 128, +"height" : 64, +"width" : 64, +"number_of_frames" : 1, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_standing_E" : { +"texture" : "spritesheet/head/heads/human/male/idle", +"topx" : 0, +"topy" : 192, +"height" : 64, +"width" : 64, +"number_of_frames" : 1, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_spellcast_N" : { +"texture" : "spritesheet/head/heads/human/male/spellcast", +"topx" : 0, +"topy" : 0, +"height" : 64, +"width" : 64, +"number_of_frames" : 7, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_spellcast_W" : { +"texture" : "spritesheet/head/heads/human/male/spellcast", +"topx" : 0, +"topy" : 64, +"height" : 64, +"width" : 64, +"number_of_frames" : 7, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_spellcast_S" : { +"texture" : "spritesheet/head/heads/human/male/spellcast", +"topx" : 0, +"topy" : 128, +"height" : 64, +"width" : 64, +"number_of_frames" : 7, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_spellcast_E" : { +"texture" : "spritesheet/head/heads/human/male/spellcast", +"topx" : 0, +"topy" : 192, +"height" : 64, +"width" : 64, +"number_of_frames" : 7, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_slash_N" : { +"texture" : "spritesheet/head/heads/human/male/slash", +"topx" : 0, +"topy" : 0, +"height" : 64, +"width" : 64, +"number_of_frames" : 6, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_slash_W" : { +"texture" : "spritesheet/head/heads/human/male/slash", +"topx" : 0, +"topy" : 64, +"height" : 64, +"width" : 64, +"number_of_frames" : 6, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_slash_S" : { +"texture" : "spritesheet/head/heads/human/male/slash", +"topx" : 0, +"topy" : 128, +"height" : 64, +"width" : 64, +"number_of_frames" : 6, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_slash_E" : { +"texture" : "spritesheet/head/heads/human/male/slash", +"topx" : 0, +"topy" : 192, +"height" : 64, +"width" : 64, +"number_of_frames" : 6, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"male_head_hurt_S" : { +"texture" : "spritesheet/head/heads/human/male/hurt", "topx" : 0, "topy" : 0, "height" : 64, @@ -206,7 +410,7 @@ } , "female_walkcycle_N" : { -"texture" : "female_walkcycle", +"texture" : "spritesheet/body/bodies/female/walk", "topx" : 64, "topy" : 0, "height" : 64, @@ -218,7 +422,7 @@ } , "female_walkcycle_W" : { -"texture" : "female_walkcycle", +"texture" : "spritesheet/body/bodies/female/walk", "topx" : 64, "topy" : 64, "height" : 64, @@ -230,7 +434,7 @@ } , "female_walkcycle_S" : { -"texture" : "female_walkcycle", +"texture" : "spritesheet/body/bodies/female/walk", "topx" : 64, "topy" : 128, "height" : 64, @@ -242,7 +446,7 @@ } , "female_walkcycle_E" : { -"texture" : "female_walkcycle", +"texture" : "spritesheet/body/bodies/female/walk", "topx" : 64, "topy" : 192, "height" : 64, @@ -254,7 +458,7 @@ } , "female_standing_N" : { -"texture" : "female_walkcycle", +"texture" : "spritesheet/body/bodies/female/idle", "topx" : 0, "topy" : 0, "height" : 64, @@ -266,7 +470,7 @@ } , "female_standing_W" : { -"texture" : "female_walkcycle", +"texture" : "spritesheet/body/bodies/female/idle", "topx" : 0, "topy" : 64, "height" : 64, @@ -278,7 +482,7 @@ } , "female_standing_S" : { -"texture" : "female_walkcycle", +"texture" : "spritesheet/body/bodies/female/idle", "topx" : 0, "topy" : 128, "height" : 64, @@ -290,7 +494,7 @@ } , "female_standing_E" : { -"texture" : "female_walkcycle", +"texture" : "spritesheet/body/bodies/female/idle", "topx" : 0, "topy" : 192, "height" : 64, @@ -302,7 +506,7 @@ } , "female_spellcast_N" : { -"texture" : "female_spellcast", +"texture" : "spritesheet/body/bodies/female/spellcast", "topx" : 0, "topy" : 0, "height" : 64, @@ -314,7 +518,7 @@ } , "female_spellcast_W" : { -"texture" : "female_spellcast", +"texture" : "spritesheet/body/bodies/female/spellcast", "topx" : 0, "topy" : 64, "height" : 64, @@ -326,7 +530,7 @@ } , "female_spellcast_S" : { -"texture" : "female_spellcast", +"texture" : "spritesheet/body/bodies/female/spellcast", "topx" : 0, "topy" : 128, "height" : 64, @@ -338,7 +542,7 @@ } , "female_spellcast_E" : { -"texture" : "female_spellcast", +"texture" : "spritesheet/body/bodies/female/spellcast", "topx" : 0, "topy" : 192, "height" : 64, @@ -350,7 +554,7 @@ } , "female_slash_N" : { -"texture" : "female_slash", +"texture" : "spritesheet/body/bodies/female/slash", "topx" : 0, "topy" : 0, "height" : 64, @@ -362,7 +566,7 @@ } , "female_slash_W" : { -"texture" : "female_slash", +"texture" : "spritesheet/body/bodies/female/slash", "topx" : 0, "topy" : 64, "height" : 64, @@ -374,7 +578,7 @@ } , "female_slash_S" : { -"texture" : "female_slash", +"texture" : "spritesheet/body/bodies/female/slash", "topx" : 0, "topy" : 128, "height" : 64, @@ -386,7 +590,7 @@ } , "female_slash_E" : { -"texture" : "female_slash", +"texture" : "spritesheet/body/bodies/female/slash", "topx" : 0, "topy" : 192, "height" : 64, @@ -398,7 +602,211 @@ } , "female_hurt_S" : { -"texture" : "female_hurt", +"texture" : "spritesheet/body/bodies/female/hurt", +"topx" : 0, +"topy" : 0, +"height" : 64, +"width" : 64, +"number_of_frames" : 6, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_walkcycle_N" : { +"texture" : "spritesheet/head/heads/human/female/walk", +"topx" : 64, +"topy" : 0, +"height" : 64, +"width" : 64, +"number_of_frames" : 8, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_walkcycle_W" : { +"texture" : "spritesheet/head/heads/human/female/walk", +"topx" : 64, +"topy" : 64, +"height" : 64, +"width" : 64, +"number_of_frames" : 8, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_walkcycle_S" : { +"texture" : "spritesheet/head/heads/human/female/walk", +"topx" : 64, +"topy" : 128, +"height" : 64, +"width" : 64, +"number_of_frames" : 8, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_walkcycle_E" : { +"texture" : "spritesheet/head/heads/human/female/walk", +"topx" : 64, +"topy" : 192, +"height" : 64, +"width" : 64, +"number_of_frames" : 8, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_standing_N" : { +"texture" : "spritesheet/head/heads/human/female/idle", +"topx" : 0, +"topy" : 0, +"height" : 64, +"width" : 64, +"number_of_frames" : 1, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_standing_W" : { +"texture" : "spritesheet/head/heads/human/female/idle", +"topx" : 0, +"topy" : 64, +"height" : 64, +"width" : 64, +"number_of_frames" : 1, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_standing_S" : { +"texture" : "spritesheet/head/heads/human/female/idle", +"topx" : 0, +"topy" : 128, +"height" : 64, +"width" : 64, +"number_of_frames" : 1, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_standing_E" : { +"texture" : "spritesheet/head/heads/human/female/idle", +"topx" : 0, +"topy" : 192, +"height" : 64, +"width" : 64, +"number_of_frames" : 1, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_spellcast_N" : { +"texture" : "spritesheet/head/heads/human/female/spellcast", +"topx" : 0, +"topy" : 0, +"height" : 64, +"width" : 64, +"number_of_frames" : 7, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_spellcast_W" : { +"texture" : "spritesheet/head/heads/human/female/spellcast", +"topx" : 0, +"topy" : 64, +"height" : 64, +"width" : 64, +"number_of_frames" : 7, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_spellcast_S" : { +"texture" : "spritesheet/head/heads/human/female/spellcast", +"topx" : 0, +"topy" : 128, +"height" : 64, +"width" : 64, +"number_of_frames" : 7, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_spellcast_E" : { +"texture" : "spritesheet/head/heads/human/female/spellcast", +"topx" : 0, +"topy" : 192, +"height" : 64, +"width" : 64, +"number_of_frames" : 7, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_slash_N" : { +"texture" : "spritesheet/head/heads/human/female/slash", +"topx" : 0, +"topy" : 0, +"height" : 64, +"width" : 64, +"number_of_frames" : 6, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_slash_W" : { +"texture" : "spritesheet/head/heads/human/female/slash", +"topx" : 0, +"topy" : 64, +"height" : 64, +"width" : 64, +"number_of_frames" : 6, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_slash_S" : { +"texture" : "spritesheet/head/heads/human/female/slash", +"topx" : 0, +"topy" : 128, +"height" : 64, +"width" : 64, +"number_of_frames" : 6, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_slash_E" : { +"texture" : "spritesheet/head/heads/human/female/slash", +"topx" : 0, +"topy" : 192, +"height" : 64, +"width" : 64, +"number_of_frames" : 6, +"frame_time" : 100, +"originx" : 32, +"originy" : 50 +} +, +"female_head_hurt_S" : { +"texture" : "spritesheet/head/heads/human/female/hurt", "topx" : 0, "topy" : 0, "height" : 64, diff --git a/data/textures/spritesheet/body/bodies/female/hurt.png b/data/textures/spritesheet/body/bodies/female/hurt.png new file mode 100644 index 0000000..8fca80d Binary files /dev/null and b/data/textures/spritesheet/body/bodies/female/hurt.png differ diff --git a/data/textures/spritesheet/body/bodies/female/idle.png b/data/textures/spritesheet/body/bodies/female/idle.png new file mode 100644 index 0000000..7414c78 Binary files /dev/null and b/data/textures/spritesheet/body/bodies/female/idle.png differ diff --git a/data/textures/spritesheet/body/bodies/female/slash.png b/data/textures/spritesheet/body/bodies/female/slash.png new file mode 100644 index 0000000..c6122d8 Binary files /dev/null and b/data/textures/spritesheet/body/bodies/female/slash.png differ diff --git a/data/textures/spritesheet/body/bodies/female/spellcast.png b/data/textures/spritesheet/body/bodies/female/spellcast.png new file mode 100644 index 0000000..be0d5c2 Binary files /dev/null and b/data/textures/spritesheet/body/bodies/female/spellcast.png differ diff --git a/data/textures/spritesheet/body/bodies/female/walk.png b/data/textures/spritesheet/body/bodies/female/walk.png new file mode 100644 index 0000000..fbe7f2e Binary files /dev/null and b/data/textures/spritesheet/body/bodies/female/walk.png differ diff --git a/data/textures/spritesheet/body/bodies/male/hurt.png b/data/textures/spritesheet/body/bodies/male/hurt.png new file mode 100644 index 0000000..44db23a Binary files /dev/null and b/data/textures/spritesheet/body/bodies/male/hurt.png differ diff --git a/data/textures/spritesheet/body/bodies/male/idle.png b/data/textures/spritesheet/body/bodies/male/idle.png new file mode 100644 index 0000000..009ce1f Binary files /dev/null and b/data/textures/spritesheet/body/bodies/male/idle.png differ diff --git a/data/textures/spritesheet/body/bodies/male/slash.png b/data/textures/spritesheet/body/bodies/male/slash.png new file mode 100644 index 0000000..3ca36cc Binary files /dev/null and b/data/textures/spritesheet/body/bodies/male/slash.png differ diff --git a/data/textures/spritesheet/body/bodies/male/spellcast.png b/data/textures/spritesheet/body/bodies/male/spellcast.png new file mode 100644 index 0000000..fae39da Binary files /dev/null and b/data/textures/spritesheet/body/bodies/male/spellcast.png differ diff --git a/data/textures/spritesheet/body/bodies/male/walk.png b/data/textures/spritesheet/body/bodies/male/walk.png new file mode 100644 index 0000000..b8dc1f8 Binary files /dev/null and b/data/textures/spritesheet/body/bodies/male/walk.png differ diff --git a/data/textures/spritesheet/head/heads/human/female/hurt.png b/data/textures/spritesheet/head/heads/human/female/hurt.png new file mode 100644 index 0000000..7db4ae4 Binary files /dev/null and b/data/textures/spritesheet/head/heads/human/female/hurt.png differ diff --git a/data/textures/spritesheet/head/heads/human/female/idle.png b/data/textures/spritesheet/head/heads/human/female/idle.png new file mode 100644 index 0000000..d1c1e27 Binary files /dev/null and b/data/textures/spritesheet/head/heads/human/female/idle.png differ diff --git a/data/textures/spritesheet/head/heads/human/female/slash.png b/data/textures/spritesheet/head/heads/human/female/slash.png new file mode 100644 index 0000000..e52b13b Binary files /dev/null and b/data/textures/spritesheet/head/heads/human/female/slash.png differ diff --git a/data/textures/spritesheet/head/heads/human/female/spellcast.png b/data/textures/spritesheet/head/heads/human/female/spellcast.png new file mode 100644 index 0000000..f293f7b Binary files /dev/null and b/data/textures/spritesheet/head/heads/human/female/spellcast.png differ diff --git a/data/textures/spritesheet/head/heads/human/female/walk.png b/data/textures/spritesheet/head/heads/human/female/walk.png new file mode 100644 index 0000000..0063aa7 Binary files /dev/null and b/data/textures/spritesheet/head/heads/human/female/walk.png differ diff --git a/data/textures/spritesheet/head/heads/human/male/hurt.png b/data/textures/spritesheet/head/heads/human/male/hurt.png new file mode 100644 index 0000000..d35053a Binary files /dev/null and b/data/textures/spritesheet/head/heads/human/male/hurt.png differ diff --git a/data/textures/spritesheet/head/heads/human/male/idle.png b/data/textures/spritesheet/head/heads/human/male/idle.png new file mode 100644 index 0000000..28893d8 Binary files /dev/null and b/data/textures/spritesheet/head/heads/human/male/idle.png differ diff --git a/data/textures/spritesheet/head/heads/human/male/slash.png b/data/textures/spritesheet/head/heads/human/male/slash.png new file mode 100644 index 0000000..dbf6106 Binary files /dev/null and b/data/textures/spritesheet/head/heads/human/male/slash.png differ diff --git a/data/textures/spritesheet/head/heads/human/male/spellcast.png b/data/textures/spritesheet/head/heads/human/male/spellcast.png new file mode 100644 index 0000000..204ef40 Binary files /dev/null and b/data/textures/spritesheet/head/heads/human/male/spellcast.png differ diff --git a/data/textures/spritesheet/head/heads/human/male/walk.png b/data/textures/spritesheet/head/heads/human/male/walk.png new file mode 100644 index 0000000..39fed86 Binary files /dev/null and b/data/textures/spritesheet/head/heads/human/male/walk.png differ diff --git a/extra/scripts/python/create_human_sprite.py b/extra/scripts/python/create_human_sprite.py index 8d84c17..ac1b10b 100644 --- a/extra/scripts/python/create_human_sprite.py +++ b/extra/scripts/python/create_human_sprite.py @@ -3,16 +3,56 @@ import common.directional_sprite import sys -def print_male(race="male", file=sys.stdout): - common.directional_sprite.print_sprite(race=race, animation="walkcycle", name=None, texture=race+"_walkcycle", topX=64, topY=0, number_of_frames=8, file=file) +def print_male(file=sys.stdout): + race = "male" + common.directional_sprite.print_sprite(race=race, animation="walkcycle", name=None, texture="spritesheet/body/bodies/male/walk", topX=64, topY=0, number_of_frames=8, file=file) print(",", file=file) - common.directional_sprite.print_sprite(race=race, animation="standing", name=None, texture=race+"_walkcycle", topY=0, number_of_frames=1, file=file) + common.directional_sprite.print_sprite(race=race, animation="standing", name=None, texture="spritesheet/body/bodies/male/idle", topY=0, number_of_frames=1, file=file) print(",", file=file) - common.directional_sprite.print_sprite(race=race, animation="spellcast", name=None, texture=race+"_spellcast", topY=0, number_of_frames=7, file=file) + common.directional_sprite.print_sprite(race=race, animation="spellcast", name=None, texture="spritesheet/body/bodies/male/spellcast", topY=0, number_of_frames=7, file=file) print(",", file=file) - common.directional_sprite.print_sprite(race=race, animation="slash", name=None, texture=race+"_slash", topY=0, number_of_frames=6, file=file) + common.directional_sprite.print_sprite(race=race, animation="slash", name=None, texture="spritesheet/body/bodies/male/slash", topY=0, number_of_frames=6, file=file) print(",", file=file) - common.directional_sprite.print_sprite_direction(race=race, animation="hurt", name=None, texture=race+"_hurt", topY=0, number_of_frames=6, file=file) + common.directional_sprite.print_sprite_direction(race=race, animation="hurt", name=None, texture="spritesheet/body/bodies/male/hurt", topY=0, number_of_frames=6, file=file) + + +def print_female(file=sys.stdout): + race = "female" + common.directional_sprite.print_sprite(race=race, animation="walkcycle", name=None, texture="spritesheet/body/bodies/female/walk", topX=64, topY=0, number_of_frames=8, file=file) + print(",", file=file) + common.directional_sprite.print_sprite(race=race, animation="standing", name=None, texture="spritesheet/body/bodies/female/idle", topY=0, number_of_frames=1, file=file) + print(",", file=file) + common.directional_sprite.print_sprite(race=race, animation="spellcast", name=None, texture="spritesheet/body/bodies/female/spellcast", topY=0, number_of_frames=7, file=file) + print(",", file=file) + common.directional_sprite.print_sprite(race=race, animation="slash", name=None, texture="spritesheet/body/bodies/female/slash", topY=0, number_of_frames=6, file=file) + print(",", file=file) + common.directional_sprite.print_sprite_direction(race=race, animation="hurt", name=None, texture="spritesheet/body/bodies/female/hurt", topY=0, number_of_frames=6, file=file) + + +def print_male_head(file=sys.stdout): + race = "male" + common.directional_sprite.print_sprite(race=race, animation="head_walkcycle", name=None, texture="spritesheet/head/heads/human/male/walk", topX=64, topY=0, number_of_frames=8, file=file) + print(",", file=file) + common.directional_sprite.print_sprite(race=race, animation="head_standing", name=None, texture="spritesheet/head/heads/human/male/idle", topY=0, number_of_frames=1, file=file) + print(",", file=file) + common.directional_sprite.print_sprite(race=race, animation="head_spellcast", name=None, texture="spritesheet/head/heads/human/male/spellcast", topY=0, number_of_frames=7, file=file) + print(",", file=file) + common.directional_sprite.print_sprite(race=race, animation="head_slash", name=None, texture="spritesheet/head/heads/human/male/slash", topY=0, number_of_frames=6, file=file) + print(",", file=file) + common.directional_sprite.print_sprite_direction(race=race, animation="head_hurt", name=None, texture="spritesheet/head/heads/human/male/hurt", topY=0, number_of_frames=6, file=file) + + +def print_female_head(file=sys.stdout): + race = "female" + common.directional_sprite.print_sprite(race=race, animation="head_walkcycle", name=None, texture="spritesheet/head/heads/human/female/walk", topX=64, topY=0, number_of_frames=8, file=file) + print(",", file=file) + common.directional_sprite.print_sprite(race=race, animation="head_standing", name=None, texture="spritesheet/head/heads/human/female/idle", topY=0, number_of_frames=1, file=file) + print(",", file=file) + common.directional_sprite.print_sprite(race=race, animation="head_spellcast", name=None, texture="spritesheet/head/heads/human/female/spellcast", topY=0, number_of_frames=7, file=file) + print(",", file=file) + common.directional_sprite.print_sprite(race=race, animation="head_slash", name=None, texture="spritesheet/head/heads/human/female/slash", topY=0, number_of_frames=6, file=file) + print(",", file=file) + common.directional_sprite.print_sprite_direction(race=race, animation="head_hurt", name=None, texture="spritesheet/head/heads/human/female/hurt", topY=0, number_of_frames=6, file=file) def print_weapon(texture, weapon_name, file=sys.stdout): @@ -35,7 +75,11 @@ def main(): print(",", file=file) print_male(file=file) print(",", file=file) - print_male("female", file=file) + print_male_head(file=file) + print(",", file=file) + print_female(file=file) + print(",", file=file) + print_female_head(file=file) print("}", file=file) with open('../../../data/sprites/weapons.sprite', 'w') as file: print("{", file=file) diff --git a/src/ImGuiPlayerSelect.cpp b/src/ImGuiPlayerSelect.cpp index 8fd7470..aa8e851 100644 --- a/src/ImGuiPlayerSelect.cpp +++ b/src/ImGuiPlayerSelect.cpp @@ -292,6 +292,11 @@ void ImGuiPlayerSelect::Draw(SDL_Renderer* target) { // Draw base character baseSprite.Draw(target, animationTime, static_cast(previewX), static_cast(previewY), nullptr); + // Draw head + std::string headSpriteName = editingPlayer.get_visible_race() + "_head_walkcycle_W"; + const sago::SagoSprite& headSprite = globalData.spriteHolder->GetSprite(headSpriteName); + headSprite.Draw(target, animationTime, static_cast(previewX), static_cast(previewY), nullptr); + // Draw pants if available std::string bottom = editingPlayer.get_visible_bottom(); if (bottom.length()) { diff --git a/src/saland/GameDraw.cpp b/src/saland/GameDraw.cpp index 5979ea3..1957699 100644 --- a/src/saland/GameDraw.cpp +++ b/src/saland/GameDraw.cpp @@ -221,6 +221,14 @@ void DrawHumanEntity(SDL_Renderer* target, sago::SagoSpriteHolder* sHolder, cons else { mySprite.Draw(target, time, x, y, resize); } + // Draw head + const sago::SagoSprite& myHead = sHolder->GetSprite(entity->race + "_head_" + animation + "_" + std::string(1, entity->direction)); + if (relativeAnimation) { + myHead.DrawProgressive(target, relativeAnimationState, x, y, resize); + } + else { + myHead.Draw(target, time, x, y, resize); + } if (entity->pants.length() > 0) { const sago::SagoSprite& myPants = sHolder->GetSprite(entity->race + "_"+animation+"_"+entity->pants+"_"+std::string(1,entity->direction)); if (relativeAnimation) {