-
Notifications
You must be signed in to change notification settings - Fork 0
/
resources.lua
162 lines (132 loc) · 3.06 KB
/
resources.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
--
-- resources.lua
-- global variables and the like
-- sizes
WINDOW_W = 1024
WINDOW_H = 640
TILE_W = 64
TILE_H = 64
-- colors
black = {0,0,0}
white = {255,255,255}
red = {100,0,0}
aqua = {0,204,204}
-- collision management
HC = require 'hardoncollider'
-- Collider = HC(64)
-- pretty text
lib = require 'tastytext.tastytext'
-- animations
require("AnAL")
-- fonts
fonts = {
fippsXL = love.graphics.newFont('data/fonts/Fipps-Regular.otf', 48),
fippsL = love.graphics.newFont('data/fonts/Fipps-Regular.otf', 40),
fippsM = love.graphics.newFont('data/fonts/Fipps-Regular.otf', 32),
fippsS = love.graphics.newFont('data/fonts/Fipps-Regular.otf', 24),
fippsXS = love.graphics.newFont('data/fonts/Fipps-Regular.otf', 16),
emuS = love.graphics.newFont('data/fonts/emulogic.ttf', 24),
emuXS = love.graphics.newFont('data/fonts/emulogic.ttf', 16)
}
--
-- entity info
blocks = {}
blocks[1] = {
name = 'solid',
description = 'a basic solid, invisible platform.',
health = 0,
image = nil,
step_x = 0,
range = 0,
width = TILE_W,
height = TILE_H,
offset = { x = 0, y = 0 }
}
blocks[2] = {
name = 'moving',
description = 'a platform the moves in the x direction.',
health = 0,
image = nil,
step_x = 0,
range = 0,
width = TILE_W,
height = TILE_H,
offset = { x = 0, y = 0 }
}
blocks[3] = {
name = 'spikes',
description = 'warning. lowers health.',
health = -1,
image = nil,
step_x = 0,
range = 0,
width = TILE_W,
height = TILE_H,
offset = { x = 0, y = 0 }
}
items = {}
items[1] = {
name = 'solo cup',
description = 'a red solo cup. increases health.',
action = 'pass',
health = 1,
image = love.graphics.newImage('/data/images/cup.png'),
width = 22,
height = 30,
offset = { x = 21, y = 31 }
}
items[2] = {
name = 'broken glass',
description = 'broken glass. beware.',
action = 'danger',
health = -1,
image = love.graphics.newImage('/data/images/glass.png'),
width = TILE_W,
height = 21,
offset = { x = 0, y = 43 }
}
enemies = {}
enemies[1] = {
name = 'wart',
description = 'a walking purple wart.',
health = -1,
image = love.graphics.newImage('data/images/wart1L.png'),
step_x = 3,
range = 100,
width = 39,
height = 48,
offset = { x = 5, y = 15 },
cycleImages = {
love.graphics.newImage('data/images/wart1L.png'),
love.graphics.newImage('data/images/wart2L.png'),
love.graphics.newImage('data/images/wart3L.png'),
love.graphics.newImage('data/images/wart1R.png'),
love.graphics.newImage('data/images/wart2R.png'),
love.graphics.newImage('data/images/wart3R.png')
}
}
friends = {}
friends[1] = {
name = 'ron',
description = 'the sausage king.',
image = love.graphics.newImage('data/images/ron.png'),
dialogue = {
"Hello, my name is Ron.",
"I am a sausage."
},
width = 52,
height = 126,
offset = { x = 4, y = 2 }
}
--
-- useful functions
function centerAlignPos(text, x_offset, y_offset)
pos_x = WINDOW_W/2 - text:getWidth()/2 + x_offset
pos_y = WINDOW_H/2 - text:getHeight()/2 + y_offset
return pos_x, pos_y
end
function leftAlignPos(text, x_offset, y_offset)
pos_x = 50 + x_offset
pos_y = 30 + y_offset
return pos_x, pos_y
end