Jump to content


Photo

solved


  • Please log in to reply
1 reply to this topic

#1 BGameMaker

BGameMaker

    GMC Member

  • GMC Member
  • 276 posts

Posted 03 April 2011 - 12:02 AM

I have an object, it is following another object.

Is it possible to check if the next position it will move is collision free? :huh:

(I am assuming this would be in terms of direction?)

Edited by BGameMaker, 03 April 2011 - 12:10 AM.

  • 0

#2 GloryAndBen

GloryAndBen

    Game Programmer

  • GMC Member
  • 943 posts

Posted 04 April 2011 - 01:21 AM

I'm not sure, but since nothing is executed simultaneously in programming (unless you start playing about with multithreading, but let's not go there) you could just check at the start of the procedure to see if there currently IS a collision, and if so, go back to the previous position. The end result will be like it never moved, because you'll catch it before the new and invalid position has a chance to interact.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users