-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
55 lines (41 loc) · 1.18 KB
/
main.lua
File metadata and controls
55 lines (41 loc) · 1.18 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
_W = display.contentWidth
_H = display.contentHeight
local loadSave = require("loadsave")
local composer = require("composer")
isHTML5 = system.getInfo("platform") == "html5"
if isHTML5 then
local windowResizer = require("windowResizer")
windowResizer:new()
end
rnd = math.random
lvl = 1
isDebug = false
numLvls = 21
function keyPressed(event)
if event.phase == "up" and event.keyName == "tab" then
if native.getProperty("windowMode") == "fullscreen" then
native.setProperty("windowMode", "normal")
else
native.setProperty( "windowMode", "fullscreen" )
end
end
end
Runtime:addEventListener("key", keyPressed)
saveData = loadSave.loadTable("scores.json")
if saveData == nil then
saveData = {
locked = {
false, true, true, true, true, true, true, -- 1
true, true, true, true, true, true, true, -- 2
true, true, true, true, true, true, true, -- 3
},
}
-- print("highScores" .. highScores['hard'][1])
-- print("highScores" .. highScores.hard[1])
loadSave.saveTable(saveData, "scores.json")
end
print("saveData.locked:")
for i = 1, #saveData.locked do
print('saveData.locked[' .. i .. "] = " .. tostring(saveData.locked[i]))
end
composer.gotoScene( "splash" )