Jump to content
  • Advertisement
Sign in to follow this  
zabo

enemie spawning problems! (blitz3d)

This topic is 3889 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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?)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!