JeremyLeland / SectorC37

A top-down space shooting game
0 stars 0 forks source link

Investigate alternatives for adding bullets/particles #7

Closed JeremyLeland closed 3 years ago

JeremyLeland commented 3 years ago

Currently, we pass a Level object to every Actor so it can call Level.addParticle and Level.addBullet. Is there a better way to do this?

JeremyLeland commented 3 years ago

Maybe have all Actors keep a local list of particles/actors generated, and the level retrieves them every update cycle?

JeremyLeland commented 3 years ago

If we no longer give actors a link to the level, we’ll need to pass them lists of nearby entities somehow. Maybe on update?

maybe this is what makes actors different than entities — they get called with a list of nearby objects, so they can take actions based on them?

JeremyLeland commented 3 years ago

Should have been fixed by comment (guess I need separate fix statements for each issue)