function Setup() Player = newPlayer() Player:setSpeed(7) Player:setColor("red") Player:setPos({440, 330}) Text = newText() Text:setColor("darkgreen") Sound = newSound() Rectangle = newRectangle() Rectangle:setSize({150, 60}) Rectangle:setPos({90, 220}) end function Update(dt) Text:setText("FPS: " .. tostring(getFPS())) Player:setVelocity({ 0, 0 }) if isKeyDown("space") then Sound:loadSound("oof.wav") Sound:playSound() end if isKeyDown("leftshift") then Player:setSpeed(15) else Player:setSpeed(7) end local pos = Rectangle:getPos() pos[1] = pos[1] + (1) Rectangle:setPos(pos) end function Draw() Player:draw() Text:draw() Rectangle:draw() end