-
Notifications
You must be signed in to change notification settings - Fork 0
/
class_game.lua
79 lines (72 loc) · 1.53 KB
/
class_game.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
print("include: GGE_Game")
GGE_Game = class()
--[[
-- Classe que representa o jogo
--
-- @author Cantidio Oliveira Fontes
-- @since 30/09/2010
-- @version 21/10/2010
-]]
function GGE_Game:new()
GGE_game_log("GGE_Game:new()")
local self = {}
self.mName = ""
self.mVersion = "0.0"
self.debugWindow = true -- não sei o que fazer com isso ainda. kkkk
self.mVideo = {
width = 320,
height = 240,
FPS = 60,
fullScreen = false,
}
self.mWindow = {
logo = "",
title = "",
}
GGE_game_log("GGE_Game:~new()")
--[[
--Método para iniciar o vídeo do engine
--
-- @author Cantidio Oliveira Fontes
-- @since 29/09/2010
-- @version 29/09/2010
-]]
function self:init()
GGE_game_log("GGE_Game():init()")
if not GGE_game_setFPS(self.mVideo.FPS) or
not GGE_game_setGameName(self.mName) or
not GGE_game_setGameVersion(self.mVersion) or
not GGE_game_init( --inicia o vídeo, o input e o audio*
self.mWindow.title,
self.mVideo.width,
self.mVideo.height,
self.mVideo.fullScreen
) then
return false
end
GGE_game_log("GGE_Game():~init()")
return true
end
--[[
-- Método chamado a cada iteraćão do jogo
--
-- @author Cantidio Oliveira Fontes
-- @since 01/10/2010
-- @version 01/10/2010
-]]
function self:logic()
self:state()
end
function self:state() end
return self
end
--[[
-- Funcão para executar um passo da lógica do game
--
-- @author Cantidio Oliveira Fontes
-- @since 30/09/2010
-- @version 20/10/2010
-]]
function GGE_game_runStep()
this:logic()
end