-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
66 lines (49 loc) · 1.33 KB
/
main.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
local imageManager = require 'imageManager'
local fontManager = require 'fontManager'
local sceneManager = require 'gameSceneManager'
local inputManager = require 'gameInputManager'
local gameScene = require 'gameScene'
local hexgamecomponent = require 'hexgamecomponent'
local hexgameboard = require 'hexgameboard'
require 'camera'
require 'loadSpriteSheets'
local previousTile
function love.load()
math.randomseed(os.time())
local board = hexgameboard:new(18, 23, 9)
for tile in board._map:tiles() do
if not tile.disabled then
tile.filled = true
tile.color = { 20, 20, 100, 255 }
end
end
board._map:radialTiles(18, 23, 2,
function(tile)
tile.filled = false
end)
local tile = board._map:tile(18,23)
tile.filled = true
tile.color = { 0, 255, 0, 255 }
tile.goal = true
local hgc = hexgamecomponent:new(board)
hgc:hexagonScale(35,25)
hgc:setHexScreenMapping(18, 23, 380, 220)
hgc._drawOrder = 0
local gs = gameScene:new()
gs._orderedDraw = true
--gs._showCollisionBoxes = true
local c = camera:new()
gameScene:camera(c)
gs:addComponent(hgc)
hgc:loadSpells()
sceneManager.removeScene('hexagons')
sceneManager.addScene('hexagons', gs)
sceneManager.switch('hexagons')
end
function love.draw()
sceneManager.draw()
end
function love.update(dt)
inputManager.update()
sceneManager.update(dt)
end