"Traffic Rush" like Game
I have working on this game for 6 months now, and just CANNOT complete it. Every time I fix something, another bug is there making the game not work.
If you do not know what "Traffic Rush" is, it's a game where you are looking at a intersection of a street at a birds-eye-view. There are cars and trucks that randomly appear from each side (north, south, east, west) and you must get them through the intersection without them colliding with other cars crossing. In traffic rush, the game progressiveness gets harder as more cars and trucks spawn faster. The point of the game is to get as many cars/trucks successfully to the other side, endlessly.
I have created a similar game (Of course with many differences and addition to not be a copy cat) BUT I CANNOT get this to work in GameSalad. I will list all my problems, and hope some can answer some.
1. Swiping and Stopping. I have watched a tutorial on swiping on the iPhone for GameSalad. So I got it to work, KIND OF. The swipe doesn't work individually though, I can only get it to swipe the whole row. Ex. Say you wanted to swipe the car in traffic rush, well in my game if you swipe, all the cars in that row speed up, not just the one you swiped. It does that because the swiping is on it's own actor and is placed on the row, so that when it receives a swipe, the actors that spawn on that row register it and speed up. MY PROBLEM is obviously i want it more individual. I couldn't figure out how to set an individual swipe on each actor. ALSO sometimes it will bug out and not allow the touch to stop register, they will just keep going.
2. Spawn and Stop. I was having issues spawning different actors and random ones till I figured it out. But I had to put in a code where when an actor is stopped on a row and another actor comes up behind it and hits it, it MUST interpolate back a few pixels. Why? Because if you swipe them (with what i have set above) after they have collided (so they are basically stopped and touching side to side) they will both speed up (like above) and if you stop the one in the front, the one that is literally right behind the front actor will go straight through the front one, ignoring the rule of stopping when there is an actor in front. I had to make 3 of the same actors for each actor I had, so that I could put those rules in, because 1 or 2 i couldnt get to work. I have on some that record their position to a variable, so then they can compare when they collide (if collide happens, and A's position x is greater than B's position x- move back 2 pixels) MY PROBLEM is..well i hate this. I think this code is causing some of my stop and go codes to glitch, and making the swipe as well glitchy.
AND- for some reason, say there are 3 actors spawned in the same row, and you stop the front one. Letting the second one collide with the first and the both stop. For some reason the third one will stop as well at the same time, even though it hasn't collided with anything.
3. Spawn Rates. What would be the best way integrating spawn speeds. I have a spawner on each side spawning the actors, and have them set on timers and random numbers to spawn on. But I can't seem to get a good flow of spawn. Sometimes the spawning will be jumbled and to crunched, and sometimes you will wait a minute till one even spawns.
4. Swipe direction. Lastly, I have the swipe left to right, right to left, up to down, down to up. But is there any way to do DIAGONAL swiping? Bottom right to Top left?
I understand some of this seems confusing. But i think you play Traffic Rush or know it, you'll understand what I am talking about a little better.
I really hope someone can help me out. Thanks
If you do not know what "Traffic Rush" is, it's a game where you are looking at a intersection of a street at a birds-eye-view. There are cars and trucks that randomly appear from each side (north, south, east, west) and you must get them through the intersection without them colliding with other cars crossing. In traffic rush, the game progressiveness gets harder as more cars and trucks spawn faster. The point of the game is to get as many cars/trucks successfully to the other side, endlessly.
I have created a similar game (Of course with many differences and addition to not be a copy cat) BUT I CANNOT get this to work in GameSalad. I will list all my problems, and hope some can answer some.
1. Swiping and Stopping. I have watched a tutorial on swiping on the iPhone for GameSalad. So I got it to work, KIND OF. The swipe doesn't work individually though, I can only get it to swipe the whole row. Ex. Say you wanted to swipe the car in traffic rush, well in my game if you swipe, all the cars in that row speed up, not just the one you swiped. It does that because the swiping is on it's own actor and is placed on the row, so that when it receives a swipe, the actors that spawn on that row register it and speed up. MY PROBLEM is obviously i want it more individual. I couldn't figure out how to set an individual swipe on each actor. ALSO sometimes it will bug out and not allow the touch to stop register, they will just keep going.
2. Spawn and Stop. I was having issues spawning different actors and random ones till I figured it out. But I had to put in a code where when an actor is stopped on a row and another actor comes up behind it and hits it, it MUST interpolate back a few pixels. Why? Because if you swipe them (with what i have set above) after they have collided (so they are basically stopped and touching side to side) they will both speed up (like above) and if you stop the one in the front, the one that is literally right behind the front actor will go straight through the front one, ignoring the rule of stopping when there is an actor in front. I had to make 3 of the same actors for each actor I had, so that I could put those rules in, because 1 or 2 i couldnt get to work. I have on some that record their position to a variable, so then they can compare when they collide (if collide happens, and A's position x is greater than B's position x- move back 2 pixels) MY PROBLEM is..well i hate this. I think this code is causing some of my stop and go codes to glitch, and making the swipe as well glitchy.
AND- for some reason, say there are 3 actors spawned in the same row, and you stop the front one. Letting the second one collide with the first and the both stop. For some reason the third one will stop as well at the same time, even though it hasn't collided with anything.
3. Spawn Rates. What would be the best way integrating spawn speeds. I have a spawner on each side spawning the actors, and have them set on timers and random numbers to spawn on. But I can't seem to get a good flow of spawn. Sometimes the spawning will be jumbled and to crunched, and sometimes you will wait a minute till one even spawns.
4. Swipe direction. Lastly, I have the swipe left to right, right to left, up to down, down to up. But is there any way to do DIAGONAL swiping? Bottom right to Top left?
I understand some of this seems confusing. But i think you play Traffic Rush or know it, you'll understand what I am talking about a little better.
I really hope someone can help me out. Thanks
Comments
Put the swiping actor in each individual street lane, do you have it occupying that entire area of lanes or just one lane?
I have an idea for you:
Couldn't you just spawn the swiping actors and constrain them to the car actors? Individual swiping actors for each individual car would work.
___________________________________________________________________________
I'm teaching an online programing course go here to find out more!!! http://gamesalad.com/forums/topic.php?id=31505