Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualAliii

Posted 07 November 2012 - 09:31 AM

An idea:
You allocate the array
Bullets **bullets= new Bullets*[200]

Then you make 2 lists:
list<Bullets*> dead_bullets, alive_bullets

....first all bullets(pointers) are in the dead_bullets and when a bullet is needed you put it into the alive_bullets and remove it from dead_bullets.

edit:
of course you fill the array first:)
for(...)
bullets[i]= new Bullet()

#1Aliii

Posted 07 November 2012 - 09:28 AM

An idea:
You allocate the array
Bullets **bullets= new Bullets*[200]

Then you make 2 lists:
list<Bullets*> dead_bullets, alive_bullets

....first all bullets(pointers) are in the dead_bullets and when a bullet is needed you put it into the alive_bullets and remove it from dead_bullets.

PARTNERS