The Daily Click ::. Forums ::. Klik Coding Help ::. Random number to select movement path won't work?
 

Post Reply  Post Oekaki 
 

Posted By Message

GrayFox



Registered
  09/10/2008
Points
  6
16th October, 2008 at 08:28:58 -

I have two tanks. One tank is controlled by path movement with two different possible movements. The other tank is controlled by me. I have a random number set to a counter when they collide (and they stop for the collision). There are 2 events set for movement based on the value of the counter. If the counter is less than or equal to 5, then Movement #1 is used. If the counter is greater than or equal to 6, then movement #2 is used. I also tried alterable values instead of a counter, but it doesn't seem to make a difference. The tank just moves across the screen and leaves at the beginning.... even though I also have an event set for it to reverse if it leaves! What the heck is going on here? Is this not possible for some reason?

Image Edited by the Author.

 
http://www.gamersforums.net/

GrayFox



Registered
  09/10/2008
Points
  6
19th October, 2008 at 09:17:10 -

Hmm.... I guess I figured it out. I created a group of events called "select path" for the orange tank. But sometimes at the start, the enemy tank will drive over me or push me, but it doesn't leave the play area forever. And.... If I block the other tank too close to the edge of the play area, then it starts moving back and forth even after my tank moves away. How can I get the tank to move away from the edge of the screen, no matter which part of the screen it leaves from? Do I have to make a different event for each side of the screen? (thinking about using behaviors for that instead) Also, if I continue pushing my tank into the other one, then I can actually drive under it... and sometimes force the enemy tank to leave the area, even though it shouldn't do that. How do I make that impossible?

Image Edited by the Author.

 
http://www.gamersforums.net/
   

Post Reply



 



Advertisement

Worth A Click