-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestScene.lua
More file actions
29 lines (24 loc) · 787 Bytes
/
Copy pathTestScene.lua
File metadata and controls
29 lines (24 loc) · 787 Bytes
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
local TestScene = class("TestScene", Scene)
local TestObject = require "TestObject"
local Floor = require "Floor"
local METER = 16
function TestScene:initialize()
Scene.initialize(self)
love.physics.setMeter(METER)
self.world = love.physics.newWorld(0, 9.82*METER, true)
self:addEntity(TestObject:new(400, 100, self))
local w, h = love.window.getDimensions()
self:addEntity(Floor:new(w/2, h, w, 10, self))
self:addEntity(Floor:new(w/2, 0, w, 10, self))
self:addEntity(Floor:new(0, h/2, 10, h, self))
self:addEntity(Floor:new(w, h/2, 10, h, self))
end
function TestScene:update(dt)
self.world:update(dt)
Scene.update(self, dt)
end
function TestScene:draw()
Scene.draw(self)
love.graphics.print("Press screen to move ball!", 20, 50)
end
return TestScene