Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require("menus") --Disregard
- require("conf") --Disregard
- love.window.setTitle("Beaverball: Revenge")
- love.window.setMode(1920, 1200)
- love.graphics.setDefaultFilter('nearest', 'nearest')
- showFPS = false
- function love.load()
- beaver = {}
- beaver.image = love.graphics.newImage('beaver.png')
- beaver.x = 0
- beaver.y = 1900
- beaver.speed = 5
- --[[redneck = {}
- redneck.x = 0
- redneck.y = 0
- redneck.speed = 0]]
- gamestate = "startmenu"
- end
- function love.update(dt)
- --Side Collision
- if beaver.x < 0 then
- beaver.x = 0
- elseif beaver.x > 1835 then
- beaver.x = 1835
- elseif beaver.y < 50 then
- beaver.y = 50
- elseif beaver.y > 1060 then
- beaver.y = 1060
- end
- if love.keyboard.isDown("escape") then
- love.event.quit()
- elseif love.keyboard.isDown("f1") then
- paused = true;
- beaver.speed = 0
- elseif love.keyboard.isDown("f2") then
- paused = false;
- beaver.speed = 5
- elseif love.keyboard.isDown("f3") then
- showFPS = true
- elseif love.keyboard.isDown("f4") then
- showFPS = false
- elseif love.keyboard.isDown("d") then
- beaver.x = beaver.x + beaver.speed
- elseif love.keyboard.isDown("a") then
- beaver.x = beaver.x - beaver.speed
- elseif love.keyboard.isDown(" ") then
- end
- end
- function love.keypressed( key )
- if key == "escape" then
- love.event.quit()
- elseif key == "f1" then
- paused = true;
- elseif key == "f2" then
- paused = false;
- elseif key == "f3" then
- showFPS = true
- elseif key == "f4" then
- showFPS = false
- elseif key == "d" then
- beaver.x = beaver.x + beaver.speed
- elseif key == "a" then
- beaver.x = beaver.x - beaver.speed
- end
- end
- function love.draw()
- --if gamestate == "playing" then
- love.graphics.setColor(0, 255, 0)
- love.graphics.setPointSize(9)
- love.graphics.print('Press F1 for help.', 890, 50)
- if gamestate == "paused" then
- love.graphics.setColor(0, 0, 0)
- love.graphics.rectangle("fill", 0, 0, 2000, 2000)
- love.graphics.setColor(0, 255, 0)
- love.graphics.setPointSize(9)
- love.graphics.print('Press F2 to close help.', 890, 50)
- elseif showFPS == true then
- love.graphics.print("FPS: "..love.timer.getFPS(), 0, 50)
- elseif showHelp == false then
- end
- love.graphics.setColor(255, 255, 255)
- love.graphics.draw(beaver.image, beaver.x, beaver.y, 0, 1) --Draws the shape/item
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement