73 lines
1.5 KiB
Lua
73 lines
1.5 KiB
Lua
|
function GameStep()
|
||
|
SetCollisionFlags()
|
||
|
if menu_type == "no" then
|
||
|
for _, particle in pairs(LoadedParticles) do
|
||
|
particle:Smart()
|
||
|
end
|
||
|
for _, enty in pairs(LoadedObjects.Entities) do
|
||
|
enty:Smart()
|
||
|
end
|
||
|
end
|
||
|
|
||
|
for _, particle in pairs(LoadedParticles) do
|
||
|
particle:DoPhysics()
|
||
|
end
|
||
|
for _, enty in pairs(LoadedObjects.Entities) do
|
||
|
enty:DoPhysics()
|
||
|
end
|
||
|
|
||
|
AnimateTiles()
|
||
|
Camera:positionCenterAt(main_Player.pos.x, main_Player.pos.y)
|
||
|
--camera:positionAt(main_Player.pos.x, main_Player.pos.y,game.width,game.height)
|
||
|
|
||
|
if Keybind:HasPressed(Keybind.debug.debug) then
|
||
|
if debug then
|
||
|
debug = false
|
||
|
debug_collision = true
|
||
|
elseif debug_collision then
|
||
|
debug_collision = false
|
||
|
else
|
||
|
debug = true
|
||
|
end
|
||
|
end
|
||
|
|
||
|
if Keybind:HasPressed(Keybind.debug.reposition) then
|
||
|
if not editor_mode then
|
||
|
main_Player.pos.x, main_Player.pos.y = 16,-10
|
||
|
end
|
||
|
end
|
||
|
|
||
|
if Keybind:HasPressed(Keybind.debug.reload) then
|
||
|
MenuClear()
|
||
|
menu_type = "dialog"
|
||
|
MenuInit("dialog",DialogSequence.Example)
|
||
|
end
|
||
|
|
||
|
if Keybind:HasPressed(Keybind.debug.editor) then
|
||
|
editor_mode = true
|
||
|
end
|
||
|
end
|
||
|
|
||
|
function GameDraw()
|
||
|
|
||
|
GameworldDrawPrepare()
|
||
|
GameworldDrawBackground()
|
||
|
GameworldDrawForeground()
|
||
|
if LevelData.properties.darkness then
|
||
|
GameworldDrawLighting()
|
||
|
end
|
||
|
GameworldDrawParticles()
|
||
|
GameworldDrawEntities()
|
||
|
GameworldDrawEnd()
|
||
|
|
||
|
-- hud
|
||
|
textScale = 0.5
|
||
|
|
||
|
-- debug
|
||
|
if debug then DebugUI() end
|
||
|
if debug_collision then
|
||
|
DebugColisions()
|
||
|
DebugEntities()
|
||
|
end
|
||
|
end
|