I know this has probably been asked a lot before, but what is a script for making enemies randomly generate? Same for items, but I assume they can use the same script. Thanks!
Offline
It depends. Could you specify what you mean by "randomly generate"? Thanks!
Offline
We need to know the context of your problem. I don't know how to solve it right now, but I recommend using these blocks - (item (any) of (list) ) and (pick random () to () )
Last edited by Wes64 (2012-06-28 22:06:36)
Offline
If you mean spawn them randomly, that will be possible in Scratch 2.0.
Offline
I mean spawn them in random places on a map. It's a RPG I'm making, so could there be a way to make enemies appear at a random location on a map when you enter?
Offline
Gemini8910 wrote:
I mean spawn them in random places on a map. It's a RPG I'm making, so could there be a way to make enemies appear at a random location on a map when you enter?
Is the RPG top-down or side-scrolling?
Offline
Top down.
Offline
Just have it set x to a random number from -240 to 240, set y to a random number from -180 to 180, and then have it show.
Offline
Uhh... how exactly do I do that? o_O Sorry this is my first RPG, I've never had to use that before. >_<
Offline
Gemini8910 wrote:
Uhh... how exactly do I do that? o_O Sorry this is my first RPG, I've never had to use that before. >_<
Just use the "set x to __" and "set y to __" blocks from the motion tab but instead of putting numbers in them, use the "pick random __ to __" with those parameters. Now does it make sense?
Sorry, I would show you with scratchblocks but I can't figure out how do make what I want.
Offline
Ah ok. I figured out the set x to but couldn't figure out the random number part. But I found it. I tested it on my health items and it works! Now to make some enemies. Thanks!
Offline
for further clarification:
go to x: (pick random (-240) to (240)) y: (pick random (-180) to (180))
Offline