Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Controlling and testing player direction

I know how to change the basic direction of the player, but how do I change the frame that is being used?

I.e. player frame = 2nd row 3rd column.

Also, how do I test for this (though I guess that would be pretty self explanatory)?
 
I believe, once the direction is set, find the player (which would be $game_player, but this can also be used for events), and use the following code:
Code:
$game_player.pattern = 1
As I see, you can change the pattern from 1-4 or something like that. By the look of this snippet in Game_Character 2:
Code:
@pattern = (@pattern + 1) % 4
It should be based on the 4x4 character set layout. Not sure if this works, but it's the only possible solution I could find.

To check if it is in a certain pattern, just use the same code without the operation of course. Pretty obvious.

Hope this works out for ya.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top