I want to know are there some good ways to implements a actors manager which manager bullets/enemy/leading actor for a classic shooter game?
It help to create the bullets for example then destroy it when it shoot the enemy or run out of bound, the same rule for enemy/leading actors when it died. This days i have learn orx in detail, it's all clock driven for all game logic, right? if so, how about using object's callback for this target? or are there good point about this feature. (Sorry for my pool English)
Comments
For a classic shooter, I'd use a simple wave manager for spawning (either combining timelines and spawners or using your own logic code if those are not adapted).
As for handling damage, the physics contact event is perfect for that. For objets going out of bound, you can also use a physics event or simply set a lifetime on your objects that would dispose of them after a certain time.
Lastly I'd really recommend looking into Scroll, a C++ wrapper written on top of orx, as it helps a lot with object management (such as direct C++ class/config section binding) and also include a small but functional level editor.
Using Scroll, you can handle a lot of object-oriented events directly from C++ virtual method (OnNewAnim, OnCollision, etc...).
Faistoiplaisir started a forum thread a while ago on this topic.
There are also other threads related to Scroll.
Acksys wrote a couple of first tutorials about Scroll.
You can look at a couple of game jam entries I wrote in the past, all using orx+Scroll, the code might be slightly outdated but the logic should still be valid:
- Mushroom Stew
- Breaktris
I always use Scroll myself for my own projects.
I used the codelite project to compile on linux. That being said, orx and scroll have much changed since and Mushroom Stew might need some small fixes in order to compile with recent versions.
Everything is exposed/explained in the links in my first answer. Faistoiplaisir tries to explains all the advantages in his forum post as well.
I can show you the Scroll stub I currently use for my own projects if that's what you want.