Hi,
This is a gameplay mechanic topic. Tilengine itself is a graphics engine, no a full game engine, so it doesn't provide direct support for things like actors or game entities. This is something you must provide in your game code. However, this is a basic approach:
Define your basic game entity -the "actor"-. It can be a hierarchy of classes or a simple structure, whatever you decide. It depends on type of game being designed, but typical properties are:
Have a list of active actors. This list is empty at the beginnig.
At each frame, search list of spawn points and find which one(s) is candidate for spawn:
https://github.com/megamarc/TilenginePythonPlatformer
Let me know
This is a gameplay mechanic topic. Tilengine itself is a graphics engine, no a full game engine, so it doesn't provide direct support for things like actors or game entities. This is something you must provide in your game code. However, this is a basic approach:
Define your basic game entity -the "actor"-. It can be a hierarchy of classes or a simple structure, whatever you decide. It depends on type of game being designed, but typical properties are:
- type
- position
- speed/direction vector
- life/health
- state
- assigned sprite(s)
Have a list of active actors. This list is empty at the beginnig.
At each frame, search list of spawn points and find which one(s) is candidate for spawn:
- it is near the edge of the screen you're moving too
- it's not already in the "active actors" list.
- create an actor instance of the type, initialize and assign required sprite(s)
- add the instance to your list of active actors.
https://github.com/megamarc/TilenginePythonPlatformer
Let me know