From bf18f79e779c7acf9dd0cde34fe29b3db1d030a7 Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Sat, 9 Jul 2022 23:35:02 +0000 Subject: [PATCH] Create Overview --- Overview.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Overview.md diff --git a/Overview.md b/Overview.md new file mode 100644 index 0000000..95c9f38 --- /dev/null +++ b/Overview.md @@ -0,0 +1,45 @@ +Singe uses the [Lua programming language](http://www.lua.org/) for scripting game logic. Lua is fast, lightweight, object-oriented, easy to use, and actually used in the games industry. A tutorial in Lua is beyond the scope of this document. Many excellent tutorials exist on the web and YouTube. + +Singe uses an event-driven programming model. What this means is that Singe controls the main "program loop" and is in charge of the order of program execution. Singe automatically handles all the details of decoding and presenting video and audio. It manages controllers, mice, and keyboard input. When Singe needs something game-specific, it calls part of your script. + +The most basic Singe script that provides all the existing "callbacks" used by Singe looks like this: + +```lua +-- Singe Game Skeleton + +-- Load the Singe Framework +dofile("Singe/Framework.singe") + +-- Declare any global variables you need here. + +function onControllerMoved(axis, value, which) +end + +function onInputPressed(what) +end + +function onInputReleased(what) +end + +function onKeyPressed(key, scancode) +end + +function onKeyReleased(key, scancode) +end + +function onMouseMoved(x, y, xr, yr, which) +end + +function onOverlayUpdate() +end + +function onShutdown() +end + +function onSoundCompleted(channel) +end + +-- Note: There is no "onStartup" event. +-- Any startup code you need can be placed here. + +``` \ No newline at end of file