int screen; // this is a hardcoded image handle for the screen int systemtime; // read-only timer variable constantly increasing int timer; // read/write timer variable int key[scancode]; // read/write key-state array int lastpressed; // read/write scancode of last pressed key int lastkey; // read/write last key pressed in ASCII int window.active; // read-only, whether or not the game window in focus.To elaborate:
screen - Is a pointer to a bitmap of the screen's current dimensions (set in v3.cfg or by SetResolution() function at runtime). Anything you want to appear in ther verge window should be blitted here with one of the graphics functions. When ShowPage() is called the screen bitmap is transfered to the display.
systemtime - A read-only timer that stores the time elapsed since your program began, in centiseconds. Not to be confused with the time stored on your system clock. If you want to know what the current time settings are on a computer, see the Date/Time variables instead.
timer - A number than increases by 100 every second and very useful for anything you need to happen within a set timeframe. As you can re-set this value whenever you like, it's also possible to use it to work out how long ago something happened.
key[scancode] - Stores whether a key IS CURRENTLY PRESSED - so if the key was down the last time ShowPage() or UpdateControls() was called. If you want to use is like a HAS BEEN PRESSED state, you'll need to reset the value back to 0 each time manually. Unlike standard ASCII methods key['a'] will not work - verge has its own defines, look at the Scan Codes section to see them.
lastpressed - Stores the verge scancode of the last keyboard key the player pressed. See Scan Codes.
lastkey - Same as above, but stores proper ASCII, so 'a' = 97 = little a
window.active - Used to tell if the Verge game window is in focus or if the user minimized/alt-tabbed out of it for a second. Useful for stuff like pausing gameplay while inactive to go easier on the CPU.
b1, b2, b3, b4, up, down, left, right - General control variables for playing games in Verge. The directional buttons are self-explanatory. By default, b1 is the Enter key, b2 is the Alt key (either will do), b3 is Escape key, and b4 is the Space key. These buttons can be remapped using SetButtonKey(). Unlike the key scan codes, these buttons are also usable by joysticks and game controllers.