'moveto' go faster over time
evert
Member Posts: 266
hi all,
I need my actors spawning faster progressively.
My actors are moving from the right to the left.
Here is how they spawn, now they need to go faster progressively.
Thanks
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Comments
The random function produces an integer value . . . so 0.5 will give you 0
If you want a 'real' value you can just throw a little maths at it.
So for random(0.5,5) you could use random(50,500)/100
Also, once the timer has set its random value, it will always produce that random value, so a timer that says Every 1 second change XXX to random(0.5,1) will either give you a 0 every second (with no change are timer progresses) or a 1 every second (with no change are timer progresses) - the random value once set will not change.
Here is how I would do it . . .
Demo: https://www.mediafire.com/?5os0ff2hflml497
(you may have to add .gameproj onto the end of the file name if it won't open for you)
@socks Yes i've got what you mean!
But i think i asked my question wrong.
They spawning on itself is good and the way it spawns to, but it needs to go faster over time, now there is a random spawning system so you got something like this:
-- _ _ -_ - --- __ - (random) but its more the speed from right to left that needs to go faster. See it like flappy bird, you got the bars heading from right to left. They need to go faster over time but the way they are positioned is random.
So i've got random positioning now, and the way they move from right to the left must go faster over time. you showed me a faster spawning. (also thanks)
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Hi all,
I had a question over here but i asked it wrong (http://forums.gamesalad.com/discussion/74555/speeding-up-spawning-progressively)
So i'll start again.
i have a 'move to' for one of my spawning objects. Its goes from the right to the left at a speed of 65.
Now lets say i want the first 5 objects to spawn (random) on the right and move to the left at a speed of 65. (this i've got)
But what the problem is, that if i want to spawn the next 5 objects and move them at a speed of 65 i need to find a way to add +25 speed to those 5 objects. So the first 5 at 65, the second 5 at 65+25= 90 speed. and so on...
I tried an integer+25 with a timer, but what happens then is that the object spawns at 0speed and ads 25 speed every 2 sec to that same object. This is not what i'm looking for.
Thanks
Move to on object/actor:
Spawning trigger:
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Here you go: https://www.mediafire.com/?95dbdkqguav2op0
To speed up actors over time, create a real attribute called game.actorSpeed and set it to a value such as 10. In each actor, set the Move behavior speed to game.actorSpeed. Then use a timer that changes game.actorSpeed:
Every 5 seconds
Change Attribute game.actorSpeed to game.actorSpeed*1.5
For example, if you set game.actorSpeed (real attribute) to 10, then every 5 seconds it will increase by 50%: 10, 15, 22.5, 33.75. Or you could just add a constant to the speed every so many seconds.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I've merged your two threads. We prefer to keep everything related to one question in a single thread.
You could try adding an integer game attribute called game.spawnCount and add one to it each time an actor is spawned. Then in the spawned actor, Change Attribute self.speed to 65+(ceil(game.spawnCount/5)-1)*25. And use self.speed as the MoveTo speed.
Note: The ceil() math function rounds up to the nearest whole number. So when game.spawnCount is 1, that entire expression will return 65+(1-1) * 25=65. When game.spawnCount is 6, that expression will return 65+(2-1) * 25=90. When game.spawnCount is 11, that expression will return 65+(3-1) * 25=115, etc. By the way, you can test out math expressions in Spotlight in OS X. Just type something like "65+(ceil(11/5)-1) * 25" without the quotes and then substitute any number you like for 11.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
yes! fixed it! thanks guys!
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909