Closed DanielBullimore closed 4 years ago
so far I came up with a hybrid method:
"draw the world" places the canvases.
events redefine the canvases properties.
the whole world redraws at frame rate.
use mouse move, window clicks and key presses to feed the OoMuntiny event reactor. generate the interrupts based on the rectors events game loop draws the world every 'benchmarked milliseconds' and processes interrupts in between
interrupts should/could be denominated as cycles, each cycle being a fraction or sum of 'benchmarked milliseconds'
the equivalent of O telling o "make an appointment for any time of day so long as its 10, 20, 30, 40, 50, past the hour or bang on the hour. never at 13 past the hour nor 22 past".
I'm really racking my mind about handling HID events. Specifically in regards to click events in relationship with GUI objects. Obviously each object can be rendered within its own canvas element which will have its own native html/JS onclick event. However should those triggered events be handled by the object's class internally or should they be fed into the game loop as interrupts?
Using the native browser event triggers is a no brainer. Even if just catching them as window.onclick etc. and parsing those events to derive the source canvas element via event.target. Animations could be drawn instantly and in smaller parts (just the targets objects canvas).
Alternately use window.onclick and make the whole interface one canvas element. Then processing point-click-region programmatically to determine which drawing has pointer focus would have the same outcome. But which is better for the user. The later would enter the 'frame rate' zone of gaming engines, the engine would derive one picture from the state of all objects in view and redraw it every x milliseconds . The former would be event driven animation.
However any computing that takes place out of the game loop could effect the user experience. Because the main goal of OO Mutiny is to provide a non html/DOM user interface.
One big Canvas or one canvas per object? All OoMutiny events handled as interrupts or a forked event+interrupt?
Discus...