diff --git a/assets/FRAMEBUFFER.psx b/assets/FRAMEBUFFER.psx index 5c1db3e..f318490 100644 --- a/assets/FRAMEBUFFER.psx +++ b/assets/FRAMEBUFFER.psx @@ -10,7 +10,7 @@ File_7=Z:\home\alchemist\git\engine-psx\assets\levels\R2\tiles.TIM File_8=Z:\home\alchemist\git\engine-psx\assets\levels\R3\BG0.TIM File_9=Z:\home\alchemist\git\engine-psx\assets\levels\R3\TILES.TIM File_10=Z:\home\alchemist\git\engine-psx\assets\sprites\BASEFONT.TIM -File_11=Z:\home\alchemist\git\engine-psx\assets\sprites\SONIC.TIM +File_11=Z:\home\alchemist\git\engine-psx\assets\sprites\CHARA\SONIC.TIM [Graphics Mode] Width=320 Height=240 diff --git a/assets/pre/sprites/proj/sonic-orig.png b/assets/pre/sprites/proj/sonic-orig.png deleted file mode 100644 index 0d73dbc..0000000 Binary files a/assets/pre/sprites/proj/sonic-orig.png and /dev/null differ diff --git a/assets/pre/sprites/proj/sonic.aseprite b/assets/pre/sprites/proj/sonic.aseprite deleted file mode 100644 index 762668b..0000000 Binary files a/assets/pre/sprites/proj/sonic.aseprite and /dev/null differ diff --git a/assets/pre/sprites/proj/sonic.json b/assets/pre/sprites/proj/sonic.json deleted file mode 100644 index 9e70e00..0000000 --- a/assets/pre/sprites/proj/sonic.json +++ /dev/null @@ -1 +0,0 @@ -{"width":56,"height":56,"frames":[{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1}],"filename":"/home/alchemist/git/engine-psx/assets/pre/sprites/proj/sonic.aseprite","tags":[{"name":"Stopped","aniDir":"forward","color":"#000000","from":0,"to":0},{"name":"Idle","aniDir":"forward","color":"#000000","from":1,"to":4},{"name":"Walking","aniDir":"forward","color":"#000000","from":5,"to":10},{"name":"Running","aniDir":"forward","color":"#000000","from":11,"to":14},{"name":"Rolling","aniDir":"forward","color":"#000000","from":15,"to":22},{"name":"Skidding","aniDir":"forward","color":"#000000","from":23,"to":23},{"name":"PeelOut","aniDir":"forward","color":"#000000","from":24,"to":27},{"name":"Pushing","aniDir":"forward","color":"#000000","from":28,"to":31},{"name":"CrouchDown","aniDir":"forward","color":"#000000","from":32,"to":32},{"name":"LookUp","aniDir":"forward","color":"#000000","from":33,"to":33}],"layers":[{"name":"sonic","cels":[{"tilemap":{"width":5,"height":6,"tiles":[1,2,3,4,0,5,6,7,8,0,9,10,11,12,0,0,13,14,15,0,0,16,17,18,0,0,19,20,21,22]},"frame":0,"bounds":{"x":8,"y":8,"height":48,"width":40}},{"tilemap":{"width":5,"height":6,"tiles":[1,2,3,4,0,5,6,23,24,0,9,10,25,26,0,0,13,14,15,0,0,16,17,18,0,0,19,20,21,22]},"frame":1,"bounds":{"x":8,"y":8,"height":48,"width":40}},{"tilemap":{"width":5,"height":6,"tiles":[0,27,28,0,0,29,30,31,32,0,33,34,35,36,0,37,38,39,40,0,41,42,43,44,0,0,45,46,47,48]},"frame":2,"bounds":{"x":8,"y":8,"height":48,"width":40}},{"tilemap":{"width":5,"height":6,"tiles":[0,27,28,0,0,29,30,49,50,0,33,34,51,52,0,37,38,39,40,0,41,42,43,44,0,0,45,46,47,48]},"frame":3,"bounds":{"x":8,"y":8,"height":48,"width":40}},{"tilemap":{"width":5,"height":6,"tiles":[0,27,28,0,0,29,30,49,50,0,33,34,51,52,0,37,38,39,40,0,41,42,53,54,55,0,45,46,56,57]},"frame":4,"bounds":{"x":8,"y":8,"height":48,"width":40}},{"tilemap":{"width":5,"height":6,"tiles":[0,58,59,0,0,0,60,61,62,0,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,0,0,0]},"frame":5,"bounds":{"x":8,"y":8,"height":48,"width":40}},{"tilemap":{"width":5,"height":6,"tiles":[0,80,81,82,0,0,83,84,85,0,86,87,88,89,90,0,91,92,93,0,0,94,95,96,97,0,98,57,99,100]},"frame":6,"bounds":{"x":8,"y":8,"height":48,"width":40}},{"tilemap":{"width":3,"height":6,"tiles":[0,101,0,102,103,104,105,106,107,108,109,110,111,112,113,114,115,0]},"frame":7,"bounds":{"x":16,"y":8,"height":48,"width":24}},{"tilemap":{"width":5,"height":6,"tiles":[0,0,101,0,0,0,102,103,104,0,0,105,106,116,117,118,119,120,121,122,123,124,125,126,127,128,129,0,130,0]},"frame":8,"bounds":{"x":8,"y":8,"height":48,"width":40}},{"tilemap":{"width":4,"height":6,"tiles":[0,131,132,0,0,133,134,135,0,136,137,138,139,140,141,142,143,144,145,146,0,0,147,148]},"frame":9,"bounds":{"x":8,"y":8,"height":48,"width":32}},{"tilemap":{"width":5,"height":6,"tiles":[0,149,150,0,0,0,151,152,153,0,154,155,156,157,158,0,159,160,161,0,162,163,164,165,0,166,167,168,169,0]},"frame":10,"bounds":{"x":8,"y":8,"height":48,"width":40}},{"tilemap":{"width":4,"height":5,"tiles":[0,170,171,172,0,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187]},"frame":11,"bounds":{"x":8,"y":16,"height":40,"width":32}},{"tilemap":{"width":4,"height":5,"tiles":[0,188,189,190,0,191,192,175,193,194,195,196,197,198,199,200,0,201,202,203]},"frame":12,"bounds":{"x":8,"y":16,"height":40,"width":32}},{"tilemap":{"width":4,"height":5,"tiles":[0,170,171,172,0,173,174,175,204,205,206,207,208,209,210,211,212,213,214,215]},"frame":13,"bounds":{"x":8,"y":16,"height":40,"width":32}},{"tilemap":{"width":4,"height":5,"tiles":[0,188,189,190,0,216,174,175,217,218,219,220,221,222,223,224,0,225,226,227]},"frame":14,"bounds":{"x":8,"y":16,"height":40,"width":32}},{"tilemap":{"width":5,"height":4,"tiles":[0,228,229,230,0,231,232,233,234,235,236,237,238,239,240,0,241,242,243,0]},"frame":15,"bounds":{"x":8,"y":16,"height":32,"width":40}},{"tilemap":{"width":5,"height":4,"tiles":[0,244,245,246,0,247,248,249,250,251,252,253,254,254,255,0,256,257,258,259]},"frame":16,"bounds":{"x":8,"y":16,"height":32,"width":40}},{"tilemap":{"width":5,"height":4,"tiles":[0,260,261,262,0,263,264,265,266,267,268,269,270,271,272,273,274,275,276,0]},"frame":17,"bounds":{"x":8,"y":16,"height":32,"width":40}},{"tilemap":{"width":5,"height":4,"tiles":[0,244,245,246,0,247,248,249,250,251,252,253,254,254,255,0,256,257,258,259]},"frame":18,"bounds":{"x":8,"y":16,"height":32,"width":40}},{"tilemap":{"width":5,"height":4,"tiles":[277,278,279,280,0,281,282,283,284,285,286,287,288,289,290,0,291,292,293,0]},"frame":19,"bounds":{"x":8,"y":16,"height":32,"width":40}},{"tilemap":{"width":5,"height":4,"tiles":[0,244,245,246,0,247,248,249,250,251,252,253,254,254,255,0,256,257,258,259]},"frame":20,"bounds":{"x":8,"y":16,"height":32,"width":40}},{"tilemap":{"width":5,"height":4,"tiles":[0,294,295,296,0,297,298,299,300,301,302,303,304,305,306,307,308,309,310,0]},"frame":21,"bounds":{"x":8,"y":16,"height":32,"width":40}},{"tilemap":{"width":5,"height":4,"tiles":[0,244,245,246,0,247,248,249,250,251,252,253,254,254,255,0,256,257,258,259]},"frame":22,"bounds":{"x":8,"y":16,"height":32,"width":40}},{"tilemap":{"width":5,"height":5,"tiles":[0,311,312,313,0,314,315,316,317,318,319,320,321,322,323,0,324,325,326,327,0,0,0,328,329]},"frame":23,"bounds":{"x":8,"y":16,"height":40,"width":40}},{"tilemap":{"width":5,"height":5,"tiles":[0,0,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,0,0,348,349,350]},"frame":24,"bounds":{"x":0,"y":16,"height":40,"width":40}},{"tilemap":{"width":5,"height":5,"tiles":[0,0,351,352,353,354,334,355,356,337,357,358,359,360,361,362,363,364,365,366,0,0,367,368,369]},"frame":25,"bounds":{"x":0,"y":16,"height":40,"width":40}},{"tilemap":{"width":5,"height":5,"tiles":[0,0,330,331,332,354,334,370,336,337,371,372,373,374,342,375,376,377,378,379,0,380,381,382,383]},"frame":26,"bounds":{"x":0,"y":16,"height":40,"width":40}},{"tilemap":{"width":5,"height":5,"tiles":[0,0,351,352,353,354,334,355,356,337,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398]},"frame":27,"bounds":{"x":0,"y":16,"height":40,"width":40}},{"tilemap":{"width":4,"height":5,"tiles":[0,399,400,401,0,402,403,404,0,405,406,407,408,409,410,411,412,413,414,415]},"frame":28,"bounds":{"x":8,"y":16,"height":40,"width":32}},{"tilemap":{"width":4,"height":6,"tiles":[0,29,416,0,0,417,418,419,0,420,421,422,0,423,424,425,426,427,428,429,430,431,432,0]},"frame":29,"bounds":{"x":8,"y":8,"height":48,"width":32}},{"tilemap":{"width":4,"height":5,"tiles":[0,399,400,401,0,402,403,404,0,433,434,407,435,436,437,438,439,440,441,442]},"frame":30,"bounds":{"x":8,"y":16,"height":40,"width":32}},{"tilemap":{"width":4,"height":6,"tiles":[0,29,416,0,0,417,418,419,0,420,421,422,0,443,444,445,446,447,448,438,0,449,450,0]},"frame":31,"bounds":{"x":8,"y":8,"height":48,"width":32}},{"tilemap":{"width":4,"height":4,"tiles":[0,451,452,453,454,455,456,457,458,459,460,461,462,463,464,22]},"frame":32,"bounds":{"x":16,"y":24,"height":32,"width":32}},{"tilemap":{"width":5,"height":6,"tiles":[0,0,465,0,0,466,467,468,469,0,470,471,472,473,0,474,475,476,15,0,0,16,17,18,0,0,19,20,21,22]},"frame":33,"bounds":{"x":8,"y":8,"height":48,"width":40}}]}]} \ No newline at end of file diff --git a/assets/pre/sprites/proj/sonic.png b/assets/pre/sprites/proj/sonic.png deleted file mode 100644 index b83d8e0..0000000 Binary files a/assets/pre/sprites/proj/sonic.png and /dev/null differ diff --git a/assets/sprites/SONIC.CHARA b/assets/sprites/CHARA/SONIC.CHARA similarity index 79% rename from assets/sprites/SONIC.CHARA rename to assets/sprites/CHARA/SONIC.CHARA index 4271a5f..4c8f444 100644 Binary files a/assets/sprites/SONIC.CHARA and b/assets/sprites/CHARA/SONIC.CHARA differ diff --git a/assets/sprites/CHARA/SONIC.TIM b/assets/sprites/CHARA/SONIC.TIM new file mode 100644 index 0000000..0ca7727 Binary files /dev/null and b/assets/sprites/CHARA/SONIC.TIM differ diff --git a/assets/sprites/CHARA/SONIC.aseprite b/assets/sprites/CHARA/SONIC.aseprite new file mode 100644 index 0000000..905ef03 Binary files /dev/null and b/assets/sprites/CHARA/SONIC.aseprite differ diff --git a/assets/sprites/CHARA/SONIC.json b/assets/sprites/CHARA/SONIC.json new file mode 100644 index 0000000..d543c62 --- /dev/null +++ b/assets/sprites/CHARA/SONIC.json @@ -0,0 +1 @@ +{"filename":"/home/alchemist/git/engine-psx/assets/sprites/CHARA/SONIC.aseprite","height":56,"width":56,"tags":[{"name":"Stopped","aniDir":"forward","from":0,"to":0,"color":"#000000"},{"name":"Idle","aniDir":"forward","from":1,"to":4,"color":"#000000"},{"name":"Walking","aniDir":"forward","from":5,"to":10,"color":"#000000"},{"name":"Running","aniDir":"forward","from":11,"to":14,"color":"#000000"},{"name":"Rolling","aniDir":"forward","from":15,"to":22,"color":"#000000"},{"name":"Skidding","aniDir":"forward","from":23,"to":23,"color":"#000000"},{"name":"PeelOut","aniDir":"forward","from":24,"to":27,"color":"#000000"},{"name":"Pushing","aniDir":"forward","from":28,"to":31,"color":"#000000"},{"name":"CrouchDown","aniDir":"forward","from":32,"to":32,"color":"#000000"},{"name":"LookUp","aniDir":"forward","from":33,"to":33,"color":"#000000"},{"name":"Spring","aniDir":"forward","from":35,"to":35,"color":"#000000"},{"name":"Hurt","aniDir":"forward","from":36,"to":36,"color":"#000000"},{"name":"Death","aniDir":"forward","from":37,"to":37,"color":"#000000"}],"layers":[{"cels":[{"bounds":{"x":8,"height":48,"width":40,"y":8},"tilemap":{"width":5,"tiles":[1,2,3,4,0,5,6,7,8,0,9,10,11,12,0,0,13,14,15,0,0,16,17,18,0,0,19,20,21,22],"height":6},"frame":0},{"bounds":{"x":8,"height":48,"width":40,"y":8},"tilemap":{"width":5,"tiles":[1,2,3,4,0,5,6,23,24,0,9,10,25,26,0,0,13,14,15,0,0,16,17,18,0,0,19,20,21,22],"height":6},"frame":1},{"bounds":{"x":8,"height":48,"width":40,"y":8},"tilemap":{"width":5,"tiles":[0,27,28,0,0,29,30,31,32,0,33,34,35,36,0,37,38,39,40,0,41,42,43,44,0,0,45,46,47,48],"height":6},"frame":2},{"bounds":{"x":8,"height":48,"width":40,"y":8},"tilemap":{"width":5,"tiles":[0,27,28,0,0,29,30,49,50,0,33,34,51,52,0,37,38,39,40,0,41,42,43,44,0,0,45,46,47,48],"height":6},"frame":3},{"bounds":{"x":8,"height":48,"width":40,"y":8},"tilemap":{"width":5,"tiles":[0,27,28,0,0,29,30,49,50,0,33,34,51,52,0,37,38,39,40,0,41,42,53,54,55,0,45,46,56,57],"height":6},"frame":4},{"bounds":{"x":8,"height":48,"width":40,"y":8},"tilemap":{"width":5,"tiles":[0,58,59,0,0,0,60,61,62,0,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,0,0,0],"height":6},"frame":5},{"bounds":{"x":8,"height":48,"width":40,"y":8},"tilemap":{"width":5,"tiles":[0,80,81,82,0,0,83,84,85,0,86,87,88,89,90,0,91,92,93,0,0,94,95,96,97,0,98,57,99,100],"height":6},"frame":6},{"bounds":{"x":16,"height":48,"width":24,"y":8},"tilemap":{"width":3,"tiles":[0,101,0,102,103,104,105,106,107,108,109,110,111,112,113,114,115,0],"height":6},"frame":7},{"bounds":{"x":8,"height":48,"width":40,"y":8},"tilemap":{"width":5,"tiles":[0,0,101,0,0,0,102,103,104,0,0,105,106,116,117,118,119,120,121,122,123,124,125,126,127,128,129,0,130,0],"height":6},"frame":8},{"bounds":{"x":8,"height":48,"width":32,"y":8},"tilemap":{"width":4,"tiles":[0,131,132,0,0,133,134,135,0,136,137,138,139,140,141,142,143,144,145,146,0,0,147,148],"height":6},"frame":9},{"bounds":{"x":8,"height":48,"width":40,"y":8},"tilemap":{"width":5,"tiles":[0,149,150,0,0,0,151,152,153,0,154,155,156,157,158,0,159,160,161,0,162,163,164,165,0,166,167,168,169,0],"height":6},"frame":10},{"bounds":{"x":8,"height":40,"width":32,"y":16},"tilemap":{"width":4,"tiles":[0,170,171,172,0,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187],"height":5},"frame":11},{"bounds":{"x":8,"height":40,"width":32,"y":16},"tilemap":{"width":4,"tiles":[0,188,189,190,0,191,192,175,193,194,195,196,197,198,199,200,0,201,202,203],"height":5},"frame":12},{"bounds":{"x":8,"height":40,"width":32,"y":16},"tilemap":{"width":4,"tiles":[0,170,171,172,0,173,174,175,204,205,206,207,208,209,210,211,212,213,214,215],"height":5},"frame":13},{"bounds":{"x":8,"height":40,"width":32,"y":16},"tilemap":{"width":4,"tiles":[0,188,189,190,0,216,174,175,217,218,219,220,221,222,223,224,0,225,226,227],"height":5},"frame":14},{"bounds":{"x":8,"height":32,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,228,229,230,0,231,232,233,234,235,236,237,238,239,240,0,241,242,243,0],"height":4},"frame":15},{"bounds":{"x":8,"height":32,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,244,245,246,0,247,248,249,250,251,252,253,254,254,255,0,256,257,258,259],"height":4},"frame":16},{"bounds":{"x":8,"height":32,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,260,261,262,0,263,264,265,266,267,268,269,270,271,272,273,274,275,276,0],"height":4},"frame":17},{"bounds":{"x":8,"height":32,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,244,245,246,0,247,248,249,250,251,252,253,254,254,255,0,256,257,258,259],"height":4},"frame":18},{"bounds":{"x":8,"height":32,"width":40,"y":16},"tilemap":{"width":5,"tiles":[277,278,279,280,0,281,282,283,284,285,286,287,288,289,290,0,291,292,293,0],"height":4},"frame":19},{"bounds":{"x":8,"height":32,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,244,245,246,0,247,248,249,250,251,252,253,254,254,255,0,256,257,258,259],"height":4},"frame":20},{"bounds":{"x":8,"height":32,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,294,295,296,0,297,298,299,300,301,302,303,304,305,306,307,308,309,310,0],"height":4},"frame":21},{"bounds":{"x":8,"height":32,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,244,245,246,0,247,248,249,250,251,252,253,254,254,255,0,256,257,258,259],"height":4},"frame":22},{"bounds":{"x":8,"height":40,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,311,312,313,0,314,315,316,317,318,319,320,321,322,323,0,324,325,326,327,0,0,0,328,329],"height":5},"frame":23},{"bounds":{"x":0,"height":40,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,0,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,0,0,348,349,350],"height":5},"frame":24},{"bounds":{"x":0,"height":40,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,0,351,352,353,354,334,355,356,337,357,358,359,360,361,362,363,364,365,366,0,0,367,368,369],"height":5},"frame":25},{"bounds":{"x":0,"height":40,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,0,330,331,332,354,334,370,336,337,371,372,373,374,342,375,376,377,378,379,0,380,381,382,383],"height":5},"frame":26},{"bounds":{"x":0,"height":40,"width":40,"y":16},"tilemap":{"width":5,"tiles":[0,0,351,352,353,354,334,355,356,337,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398],"height":5},"frame":27},{"bounds":{"x":8,"height":40,"width":32,"y":16},"tilemap":{"width":4,"tiles":[0,399,400,401,0,402,403,404,0,405,406,407,408,409,410,411,412,413,414,415],"height":5},"frame":28},{"bounds":{"x":8,"height":48,"width":32,"y":8},"tilemap":{"width":4,"tiles":[0,29,416,0,0,417,418,419,0,420,421,422,0,423,424,425,426,427,428,429,430,431,432,0],"height":6},"frame":29},{"bounds":{"x":8,"height":40,"width":32,"y":16},"tilemap":{"width":4,"tiles":[0,399,400,401,0,402,403,404,0,433,434,407,435,436,437,438,439,440,441,442],"height":5},"frame":30},{"bounds":{"x":8,"height":48,"width":32,"y":8},"tilemap":{"width":4,"tiles":[0,29,416,0,0,417,418,419,0,420,421,422,0,443,444,445,446,447,448,438,0,449,450,0],"height":6},"frame":31},{"bounds":{"x":16,"height":32,"width":32,"y":24},"tilemap":{"width":4,"tiles":[0,451,452,453,454,455,456,457,458,459,460,461,462,463,464,22],"height":4},"frame":32},{"bounds":{"x":8,"height":48,"width":40,"y":8},"tilemap":{"width":5,"tiles":[0,0,465,0,0,466,467,468,469,0,470,471,472,473,0,474,475,476,15,0,0,16,17,18,0,0,19,20,21,22],"height":6},"frame":33},{"bounds":{"x":8,"height":56,"width":32,"y":0},"tilemap":{"width":4,"tiles":[0,0,477,0,478,479,480,481,482,483,484,485,486,487,488,489,0,490,491,492,0,493,494,0,0,495,496,0],"height":7},"frame":34},{"bounds":{"x":8,"height":56,"width":32,"y":0},"tilemap":{"width":4,"tiles":[0,0,477,0,478,479,480,481,482,483,484,485,486,487,488,489,0,490,491,492,0,493,494,0,0,495,496,0],"height":7},"frame":35},{"bounds":{"x":0,"height":32,"width":48,"y":16},"tilemap":{"width":6,"tiles":[0,497,498,499,500,0,501,502,503,504,505,506,0,507,508,509,510,511,0,0,512,513,514,515],"height":4},"frame":36},{"bounds":{"x":8,"height":48,"width":40,"y":8},"tilemap":{"width":5,"tiles":[516,517,518,519,520,521,522,523,524,525,0,526,527,528,0,0,529,530,531,0,0,532,533,534,535,0,536,0,0,0],"height":6},"frame":37}],"name":"Flattened"}],"frames":[{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1},{"duration":0.1}]} \ No newline at end of file diff --git a/assets/sprites/CHARA/SONIC.png b/assets/sprites/CHARA/SONIC.png new file mode 100644 index 0000000..ec88480 Binary files /dev/null and b/assets/sprites/CHARA/SONIC.png differ diff --git a/assets/sprites/CHARA/sonic-sheet.png b/assets/sprites/CHARA/sonic-sheet.png new file mode 100644 index 0000000..d44aeb3 Binary files /dev/null and b/assets/sprites/CHARA/sonic-sheet.png differ diff --git a/assets/sprites/SONIC.TIM b/assets/sprites/SONIC.TIM deleted file mode 100644 index 0d85ff9..0000000 Binary files a/assets/sprites/SONIC.TIM and /dev/null differ diff --git a/assets/sprites/sonic.gif b/assets/sprites/sonic.gif deleted file mode 100644 index 547ec99..0000000 Binary files a/assets/sprites/sonic.gif and /dev/null differ diff --git a/include/player.h b/include/player.h index 04da596..22649d8 100644 --- a/include/player.h +++ b/include/player.h @@ -44,7 +44,8 @@ typedef enum { ACTION_JUMPING, ACTION_ROLLING, ACTION_SPINDASH, - ACTION_DROPDASH + ACTION_DROPDASH, + ACTION_SPRING, } PlayerAction; typedef struct { @@ -64,6 +65,7 @@ typedef struct { uint8_t push; uint32_t spinrev; uint8_t ctrllock; + uint8_t airdirlock; uint8_t framecount; uint8_t holding_jump; diff --git a/iso.xml b/iso.xml index d6a7cd3..c2721f9 100644 --- a/iso.xml +++ b/iso.xml @@ -17,10 +17,10 @@ + source="${PROJECT_SOURCE_DIR}/assets/sprites/CHARA/SONIC.TIM" /> + source="${PROJECT_SOURCE_DIR}/assets/sprites/CHARA/SONIC.CHARA" /> diff --git a/src/chara.c b/src/chara.c index 26475b8..cc31f9e 100644 --- a/src/chara.c +++ b/src/chara.c @@ -143,7 +143,7 @@ chara_render_frame(Chara *chara, int16_t framenum, int16_t vx, int16_t vy, uint8 increment_prim(sizeof(POLY_FT4)); setPolyFT4(poly); setRGB0(poly, level_fade, level_fade, level_fade); - setTPage(poly, 0, 0, chara->prectx, chara->precty); + setTPage(poly, 1, 1, chara->prectx, chara->precty); // 8-bit CLUT setClut(poly, chara->crectx, chara->crecty); setXYWH(poly, xy0.vx, xy0.vy, 8, 8); diff --git a/src/object_state_update.c b/src/object_state_update.c index 65d5533..3b89969 100644 --- a/src/object_state_update.c +++ b/src/object_state_update.c @@ -13,9 +13,6 @@ #include "screen.h" #include "screens/level.h" -// Adler32 sums of player animation names -#define ANIM_WALKING 0x0854020e - // Extern elements extern Player player; extern Camera camera; @@ -277,95 +274,19 @@ _spring_update(ObjectState *state, ObjectTableEntry *, VECTOR *pos, uint8_t is_r player.pos.vy = (solidity_vy - (player_height >> 1)) << 12; player.grnd = 0; player.vel.vy = is_red ? -0x10000 : -0xa000; - player.vel.vz = 0; player.angle = 0; - player.action = 0; + player.action = ACTION_SPRING; state->anim_state.animation = 1; - player_set_animation_direct(&player, ANIM_WALKING); sound_play_vag(sfx_sprn, 0); } else if(state->flipmask & MASK_FLIP_FLIPY) { // Bottom-pointing spring player.pos.vy = (solidity_vy + solidity_h + (player_height >> 1)) << 12; player.grnd = 0; player.vel.vy = is_red ? 0x10000 : 0xa000; - player.vel.vz = 0; player.angle = 0; - player.action = 0; + player.action = ACTION_SPRING; state->anim_state.animation = 1; - player_set_animation_direct(&player, ANIM_WALKING); sound_play_vag(sfx_sprn, 0); } - - - // Complex spring collision. Commented out. Doesn't work properly. - /* switch(collision_side) { */ - /* default: return; */ - /* case OBJ_SIDE_LEFT: */ - /* if(state->flipmask & MASK_FLIP_ROTCT) { */ - /* if(player.grnd) player.vel.vz = is_red ? -0x10000 : -0xa000; */ - /* else player.vel.vx = is_red ? -0x10000 : -0xa000; */ - /* player.ctrllock = 16; */ - /* player.anim_dir = -1; */ - /* state->anim_state.animation = 1; */ - /* sound_play_vag(sfx_sprn, 0); */ - /* } else { */ - /* player.ev_right = (CollisionEvent) { */ - /* .collided = 1, */ - /* .coord = solidity_vx + 1, */ - /* .angle = 0 */ - /* }; */ - /* } */ - /* break; */ - /* case OBJ_SIDE_RIGHT: */ - /* if(state->flipmask & MASK_FLIP_ROTCW) { */ - /* if(player.grnd) player.vel.vz = is_red ? 0x10000 : 0xa000; */ - /* else player.vel.vx = is_red ? 0x10000 : 0xa000; */ - /* player.ctrllock = 16; */ - /* player.anim_dir = 1; */ - /* state->anim_state.animation = 1; */ - /* sound_play_vag(sfx_sprn, 0); */ - /* } else { */ - /* player.ev_left = (CollisionEvent) { */ - /* .collided = 1, */ - /* .coord = (solidity_vx + 15), */ - /* .angle = 0 */ - /* }; */ - /* } */ - /* break; */ - /* case OBJ_SIDE_TOP: */ - /* if(state->flipmask == 0) { */ - /* player.grnd = 0; */ - /* player.vel.vy = is_red ? -0x10000 : -0xa000; */ - /* player.angle = 0; */ - /* player.action = 0; */ - /* state->anim_state.animation = 1; */ - /* player_set_animation_direct(&player, ANIM_WALKING); */ - /* sound_play_vag(sfx_sprn, 0); */ - /* } else { */ - /* player.ev_grnd1 = player.ev_grnd2 = (CollisionEvent) { */ - /* .collided = 1, */ - /* .coord = solidity_vy + 8, */ - /* .angle = 0 */ - /* }; */ - /* } */ - /* break; */ - /* case OBJ_SIDE_BOTTOM: */ - /* if(state->flipmask & MASK_FLIP_FLIPY) { */ - /* player.grnd = 0; */ - /* player.vel.vy = is_red ? 0x10000 : 0xa000; */ - /* player.angle = 0; */ - /* player.action = 0; */ - /* state->anim_state.animation = 1; */ - /* player_set_animation_direct(&player, ANIM_WALKING); */ - /* sound_play_vag(sfx_sprn, 0); */ - /* } else { */ - /* player.ev_ceil1 = player.ev_ceil2 = (CollisionEvent) { */ - /* .collided = 1, */ - /* .coord = solidity_vy + solidity_h, */ - /* .angle = 0 */ - /* }; */ - /* } */ - /* break; */ - /* } */ } else if(state->anim_state.animation == OBJ_ANIMATION_NO_ANIMATION) { state->anim_state.animation = 0; state->anim_state.frame = 0; @@ -440,16 +361,15 @@ _spring_diagonal_update(ObjectState *state, ObjectTableEntry *, VECTOR *pos, uin player.grnd = 0; player.vel.vx = is_red ? SPRND_ST_R : SPRND_ST_Y; player.vel.vy = is_red ? SPRND_ST_R : SPRND_ST_Y; - player.vel.vz = 0; if(!(state->flipmask & MASK_FLIP_FLIPY)) player.vel.vy *= -1; if(state->flipmask & MASK_FLIP_FLIPX) { player.vel.vx *= -1; player.anim_dir = -1; // Flip on X: point player left } else player.anim_dir = 1; // No flip on X: point player right player.angle = 0; - player.action = 0; + player.airdirlock = 1; + player.action = ACTION_SPRING; state->anim_state.animation = 1; - player_set_animation_direct(&player, ANIM_WALKING); sound_play_vag(sfx_sprn, 0); } else if(state->anim_state.animation == OBJ_ANIMATION_NO_ANIMATION) { diff --git a/src/player.c b/src/player.c index c4b0654..4e655c6 100644 --- a/src/player.c +++ b/src/player.c @@ -14,16 +14,19 @@ #define ANIM_IDLE_TIMER_MAX 180 // Adler32 sums of animation names for ease of use -#define ANIM_STOPPED 0x08cd0220 -#define ANIM_IDLE 0x02d1011f -#define ANIM_WALKING 0x0854020e -#define ANIM_RUNNING 0x08bf0222 -#define ANIM_ROLLING 0x08890218 -#define ANIM_SKIDDING 0x0a85024e -#define ANIM_PEELOUT 0x0849021f -#define ANIM_PUSHING 0x08b2021f -#define ANIM_CROUCHDOWN 0x104802fd -#define ANIM_LOOKUP 0x067001db +#define ANIM_STOPPED 0x08cd0220 +#define ANIM_IDLE 0x02d1011f +#define ANIM_WALKING 0x0854020e +#define ANIM_RUNNING 0x08bf0222 +#define ANIM_ROLLING 0x08890218 +#define ANIM_SKIDDING 0x0a85024e +#define ANIM_PEELOUT 0x0849021f +#define ANIM_PUSHING 0x08b2021f +#define ANIM_CROUCHDOWN 0x104802fd +#define ANIM_LOOKUP 0x067001db +#define ANIM_SPRING 0x068e01d4 +#define ANIM_HURT 0x031b0144 +#define ANIM_DEATH 0x04200167 extern int debug_mode; @@ -56,6 +59,7 @@ load_player(Player *player, player->angle = 0; player->spinrev = 0; player->ctrllock = 0; + player->airdirlock = 0; player->framecount = 0; player_set_animation_direct(player, ANIM_STOPPED); @@ -367,8 +371,12 @@ _player_handle_collision(Player *player) player->pos.vy = ((new_coord - 16) << 12); player->grnd = 1; - if(player->action == ACTION_JUMPING || player->action == ACTION_ROLLING) + if(player->action == ACTION_JUMPING + || player->action == ACTION_ROLLING + || player->action == ACTION_SPRING) { player->action = ACTION_NONE; + player->airdirlock = 0; + } else if(player->action == ACTION_DROPDASH) { // Perform drop dash player->framecount = 0; @@ -555,11 +563,13 @@ player_update(Player *player) if(pad_pressing(PAD_RIGHT)) { if(player->vel.vx < X_TOP_SPD) player->vel.vx += X_AIR_ACCEL; - player->anim_dir = 1; + if(!player->airdirlock) + player->anim_dir = 1; } else if(pad_pressing(PAD_LEFT)) { if(player->vel.vx > -X_TOP_SPD) player->vel.vx -= X_AIR_ACCEL; - player->anim_dir = -1; + if(!player->airdirlock) + player->anim_dir = -1; } // Air drag. Calculated before applying gravity. @@ -654,7 +664,21 @@ player_update(Player *player) player_set_animation_direct(player, ANIM_RUNNING); } else player_set_animation_direct(player, ANIM_WALKING); } - } else player->idle_timer = ANIM_IDLE_TIMER_MAX; + } else { + player->idle_timer = ANIM_IDLE_TIMER_MAX; + if(player->action == ACTION_SPRING) { + if(player->vel.vy < 0) { + player_set_animation_direct(player, ANIM_SPRING); + } else { + player->airdirlock = 0; + if(abs(player->vel.vz) >= (10 << 12)) { + player_set_animation_direct(player, ANIM_PEELOUT); + } else if(abs(player->vel.vz) >= (6 << 12)) { + player_set_animation_direct(player, ANIM_RUNNING); + } else player_set_animation_direct(player, ANIM_WALKING); + } + } + } // Animation speed correction if(player->anim_timer == 0) { diff --git a/tools/guide.org b/tools/guide.org index e3dbbd6..3e3eeca 100644 --- a/tools/guide.org +++ b/tools/guide.org @@ -28,6 +28,95 @@ python -m venv ./venv To run any scripts with this venv, run ~./tools/venv/bin/python ./tools/script.py~. +* Generating a character sprite 8x8 tileset and mappings + +For characters, we need to use the Aseprite tool for building sprites. + +Import the character's sprites as a sprite sheet and into an .aseprite file (see +'assets/sprites/CHARA/SONIC.aseprite'). + +The character's sprites must be manipulated into individual frames on a tileset +layer, with 8x8 tiles. Plus, you'll have to organize the frames in such a way +that frames of the same animation are coupled together. + +Finally, group frames into animations by creating tags with animation names +(again, see 'SONIC.aseprite' for valid animation names). + +Finally, export the animation names and mappings using 'export_tilemap_psx.lua', +then export the player tileset using 'export_tileset_psx.lua'. + +This will create a 'SONIC.png' file and a 'SONIC.json' file. + +Now, just pack the frame and tile data into a CHARA file, and generate a TIM +image with correct CLUT and TPAGE info: + +#+begin_src bash :eval never +framepacker.py SONIC.json SONIC.CHARA +img2tim -usealpha -org 320 0 -plt 0 480 -bpp 8 -o SONIC.TIM SONIC.png +#+end_src + +Notice that, different than other image tile data, character sprites rely on a +PNG's alpha channel to generate transparency bits, instead of using the full +black color as mask. + +NOTE: If you need to refer to an animation directly by name, the animations are +referred to by the engine by their Adler32 hash, so you might want to add a new +definition for that on ~player.c~. + +The names used on tags are always converted to uppercase, with no spaces. + +To calculate the Adler32 hash for a string, one may use Zlib through Python. + +Here's a tool to generate hash definitions for some animations. + +#+begin_src python :results output +import zlib + +names = [ + "STOPPED", + "IDLE", + "WALKING", + "RUNNING", + "ROLLING", + "SKIDDING", + "PEELOUT", + "PUSHING", + "CROUCHDOWN", + "LOOKUP", + "SPRING", + "HURT", + "DEATH", +] + +def get_hash(name): + hash = zlib.adler32(str.encode(name)) + return f"0x{hash:08x}" + +def print_hashes(names): + for name in names: + hash = get_hash(name) + print(f"#define ANIM_{name:16} {hash}") + +print_hashes(names) +#+end_src + +#+RESULTS: +#+begin_example +#define ANIM_STOPPED 0x08cd0220 +#define ANIM_IDLE 0x02d1011f +#define ANIM_WALKING 0x0854020e +#define ANIM_RUNNING 0x08bf0222 +#define ANIM_ROLLING 0x08890218 +#define ANIM_SKIDDING 0x0a85024e +#define ANIM_PEELOUT 0x0849021f +#define ANIM_PUSHING 0x08b2021f +#define ANIM_CROUCHDOWN 0x104802fd +#define ANIM_LOOKUP 0x067001db +#define ANIM_SPRING 0x068e01d4 +#define ANIM_HURT 0x031b0144 +#define ANIM_DEATH 0x04200167 +#+end_example + * Generating 8x8 tiles and their 16x16 mappings The following steps will allow you to create intermediate files 'tiles.png',