How do i move along enemies with the background? It is a vertical scrolling game. have the randomization down, however, im not sure how to make them scroll vertically with the background? help please:)
The code I used for my background is below if it helps at all.
when gf clicked forever set x to <[0]> switch to costume <(terrain#)> set y to <(scrollY)> + <[360]> * <(terrain#)> - <[1]> end
Offline
You need to have two variables for every enemy, and then easily use this script:
when gf clicked set [enemyY v] to [it's position on the y axis] forever set x to <(x position) + (pick random (2) to (-2))> //so that the enemy's move randomly across the x axis set y to (((360)*(terrain you want it to start from)) - (enemyY)) change [enemyY v] by [however much you want] endWhat that does, is it gets the starting amount (360*terrain12), and then it gets the offset (enemyY), and it adds/subtracts the offset to it. Depending on how you want the Y axis to work, you may have to change the subtraction to addition.
Offline