const term = require('term');const kb = Keyboard.Default;var current_key;function game() { threads.create({ update: function() { current_key = kb.getKey(); return true; } );}
Ideally the console should be stealing input focus from the rest of the game, but I don't have any way of implementing that right now.
Otherwise the game would have to implement a key queue itself and typing would feel totally different from other applications.
Edit: also Dispatch.onRender draws over the terminal as well.
Or do what some other games do and have it completely pause execution aside from the terminal. That's what I was going for when I made my own terminal (which I've since lost) and I never had any issues with it, unless you entered in bad JavaScript code, since it was designed to directly handle code.
I thought most APIs/frameworks use events like SDL_PollEvent/SDL_KEYDOWN/SDL_KEYUP, JavaScript DOM events, etc. That was what I had in mind here.
while (true) { while (true) { while (true) { FlipScreen(); } }}
Which miniSphere version? The console has infinite priority so it should always render last. I know I did fix a bug related to incorrect Dispatch order in 4.6, maybe that's what you're encountering:https://github.com/fatcerberus/minisphere/commit/f88b4aa96f975d4c11030abf2e02071f25adf7d0
Low level engine question:- if you instruct miniSphere to draw a shape to the screen of which a large portion will be off the edge of the screen and just part of it on screen what happens?- does it waste effort processing all the parts that aren't on screen? (I assume yes and hence to optimise one should try and only draw what's actually on screen in one's javascript) but don't want to waste effort arranging that if the graphics system automatically clips the excess.
Have you had a chance to look into the framerate issue where a limited framerate results in a drop from 50 FPS to 30 or the like?
Quote from: Rhuan on July 16, 2017, 02:43:13 pmHave you had a chance to look into the framerate issue where a limited framerate results in a drop from 50 FPS to 30 or the like?I know why it happens, I'm just not sure how to fix it yet.See: https://github.com/fatcerberus/minisphere/issues/188