-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap1.lua
More file actions
61 lines (56 loc) · 1.8 KB
/
Copy pathmap1.lua
File metadata and controls
61 lines (56 loc) · 1.8 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
-- Define the map layout
local map = {
{ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0 },
{ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
}
function map.draw()
-- Map Matrix
love.graphics.setColor(0, 0.5, 0)
for y = 1, #map do
for x = 1, #map[y] do
if map[y][x] == 1 then
-- Draw path tile
love.graphics.rectangle("line", (x - 1) * 50, (y - 1) * 50, 50, 50)
else
-- Draw empty space
love.graphics.rectangle("fill", (x - 1) * 50, (y - 1) * 50, 50, 50)
end
end
end
-- Start
love.graphics.setColor(1, 1, 1)
love.graphics.print("", 110, 15)
love.graphics.print("End", 663, 575)
end
map.enemyPath = {
{ 125, -40 },
{ 125, 75 },
{ 475, 75 },
{ 475, 225 },
{ 325, 225 },
{ 325, 325 },
{ 225, 325 },
{ 225, 475 },
{ 525, 475 },
{ 525, 325 },
{ 675, 325 },
{ 675, 640 },
}
map.spawnEnemies = function(num, wait, hp)
World.timerHandler:new(wait, function()
World.enemyHandler:new(map.enemyPath[1][1], map.enemyPath[1][2], hp)
end, num)
end
return map