1. Hey! Guest! The 33rd GMC Jam will take place between May 23rd, 12:00 UTC (Friday noon) and May 27th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

GMS 2 Tile collision with a depth system

Discussion in 'Programming' started by zampa, May 17, 2019 at 3:07 PM.

  1. zampa

    zampa Member

    Joined:
    Jul 9, 2017
    Posts:
    66
    I am working on a top-down game and i am using both tile and object collision now i wanted to add a depth system i watched some videos online and i think i get how it works. (FriendlyCosmonaut's video)


    But now if i want to use that depth system every top and bottom walls would need to be objects and not tiles (see example), i feel that could get confusing but if that is the only way to do it and be efficient i' ll suffer through it, should i switch to using only wall objects, or use left and right tiles walls and bottom and top object walls?

    example of waht i mean

    room example:
    t = tiles
    o = object

    tooooooooooooooooo...
    t
    t
    t
    t
    toooooooooooooooo...
     
  2. zATARA_0

    zATARA_0 Member

    Joined:
    Apr 10, 2019
    Posts:
    7
    You could have the tiles just be superficial and have all the collisions or whatnot handled by wall objects. You could also set the different tiles to different tile layers and use what layer its on to tell what it does. For example tiles in layer 1 are background, layer 2 is walls you cant pass through, layer 3 is pits you fall through. If you do this I would recommend using macros or enums to keep track of what each layer does. Tiles are more efficent than having a ton of objects, but are more of a hassel to implement. If your maps are small and not to complicated then objects are fine but if they are really big then I would suggest going with just tiles.
     

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