Different sizes for individual frames?

Kitsune Mifune

New member
Is there a way to have individual animation frames set at different sizes, and to adjust the X/Y offsets for each to line things up neatly?

Or at least have different sizes for different sets of animations (Walk/Attack etc)?

My main sprite is almost always 4W5H, but sometimes a different movement will be a different shape (EG a 'Flying Kick' will be a more horizontal shape than a 'Walk' which will be taller).

Thanks.
 

dale_coop

Moderator
Staff member
No you can't. Size is defined by object... not by frame animation or state. (it has been asked a lot of times, but due to memory space issues, can't be implemented in NESmaker)
 

Kitsune Mifune

New member
Bummer. So, would a workaround be to take the largest frame size and set everything to that so there is room? I don't mind doing this if need be.
 

dale_coop

Moderator
Staff member
Yeah, it's a way of doing that. Another would be to make the kicking leg a melee weapon (But it's not very practical, either).
 

Dirk

Member
Could you replace the player object when he jumps with a larger monster object which has the jumping player graphics and after landing swap it back with the smaller regular player?
 

Raftronaut

Member
Dirk said:
Could you replace the player object when he jumps with a larger monster object which has the jumping player graphics and after landing swap it back with the smaller regular player?

That is what I would recommend really. Creating a new game object that will share the player palette called "jump kick" with it's own Bounding Box.. then set up circumstantial input press to check if player is in jump state, when the input is pressed it would destroy the player sprite and replace with Jumpkick game object.. then set up another circumstance to destroy jumpkick and replace with Player game object when jump is done...

I can reason through that, but cannot write the assembly code script to do it myself quite yet...

Mainly I just wanted to explain how it is possible, and how you would need to set it up before any scripts are written to perform the task...
 

WillElm

New member
There exists a thread on swapping out objects. I put the code from that thread in a tile and it works great. When I was testing it, I had it bound to a button press, it was easy to do. With the right settings, I bet it would work great as an attack state.

I'm considering using it to make a backdash that's faster than the player normally is. It seems like the easiest way to accomplish such a thing, because as far as I can tell, the player's speed isn't variable in game, or at least it's not easily accessed.

the thread: http://nesmakers.com/viewtopic.php?f=3&t=1760&hilit=switch+object
Code:
;; Change the players selected ability variable
    LDA plrState
    CMP #$01 ; The maximum ability value - equal to the number of abilities
    BCC notLastState
    JMP LastState

    notLastState:
    LDA plrState
    CLC
    ADC #$01
    STA plrState
    JMP stateFinishedChanging
    
    LastState:
    LDA #$00
    STA plrState
    JMP stateFinishedChanging
    
    
    

stateFinishedChanging:



;; change character to OBJ_PLAYER_XTRA
switchPlayerXTRA
    LDX player1_object
    LDA Object_x_hi,x
    STA newX
    LDA Object_y_hi,x
    STA newY
    DeactivateCurrentObject
    
    LDA playerToSpawn
    BEQ goSwitchingPlayerXTRA   
    ;; put back tehe initial player object
    LDA #$00
    JMP continueSwitchingPlayerXTRA
goSwitchingPlayerXTRA:
    ;; we use another one :
    LDA #OBJ_PLAYER_XTRA
continueSwitchingPlayerXTRA:
    STA playerToSpawn
    CreateObject newX, newY, playerToSpawn, #$00, currentNametable
    TXA
    STA player1_object
    
    ;PlaySound #SND_TRANSFORM
    ChangeTileAtCollision #$00, #GOT_AMMO
    RTS
 

dale_coop

Moderator
Staff member
The player speed is not variable... but the speed of an object is variable... of course (inertia, etc)... you can code a dash attack with scripts like that one: http://nesmakers.com/viewtopic.php?p=5456#p5456
 
Top Bottom