Open nPokemon opened 1 year ago
Is this need to be 12 poses like that sample this ? https://i.imgur.com/nfD5cHh.png
This is my new character: https://i.imgur.com/QTFtQEj.png
Personas: https://drive.google.com/drive/folders/1Ni7kvQzVmvqmSDR_7ms3iWrb2ptw-myi?usp=drive_link Thank you.
Can't access the google drive file.
I'd also be interested in how to add new characters.
if you do not want to define the original 12 poses, you may have to write a little more code, according to the phaser specification, add a sprite, and then modify the motion animation.
if you imitate the 12 poses to do animation, Just add a new field to the persona_names
variable.
Here is by going through the predefined roles, and then batch this.physics.add
:
// *** SET UP PERSONAS ***
// We start by creating the game sprite objects.
for (let i=0; i<Object.keys(spawn_tile_loc).length; i++) {
let persona_name = Object.keys(spawn_tile_loc)[i];
let start_pos = [spawn_tile_loc[persona_name][0] * tile_width + tile_width / 2,
spawn_tile_loc[persona_name][1] * tile_width + tile_width];
let new_sprite = this.physics.add
.sprite(start_pos[0], start_pos[1], persona_name, "down")
.setSize(30, 40)
.setOffset(0, 0);
// Scale up the sprite
new_sprite.displayWidth = 40;
new_sprite.scaleY = new_sprite.scaleX;
/environment/frontend_server/templates/demo/main_script.html?#L263-L275 Here is a demo: https://chrome.google.com/webstore/detail/chatdev/dopllopmmfnghbahgbdejnkebfcmomej
Is this need to be 12 poses like that sample this ? https://i.imgur.com/nfD5cHh.png
This is my new character: https://i.imgur.com/QTFtQEj.png
Personas: https://drive.google.com/drive/folders/1Ni7kvQzVmvqmSDR_7ms3iWrb2ptw-myi?usp=drive_link Thank you.