-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
88 lines (50 loc) · 1.4 KB
/
main.lua
File metadata and controls
88 lines (50 loc) · 1.4 KB
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
79
80
81
82
83
84
85
86
87
88
---IMPORT STUFF
require("sprite")
require("TIC80api/input/key")
require("TIC80api/input/mouse")
require("TIC80api/primitives/primitives2D")
require("TIC80api/TIC80Timer")
require("TIC80api/map/mget")
require("TIC80api/map/mset")
require("TIC80api/cls")
require("TIC80api/output/TIC80Print")
require("map")
require("TIC")
require("scale window")
ScaleWindow() -- this function is used in scale window.lua
-- LOAD --
function love.load()
LoadSpr()
Map()
end
-- DRAW --
function love.draw()
push:start() --push modifies the scaler-- you don't need to remove it.
--draw map
--main draw
TICDraw()
push:finish() --push modifies the scaler -- you don't need to remove it.
end
-- UPDATE --
function love.update(dt)
updateTime(dt) -- to emulate time() source is TIC80Timer.lua
TIC()
end
----------------------
function DrawMap(x,y)
for rowIndex = 1,#mapTable do
local row = mapTable[rowIndex]
for columnIndex = 1, #row do
local num = row[columnIndex]
if num>0 then
local posx = (columnIndex-1)*tileW
local posy = (rowIndex-1)*tileH
love.graphics.draw(tileset,Quad[num],posx+x,posy+y)
end
end
end
end
-----------------------
---- IF Additional keyp logic required... ----
function love.keypressed(k,scancode,isRepeat)
end