after the introduction of the compatibility thing i also changed the sprite i use to a paper mario one, still need to cut out the bg but it seems to be working, next up is checking if mouse clicks on that spot

This commit is contained in:
2018-08-31 02:50:34 +02:00
4 changed files with 377 additions and 41 deletions

View File

@@ -16,6 +16,7 @@ snake = {
frames = 0,
hgrid = 20,
vgrid = 11,
screen = "bottom",
bgCol = {
r = 0,
g = 0,
@@ -56,7 +57,7 @@ function snakeplayer:hardreset()
self.x = 10
self.y = 10
self.blocks = {}
love.graphics.setScreen("top")
love.graphics.setScreen(snake.screen)
self.w = love.graphics.getWidth()/snake.hgrid
end
@@ -114,11 +115,10 @@ function snakeplayer:update(dt)
end
function snakeplayer:draw()
love.graphics.setScreen('top')
love.graphics.setScreen(snake.screen)
love.graphics.setColor(snake.bgCol.r, snake.bgCol.g, snake.bgCol.b)
love.graphics.rectangle("fill", 0, 0, love.graphics.getWidth(), love.graphics.getHeight())
love.graphics.setColor(0,255,0)
temp = 0
for i in ipairs(self.blocks) do
love.graphics.rectangle(self.mode, self.blocks[i].x*self.w, self.blocks[i].y*self.w, self.w, self.w)
end