GMS 2 getting stuck in the walls while rotating (Ellipse collision)

Discussion in 'Programming' started by fireday2, Aug 23, 2019.

  1. fireday2

    fireday2 Member

    Jun 17, 2017
    good day everyone!
    QIP Shot - Screen 013.png
    what we have:
    1) sprite has size 115-115
    the center is 57-57 (first pixel has 0-0, last 114-114)
    2) Collision mask have `Ellipse (slow)` (in our case it's circle)
    and boarding by 20 pixels from center (we get 37-77)
    QIP Shot - Screen 014.png
    3) movement system use separating move for x and y (by using twice time `instance_place`)

    All work great - we can move even when we will meet wall in one direction

    But if we start to rotate ... Then troubles come
    we start to stuck in walls (but not always, look at gif and try project)
    but why? we have precise center and collision ellipse's center in same point!
    i have only one idea - gms2 don't calculate `Ellipse (slow)` by math but pixel collisions. Is that it?
    how to solve issue ?

    GIF (showing the issue):
    Project (special for test, there are only necessary):
  2. the_dude_abides

    the_dude_abides Member

    Jun 23, 2016
    fireday2 likes this.
  3. FrostyCat

    FrostyCat Member

    Jun 26, 2016
    I would just use another variable to control the rotation and draw that with draw_sprite_ext(). That way the mask can't rotate into a wall because it isn't actually rotating at all, only the presentation to the player is rotating.
    fireday2 likes this.

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