2022-01-19 15:13:13 +00:00
|
|
|
function GameStep()
|
2022-02-08 07:22:27 +00:00
|
|
|
SetCollisionFlags()
|
2022-02-03 04:31:25 +00:00
|
|
|
if menu_type == "no" then
|
2022-01-19 23:53:59 +00:00
|
|
|
for _, particle in pairs(LoadedParticles) do
|
|
|
|
particle:Smart()
|
|
|
|
end
|
2022-02-10 17:18:37 +00:00
|
|
|
for _, enty in pairs(LoadedObjects.Entities) do
|
2022-01-18 12:53:58 +00:00
|
|
|
enty:Smart()
|
|
|
|
end
|
|
|
|
end
|
2022-01-30 10:31:18 +00:00
|
|
|
|
2022-02-03 05:02:06 +00:00
|
|
|
for _, particle in pairs(LoadedParticles) do
|
|
|
|
particle:DoPhysics()
|
|
|
|
end
|
2022-02-10 17:18:37 +00:00
|
|
|
for _, enty in pairs(LoadedObjects.Entities) do
|
2022-02-03 05:02:06 +00:00
|
|
|
enty:DoPhysics()
|
|
|
|
end
|
2022-02-05 11:32:47 +00:00
|
|
|
|
2022-02-03 05:02:06 +00:00
|
|
|
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)
|
|
|
|
|
2022-02-12 19:03:48 +00:00
|
|
|
if Keybind:CheckPressed(Keybind.debug.debug) then
|
2022-01-30 10:31:18 +00:00
|
|
|
if debug then
|
|
|
|
debug = false
|
|
|
|
debug_collision = true
|
|
|
|
elseif debug_collision then
|
|
|
|
debug_collision = false
|
|
|
|
else
|
|
|
|
debug = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-02-12 19:03:48 +00:00
|
|
|
if Keybind:CheckPressed(Keybind.debug.reposition) then
|
2022-01-30 10:31:18 +00:00
|
|
|
if not editor_mode then
|
|
|
|
main_Player.pos.x, main_Player.pos.y = 16,-10
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-02-12 19:03:48 +00:00
|
|
|
if Keybind:CheckPressed(Keybind.debug.reload) then
|
2022-02-03 04:31:25 +00:00
|
|
|
MenuClear()
|
|
|
|
menu_type = "dialog"
|
|
|
|
MenuInit("dialog",DialogSequence.Example)
|
2022-01-30 10:31:18 +00:00
|
|
|
end
|
|
|
|
|
2022-02-12 19:03:48 +00:00
|
|
|
if Keybind:CheckPressed(Keybind.debug.editor) then
|
2022-01-30 10:31:18 +00:00
|
|
|
editor_mode = true
|
|
|
|
end
|
2022-01-18 12:53:58 +00:00
|
|
|
end
|
|
|
|
|
2022-01-19 15:13:13 +00:00
|
|
|
function GameDraw()
|
2022-01-18 12:53:58 +00:00
|
|
|
|
2022-01-22 22:10:21 +00:00
|
|
|
GameworldDrawPrepare()
|
2022-01-29 07:49:45 +00:00
|
|
|
GameworldDrawBackground()
|
2022-02-07 08:24:41 +00:00
|
|
|
GameworldDrawForeground()
|
2022-02-10 14:53:50 +00:00
|
|
|
if LevelData.properties.darkness then
|
|
|
|
GameworldDrawLighting()
|
|
|
|
end
|
2022-02-07 08:24:41 +00:00
|
|
|
GameworldDrawParticles()
|
2022-01-22 22:10:21 +00:00
|
|
|
GameworldDrawEntities()
|
|
|
|
GameworldDrawEnd()
|
2022-01-18 12:53:58 +00:00
|
|
|
|
2022-01-19 20:57:45 +00:00
|
|
|
-- hud
|
2022-01-18 12:53:58 +00:00
|
|
|
textScale = 0.5
|
|
|
|
|
2022-01-19 20:57:45 +00:00
|
|
|
-- debug
|
|
|
|
if debug then DebugUI() end
|
|
|
|
if debug_collision then
|
|
|
|
DebugColisions()
|
|
|
|
DebugEntities()
|
|
|
|
end
|
2022-01-18 12:53:58 +00:00
|
|
|
end
|