Jump to content


Photo

Making "TrafficJam"


  • Please log in to reply
1 reply to this topic

#1 cng

cng

    Young Padawan

  • Members
  • Pip
  • 55 posts

Posted 18 May 2005 - 05:59 PM

If you havent played the game TrafficJam, it is a puzzle game where u need to move cars around a restricted space and the cars only go one direction in order to get a selected car out of the "parking lot". I need to know how to use the hit test and basic coding to:

- make sure the cars cannot go out of a selected area (I have created lines and put them in a movie clip).
- the cars cannot "overlap" each other (using hit test, if true you cant move the car...)
so it looks something like this (on a directional button):

on (press) {
if (_root.car 1, hittest (_root.car 2)) {
-need code to do nothing-
}
else if {
(_root.car 1, hittest (_root.car 3)) {
-need code to do nothing-
}

etc.... then...

else {
with (_root.car 1) {
-need code to move car (direction) x pixel/space or whatever the unit needs to be-
}


As you can tell, I know nothing about coding and this is possibly all wrong and impossible so if anyone can, please help me fix up the code. With this code I drafted up I am only trying to give an impression of what I want to do. Any questions regarding what I want, please feel free to ask me. Thank you.

#2 cng

cng

    Young Padawan

  • Members
  • Pip
  • 55 posts

Posted 19 May 2005 - 12:43 AM

Maybe to simple this I can use just one universal code but I dont know how to do this:

Using hit test, MovieClip1 cannot equal/touch MovieClip2. Then can I put this code on a frame?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users