sofor.blogg.se

How to make an undertale sprite
How to make an undertale sprite











how to make an undertale sprite how to make an undertale sprite

My explanation feels a bit weak, so sorry if this doesn't help it make any more sense. Step 2 (possible sprite change) always runs before step 3 (arrowInput update), meaning that for a single step, there exists a case where a key is pressed BUT arrowInput is false when checking to update the sprite, because we perform the update after checking to update the sprite.

  • When a direction key is pressed, set arrowInput to true otherwise, set arrowInput to false.
  • When a direction key is pressed, if arrowInput is false, change the sprite.
  • At creation, arrowInput is set to false.
  • The code I shared already has arrowInput in the correct placement, I said what I said mainly to caution against putting arrowInput at the beginning of the step, which would result in incorrect behavior. Thanks!Ĭlick to expand.The code I gave you is a working example, you just need to expand it to suit all 4 of your directions. This also applies to pressing down/up key first and the right/left key second.Īny help would be greatly appreciated. Your player's sprite does not change, but your player moves diagonally across the screen. You then continue holding the right key and press the down key. Your player's sprite mapped to the right key animates. you press the right key and your player starts moving right. IE: You boot up Undertale and your player loads. If you press another key that would make your character move diagonally, the sprite from the first key press stays the same. In Undertale the first key you press displays the sprite connected to that key. I would like my player to be able to move like frisk in Undertale. If you press the down or up key followed by the left or right arrow key, the sprite will not change to the right or left sprite, but stay on the up or down sprite. If you continue holding the right arrow key(or left) and press the down or up arrow key my player's sprite changes to his up or down sprite. My issue is that if you press the right arrow key (or left) my player goes right (or left). This pattern for input continues through the three other arrow keys. I am using a very simple system to move in my player's step event. I was recently playing around with objects and getting a character to simply move when I came across an issue. I am fairly new to GameMaker, so if you wouldn't mind simplifying things, that would be awesome! Please let me know if I need to explain this better.













    How to make an undertale sprite