Problem: write a quadtree implementation for collision detection (rect & circle)
- spawn lots of entities in the world with varying sizes. when an entity bump into another, takes 1 damage. each entity has 5 health, when they die, spawn another entity in a random position within the tree.
- make a UI to give the player the ability to control the number of entities.
- possibility to activate debug rendering for quadtree. -try to create as small garbage as possible.
optional/bonus:
- polish the feeling of the simulation. create particles on collisions, tween the spawning of entities, destroying, etc.
- polish the player UI controls. add feedback to buttons.
Solution:
Reference:
● https://www.integu.net/visitor-pattern/ ● https://refactoring.guru/design-patterns/visitor ● https://medium.com/@ErkanYasun/factory-pattern-with-generics-f73432921f99