Elkabo: Dev log. Collision using DS_Grids instead of collision boxes

Today we will talk a little about a simple collision method that works well with dungeon generators as we start to rebuild the roguelike engine to be compatible with the new generator. Additionally you may find this games kickstarter HERE. 


To sum it up we are taking the players xy location and dividing it by the tile size to get the xy GRID number. This will usually return non whole numbers so we apply a floor to it to round down. We then take those numbers and check against the DS_GRID for a collision block (‘b’)

  1. var tempx=floor(argument[0]/24);
  2. var tempy=floor(argument[1]/24);
  3. var collision=0;



  4. if(string(obj_gamecont.collisionmap[# tempx,tempy])==’b’){
  5. collision=1


  6. }
  7. return(collision)

Leave a Reply