-
Notifications
You must be signed in to change notification settings - Fork 0
/
draw.lua
20 lines (20 loc) · 1.17 KB
/
draw.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
direction = 'up'
map_horizontal = 0
map_vertical = 0
function love.draw()
for i = 0, 5 do
for j = 0, 5 do
love.graphics.draw(background, -2000 + i * background:getWidth() + map_horizontal, -2000 + j * background:getHeight() + map_vertical)
end
end
-- Theres probably a better way to do this, but it doesn't seem to affect performance/memory usage
if direction == 'up' then
love.graphics.draw(bug_up, love.graphics.getWidth()/2, love.graphics.getHeight()/2, rotation, 0.2, 0.2, bug_up:getWidth()/2, bug_up:getHeight()/2)
elseif direction == 'down' then
love.graphics.draw(bug_down, love.graphics.getWidth()/2, love.graphics.getHeight()/2, rotation, 0.2, 0.2, bug_down:getWidth()/2, bug_down:getHeight()/2)
elseif direction == 'left' then
love.graphics.draw(bug_left, love.graphics.getWidth()/2, love.graphics.getHeight()/2, rotation, 0.2, 0.2, bug_left:getWidth()/2, bug_left:getHeight()/2)
elseif direction == 'right' then
love.graphics.draw(bug_right, love.graphics.getWidth()/2, love.graphics.getHeight()/2, rotation, 0.2, 0.2, bug_right:getWidth()/2, bug_right:getHeight()/2)
end
end