Quantcast
Channel: Active questions tagged game-maker - Stack Overflow
Viewing all articles
Browse latest Browse all 189

How do I flip my player sprite without having it jump farther than where it needs to be?

$
0
0

I am trying to make an open-world RPG game. I just started it, and I have the player moving and the animations changing between the idle animation and the walking animation. However I just recently coded the flipping of the player on the x-axis, which does work but with one caveat. The player flips just a little bit too far. as if to mimic a long jump. How do I keep the player in the same position after flipping?

I have tried changing the player's scaling. Changing the speed of the player. I have even tried some of the recommended code on the internet which did some wacky things. I can't find anybody else that has this problem.

var move = keyboard_check(vk_right) - keyboard_check(vk_left);if (move < 0){  sprite_index = spr_char_walking;  image_xscale = -7;  image_yscale = 7;// flips the sprite when moving the other way}else if(move > 0){    sprite_index = spr_char_walking;    image_xscale = 7;    image_yscale = 7;}else{  sprite_index = spr_char_idle;}

Viewing all articles
Browse latest Browse all 189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>