Help Needed with Hit Test script

  • DooMZ81
  • Newbie
  • Newbie
  • DooMZ81
  • Posts: 9
  • Loc: SIngapore

Post 3+ Months Ago

I am a student currently designing a mouse maze game by using flash 5

I have done the following

*Mouse movement script by using the direction key
*Maze map with wall

Problem lies here. I need a action script that can stop my mouse frm passing through the wall.What kind of collistion script do i need?Please help me solve my problem :(
  • 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

There is a function called hitTest(), you can use it to detect when 1 clip touches another clip and it returns a boolean value of false or true. So you can use an if statement to check the hitTest() and if it is true you can tell the clip to stop moving.

http://www.macromedia.com/support/flash ... ry534.html
  • DooMZ81
  • Newbie
  • Newbie
  • DooMZ81
  • Posts: 9
  • Loc: SIngapore

Post 3+ Months Ago

I have tat hit test script,it can dectect the mouse hitting the wall but it wont stop the mouse from passing through,i have run through tutorial about collision, hit test.. etc

Help is needed.^_^Il|
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Ah crap, that's right hitTest(target) goes by bounding box not shapeFlag (meaning the method in my head now == null).

I have seen this done before, but to be completely honest I completely suck at game programming in Flash. The only method that I can think of now is storing the walkable paths in an array, but as you can imagine... eek.
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Ok, I found out where I had seen the storing the map in the array thing, which I may say this site is VERY useful for game designers....

http://oos.moxiecode.com/

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 16 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.