Project-Rekt / engine

Game Engine - Currently on version MASON
https://project-rekt.github.io/engine/index.html
Apache License 2.0
1 stars 3 forks source link

Create Stage Class #4

Closed Squishy123 closed 4 years ago

Squishy123 commented 4 years ago

Define the class structure for Stage objects

Stage

The parent of actor object. Manages render/update ticks as wells as provides methods fo actors to get references to other actors(collision detections/radius searches)

Functions

Painting Order

Actors should be stored in a map of lists corresponding to paint order: E.G. {-10: [actorA, actorB], 0: [actorC, actorD], 100: [actorE]} When calling renderCycles, the order of paint should be followed(where smaller order gets painted first)

Render/Update Loops

Use window.requestAnimationFrame to start loops on callbacks Use window.cancelAnimationFrame to stop loops on callbacks

Collision/Search Methods

TODO: Complete after quadtree implementation is complete