Random Spawn Actors

BluSpyderBluSpyder Member Posts: 129
edited November -1 in Working with GS (Mac)
I'm creating a game sort of like Traffic Rush, for iPhone. The game involves getting the actors that are aligned on a grid to reach the other side safely without colliding with other actors. There's a few things I can't figure out how to do at this moment and was hoping someone get point me in the right direction...

1. How do I randomly spawn actors to move across the grid. For example: In Traffic Rush it will randomly spawn cars to move across, whether its the same car or two different cars, horizontally or vertically, left or right side. How can I set a randomizer in GameSalad to spawn actors randomly? What I tried was creating an actor for each horizontal and vertical side, and each for either starting from left side or right side, Then I created a timer for every 3 seconds to change attribute to random number between 1 and 2. Then if it chose 1, then the actor would respawn there, if 2, then it wouldn't. It sort of works, but I was wondering if someone knows a better or more efficient way?

2. Also like in Traffic Rush, you can swipe the car to make them speed across, and you can tap them to stop. Issues I'm having here is I don't see how swipe can work in GameSalad, can anyone help me on that? And also I know how to make the actor stop when touch is pressed, but how do I set so that when it is pressed again to have the actor moving again?

I would really appreciate some comments and advice.

Comments

Sign In or Register to comment.