enemie spawning problems! (blitz3d)

Started by
14 comments, last by zabo 16 years, 5 months ago
heres a peice of code----> While Not Keyhit(1) If score#=100 then Dim alien(150) b = 1 to 150 alien(b)=LoadMesh("alien.b3d") PositionEntity alien(b),Rnd(-100,100),100,Rnd(300,1000) score#=score#+1 Next EndIf I originally thought that it would stop creating aliens if it added 1 to the score but instead it creates thousands! how can i make it so it only creates 150 aliens instead of looping hundreds of times creating a huge number of aliens? (p.s. it doesnt create an unlimited amount of aliens just alot maybe cuz i continue to shoot em adding points) how do i solve this problem?
Advertisement
c'mon i need help!
Make it so that as soon as the enemy is created you add 1 to b . Otherwise b will stay at 1 and you create an infinite loop.
-------------------------------------------------my forum LINK: here
Quote:Original post by bobwrit
Make it so that as soon as the enemy is created you add 1 to b . Otherwise b will stay at 1 and you create an infinite loop.


so instead of
score#=score#+1 replace it with
b+1?
so simple! (p.s. how do i create a check point /savepoint or save option for my game?)


b = b +1

..
Quote:Original post by zabo
Quote:Original post by bobwrit
Make it so that as soon as the enemy is created you add 1 to b . Otherwise b will stay at 1 and you create an infinite loop.


so instead of
score#=score#+1 replace it with
b+1?

Keep
score#=score#+1
in there but add b=b+1 in the loop.
-------------------------------------------------my forum LINK: here
oh hey thanks!
Your welcome.
-------------------------------------------------my forum LINK: here
triple post
-------------------------------------------------my forum LINK: here
triple post
-------------------------------------------------my forum LINK: here

This topic is closed to new replies.

Advertisement