-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathloadgraphics.lua
75 lines (59 loc) · 2.15 KB
/
loadgraphics.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
images = {}
images[STONE] = {}
for i = 1, 16 do
images[STONE][i] = love.graphics.newImage("gfx/tiles/stone" .. i .. ".png")
images[STONE][i]:setFilter("linear", "nearest")
end
grassFlat = love.graphics.newImage("gfx/tiles/grassFlat.png")
grassSingle = love.graphics.newImage("gfx/tiles/grassSingle.png")
grassLeft = love.graphics.newImage("gfx/tiles/grassLeft.png")
grassRight = love.graphics.newImage("gfx/tiles/grassRight.png")
images[GRASS] = {}
for i = 1, 16 do
images[GRASS][i] = grassFlat
images[GRASS][i]:setFilter("linear", "nearest")
end
images[GRASS][1] = grassSingle
images[GRASS][3] = grassLeft
images[GRASS][5] = grassSingle
images[GRASS][7] = grassLeft
images[GRASS][9] = grassRight
images[GRASS][13] = grassRight
images[DIRT] = {}
for i = 1, 16 do
images[DIRT][i] = love.graphics.newImage("gfx/tiles/dirt" .. i .. ".png")
images[DIRT][i]:setFilter("linear", "nearest")
end
images[COBBLESTONE] = {}
for i = 1, 16 do
images[COBBLESTONE][i] = love.graphics.newImage("gfx/tiles/cobblestone" .. i .. ".png")
images[COBBLESTONE][i]:setFilter("linear", "nearest")
end
images[COAL_ORE] = {}
images[COAL_ORE][1] = love.graphics.newImage("gfx/tiles/coalOre.png")
for i = 2, 16 do
images[COAL_ORE][i] = images[COAL_ORE][1]
images[COAL_ORE][i]:setFilter("linear", "nearest")
end
images[WOOD] = {}
for i = 1, 16 do
images[WOOD][i] = love.graphics.newImage("gfx/tiles/wood" .. i .. ".png")
images[WOOD][i]:setFilter("linear", "nearest")
end
images[LEAVES] = {}
for i = 1, 16 do
images[LEAVES][i] = love.graphics.newImage("gfx/tiles/leaves" .. i .. ".png")
images[LEAVES][i]:setFilter("linear", "nearest")
end
images[WOOD_SHOVEL] = love.graphics.newImage("gfx/items/woodShovel.png")
breakImage = {}
for i = 1, 8 do
breakImage[i] = love.graphics.newImage("gfx/tiles/break" .. i .. ".png")
breakImage[i]:setFilter("linear", "nearest")
end
genChunk = love.graphics.newImage("gfx/genChunk.png")
genChunk:setFilter("linear", "nearest")
sky = love.graphics.newImage("gfx/sky.png")
hotbar = love.graphics.newImage("gfx/hotbar.png")
inventoryGraphic = love.graphics.newImage("gfx/inventory.png")
highlight = love.graphics.newImage("gfx/highlight.png")