-
Notifications
You must be signed in to change notification settings - Fork 3
How to add a new character
(Let's take for example dad's character code)
colorPrefix
is 0xFF
and AF66CE
is a HEX color code that you will be able to edit. In-game, it will come out as 0xFFAF66CE
so a purple color for dad's health bar color.
'DADDY_DEAREST'
will be the path of your PNG and of your XML, both the files should be in the same folder and have the same file name. Since my files aren't in an extra folder I only wrote the files' name but if i made a new folder the path would be something like 'folder/DADDY_DEAREST'
.
week1
is the library, any folder inside the assets folder is a library, if it doesn't exist make sure to add it to Project.xml. So for example the library can be shared
, preload
(recommended for menu assets), week1-6
(recommended when you want to be organized).
First value of each animation (Example 'idle'
) shouldn't change but the second value should change depending on your XML's content, the animation name inside of your XML should be the second value (Excluding the digits) so for example 'Dad idle dance'
and the third value is the FPS (Frame Per Second), it should stay at 24 so do not worry about that.
Each character has that line of code, make sure to implement it or else the character will be static. playAnim('idle')
will play the character main's animation so for example the dad will play the idle
animation but something like the GF will play danceLeft
or danceRight
since she doesn't have the idle
animation but I would recommend doing an idle
animation or else you will have to code extra stuff.
Make a TXT file in assets/shared/images/characters/offsets
named like characterOffsets.txt
(Replace character with your character's name so for example dadOffsets.txt
)
First value is the animation name you setted up in Character.hx, the second value is the X coordinate and the third value is the Y coordinate. Offsets are used to align the character's sprites so they don't look off.
Make a 450x150 PNG file in assets/preload/images/healthicons
named like icon-character.png
(Replace character with your character's name so for example icon-dad.png
)
First icon is the main/neutral icon, the second icon is the losing icon and the third icon is the winning icon.
Each icon has the size of 150x150 pixels.
If you want to play as your character using the Charting Debug menu, make sure to add it in characterList.txt
located at assets/preload/data
.
If you want to make your character playable and selectable via the character selection menu, just follow what the comment says in CharacterSelectionSubState.hx, you just have to fill 2 arrays.