/
main.lua
48 lines (40 loc) · 958 Bytes
/
main.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
function love.load()
vsync = true
love.window.setTitle('Pong')
-- listOfRec = {}
-- require('rectangle')
-- drawRectangle()
Object = require 'classic'
require('game')
require('entity')
require('pad')
require('ball')
game = Game()
love.graphics.setBackgroundColor(0.1, 0.1, 0.1)
love.graphics.setColor(1, 1, 1, 1)
-- gameState = 'main'
-- -- Set the initial game mode
-- gameMode = 'solo'
love.audio.setVolume(0.20)
sounds = {
hit = love.audio.newSource('sounds/ping.ogg', 'static'),
score = love.audio.newSource('sounds/pong.ogg', 'static')
}
-- secondaryPlayerSetup()
end
-- function love.keypressed(key)
-- moveRectangle(key)
-- end
function love.update(dt)
-- updateSpeed(dt)
game:update(dt)
end
function love.draw()
-- drawManyRec()
game:draw()
end
function love.keypressed(k)
if k == 'r' then
love.load()
end
end