Thread: Collision in Tile Studio

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    14

    Collision in Tile Studio

    Hi, i have tryed Tile Studio.
    I made a map there for my rpg game, kinda large map in tile studio.
    And i succeded to import it to OpenGL.

    And now to the Question:
    * How do i check the Collision ( if the playerX,Y hits a wall, or a stone. etc.)
    i can do like this,
    if(playerX < 2 ) // to check collision

    But that would take extreamly long time if i have a big map, with stones and other things on.

    So i hope that there is a faster and better way to check collision with/in Tile Studio.


    please help me out.

    //ty in advace

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Does tile studio store any other meta information which might tell you that "this is a wall" other than say looking at the RBG values of the pixels?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    14
    I actually dont know.. dont know where to look.

    it say here something about "whenever an object passes a bound, a collision occurs". (on the Tile Studio homepage)
    but dont know if that means "collision detection".

    http://tilestudio.sourceforge.net/tu...ndsAndMapCodes
    Last edited by kaptenkraek; 04-04-2008 at 11:47 AM.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    That link talks about bounds, read about them.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Aug 2007
    Posts
    14
    hum.. if i get this right, about those bounds. when i load my map, then it also loads those bounds, if i have made some of them. Then you can check if an Object (player) hits them, and then do something.
    (so you could check collision with them ?)
    Or, am i wrong ?

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Part of the data you import, you pass to OpenGL (this you've done).
    Another part of the data you import for collision detection, which you've yet to do.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM