So, currently I'm designing a shooter game where you are fixed in the center of the field and you rotate to shoot at enemies. I want the enemies to appear from the edges of the screen and move towards the center, but I can't figure out how to make the enemy go to a random position on the edges of the screen.
Can anyone tell me how to do that?
Here's what my current script for the enemy is:
when gf clicked hide go to x: (pick random (-240) to (240)) y: ( ? )Sorry if my question is confusing. Usually when I have questions like this, I think of them partly with words and partly with pictures, so it's hard to explain them fully in text.
Last edited by Zangooser (2012-08-14 18:33:54)
Offline
Hmm...that IS hard...'course, I'm probably overcomplicating things.
Offline
beyblade4 wrote:
I don't get it? Do you want them to appear from the left and right edges, from any edge, or what?
Any edge on the bottom, top, or side. They're all going to be going the same place (the middle), but I don't want them to all come from the same place, or else the player will eventually figure it out and will know where to aim each time.
Offline
Zangooser wrote:
beyblade4 wrote:
I don't get it? Do you want them to appear from the left and right edges, from any edge, or what?
Any edge on the bottom, top, or side. They're all going to be going the same place (the middle), but I don't want them to all come from the same place, or else the player will eventually figure it out and will know where to aim each time.
Okay, I am a really good programmer (but not an expert yet), I will first have to do some experiments and get back to you on that, I have the idea but I need to test it out!
Offline
Or, without variables:
when I receive [go to edge v] if<(pick random (0) to (1)) = (0)> go to x:(((pick random (0) to (1))*(480))-(240)) y:(pick random (-180) to (180)) else go to x:(pick random (-180) to (180)) y:(((pick random (0) to (1))*(360))-(180)) end
Offline