プレイ日記
☆CodeZeяo☆ Code-Zero-666
I need help.. How would I make a bunch of random enemies at once? I really need help.
4そうだね
プレイ済み
返信[1]
親投稿
ЩMr.Mo14 mr.mo14
Make a function for the enemy, then make an array of x's and y's. do this then: for I=1 to enenum enemy x[I],y[I] next
0そうだね
プレイ済み
返信[2]
親投稿
PChicken NerdChicken
elaborate on "enemies".
0そうだね
プレイ済み
返信[3]
親投稿
Aaron Krondelo
Well you enemies have to be assigned to variables, so just use rnd in the range of those enemies and do it a set number of times(how many enemies you want)
0そうだね
プレイ済み
返信[4]
親投稿
Stewart segludian
I totally got carried away. I was gonna make a small bit of code to show how to initialize your enemies and wound up making a mini game. Too long to post the code but it should be fairly easy to follow and show an example of what you are looking for. I opted to use spvar instead of parallel arrays but it isn't really all that different either way. Anyway, the key is 5K4KNPA6 assuming I uploaded ok
2そうだね
プレイ済み
返信[5]
親投稿
Stewart segludian
In your code, you shouldn't be looping over random numbers between 0 and 9999 in a double nested loop. instead x should be a random number between 0 and screen width, and y a random number between 0 and screen height. you only need one loop between 0 and 19 where you initialize each enemy as you go. Hope that makes sense. My demo key above has a function that does about what you are looking for.
0そうだね
プレイ済み
返信[6]
親投稿
Ricardo Caffeine305
@Stewart Interesting, will check your code ASAP.
0そうだね
プレイ済み
返信[7]
親投稿
☆CodeZeяo☆ Code-Zero-666
THANK YOU GUYS!!!! <3 <3 Helped me a lot :)
1そうだね
プレイ済み
返信[8]
親投稿
ЩMr.Mo14 mr.mo14
Actually, I suck at smilebasic, That is just part of what I learned at khanacademy.com's computer programming/computer science course. lol! Glad I could help!
0そうだね
プレイ済み