mirror of
https://github.com/bvanroll/3dsStuff.git
synced 2025-08-29 11:52:42 +00:00
everything i originally planned on works now, this is officially 1.0, gonna merge it with main and the next plan is to create a lives system instead of a score system
This commit is contained in:
@@ -16,7 +16,8 @@ snake = {
|
||||
frames = 0,
|
||||
hgrid = 20,
|
||||
vgrid = 11,
|
||||
screen = "bottom",
|
||||
screen = "top",
|
||||
score = 0,
|
||||
bgCol = {
|
||||
r = 0,
|
||||
g = 0,
|
||||
@@ -59,6 +60,7 @@ function snakeplayer:hardreset()
|
||||
self.blocks = {}
|
||||
love.graphics.setScreen(snake.screen)
|
||||
self.w = love.graphics.getWidth()/snake.hgrid
|
||||
snake.score = 0
|
||||
end
|
||||
|
||||
function snakeplayer:move(xvel, yvel)
|
||||
@@ -89,6 +91,7 @@ function snakeplayer:update(dt)
|
||||
self.tar.x = math.floor(math.random() * snake.hgrid)
|
||||
self.tar.y = math.floor(math.random() * snake.vgrid)
|
||||
snake.beep:play()
|
||||
snake.score= snake.score + 1
|
||||
end
|
||||
for i = table.getn(self.blocks), 1, -1 do
|
||||
if i == 1 then
|
||||
|
Reference in New Issue
Block a user