i need help on collisions!

  • kanaduh
  • Student
  • Student
  • User avatar
  • Posts: 86

Post 3+ Months Ago

how do i make a boarder where my ball that you can move with the arrows cant go thru? i've seen it before i just forget where :(
shanx
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

What you are looking for is called hitTest()...

http://www.kirupa.com/developer/actions ... ittest.htm
  • kanaduh
  • Student
  • Student
  • User avatar
  • Posts: 86

Post 3+ Months Ago

but i need it so that when the space ship hits the wall it CANNOT go thru.
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

and?

Code: [ Select ]
if(ship.hitTest(wall)){
  //put code here to stop _x and/or _y motion
}
  1. if(ship.hitTest(wall)){
  2.   //put code here to stop _x and/or _y motion
  3. }
  • kanaduh
  • Student
  • Student
  • User avatar
  • Posts: 86

Post 3+ Months Ago

k...im not very smart with these types of things....is there any way you could give me the code please please please?!
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Well I can't guarantee just giving you code, since you don't learn anything that way... and if you are going to making games or whatever, you are going to need to learn hitTesting... it's a vital part of gaming.

But post what code you are currently using for the motion and i'll try and give you some tips on what i think should work.
  • kanaduh
  • Student
  • Student
  • User avatar
  • Posts: 86

Post 3+ Months Ago

wut do you mean code for the motion...i have one code so far
its to make the space ship move
is that what you mean?

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 28 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.