Create Overview
parent
cce66bfe6a
commit
bf18f79e77
1 changed files with 45 additions and 0 deletions
45
Overview.md
Normal file
45
Overview.md
Normal file
|
@ -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.
|
||||
|
||||
```
|
Loading…
Add table
Reference in a new issue