How do i move_wrap like in Towerfall Ascension?

M

_mAv_

Guest
I just started studying GM, and i am testing move_wrap.
It is pretty cool and neat, to be able to wrap with a single function, but i am trying to understand how to achieve a result more similar to what you can see in Towerfall Ascension.
By that i mean, that my object will not be disappear and then teleport on the other side, but instead, been able to be displayed half on the left side, and half on the right side for example.

Thank you so much in advance, and forgive me for the newbie question!
 

samspade

Member
I think you'll need to override the draw event and then make two calls to draw_sprite_part to draw half of the sprite on one side of the screen and half on the other.
Basically yes, but you don't need draw sprite part. Although that would work it is more math. You can just do a normal draw sprite offset by the appropriate distance as the part of the sprite that isn't in view isn't going to be drawn anyways.

One important note is that you won't actually 'be' on both sides which may or may not matter. Actually being on both sides is more complicated as you would need duplicate objects.
 

NightFrost

Member
Actually being on both sides is more complicated as you would need duplicate objects.
To expand that, this is because an instance can have only one collision mask, and that is located wherever the x and y coordinates are. If you need to use collision commands, you need multiple instances.
 
Top