• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

(SOLVED) DnD Object wraps around room slower on left than on right? Need help!

H

HanNic3197

Guest
Hello! I'm very new to Gamemaker and programming so I need any help I can get ^.^

I have a ball that I want to wrap around horizontally when it starts to go off screen. I have it so that when the ball intersects the boundary with a margin of 0.001 it wraps to opposite side of the screen with the same hspeed. The right side works correctly, but if the ball is coming from the left it disappears, then reappears 200 pixels from the right boundary.

Video here:
http://tinypic.com/r/29dzl03/9

Code:

 

TsukaYuriko

☄️
Forum Staff
Moderator
Check the origin of the ball's sprite. Depending on how the wrapping registers whether something is outside of the room, that may lead to wraps happening sooner or later. Try centering the origin.
 
H

HanNic3197

Guest
Check the origin of the ball's sprite. Depending on how the wrapping registers whether something is outside of the room, that may lead to wraps happening sooner or later. Try centering the origin.
Perfect! That worked! Thank you!!
 
Top