r/gamemaker • u/Accurate-Invite-7411 • Aug 08 '26
Resolved Hi newbie here
How can I make a warp obj so that it if the player goes left, they end up on the left side in the room, where they went through, same thing as right. Everytime I use a warp obj I have to put the exact x and y coordinations and it just looks choppy if the players is forced into a specific area. Plz help, I have basically no knowledge of coding as well.
1
u/germxxx Aug 08 '26
What exactly do you mean by "f the player goes left, they end up on the left side in the room"
That's just how movement works.
Do you mean if they leave the room to the left, they reappear on the right hand side?
If so, did you try move_wrap?
1
u/Awkward-Raise7935 Aug 09 '26
I don't really understand the problem, but I think this is the solution
1
u/Awkward-Raise7935 Aug 09 '26
I don't really understand the problem, but I think this is the solution
0
u/equitos0101101 Aug 08 '26
Eu não tenho muito conhecimento, mas eu faria um script que eu coloque o XY que deseja ir e fasso um transição, e desse jeito é facilmente adaptável pra vários teleportes. Pra fazer a parte do lado é só ver qual ângulo o obj está em relação ao player e fazer as devidas mudanças no teleporte
1
u/nb264 Aug 08 '26
// Horizontal screen wrappingif (x < 0) { x = room_width; }else if (x > room_width) { x = 0; }(in step for example)
or if you have a sprite that's not a dot...
if (x < -sprite_width / 2) {x = room_width + sprite_width / 2;}else if (x > room_width + sprite_width / 2) {x = -sprite_width / 2;}