I am working on simple 3D version of Snake game. I created classes like snake
and grid
so far. My concern is, putting all render logic (draws cubes - to show snake, and lines to show the grid) in above class could obscure the "pure" logic which should be divided from "view" layer.
So my question is, how to handle the whole render layer, separately from entity objects?
My current idea is to add object of "renderer" to each class which will encapsulate whole canvas work inside. There will be also master-renderer
always looking for renderer inside all entities.
PS. I use JavaScript and Three.js