1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

How do i move_wrap like in Towerfall Ascension?

Discussion in 'Programming' started by _mAv_, Mar 29, 2019.

  1. _mAv_

    _mAv_ Member

    Jan 4, 2017
    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!
  2. Guitarmike

    Guitarmike Member

    Jun 30, 2018
    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.
  3. samspade

    samspade Member

    Feb 26, 2017
    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.
  4. NightFrost

    NightFrost Member

    Jun 24, 2016
    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.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice