Re: Dave Gone Apeshit
Posted: Fri Jan 21, 2011 8:41 pm
I would really play this more if it wasn't for my mean ATI drivers turning the game into a screen tearing-fest.
Is this something you only experience in our game? If so, is it a problem for both the main menu and the game?thelinx wrote:I would really play this more if it wasn't for my mean ATI drivers turning the game into a screen tearing-fest.
ghostwriter wrote:Very cool
You might want to define a MAX_TIMESTEP (i usually use around 0.1 seconds), and then in the update function of main.lua you can start with dt = math.min(dt,MAX_TIMESTEP). Right now it's possible to exploit the unlimited timestep by grabbing the title bar of the window til you get the high score
Yeah. It can be exploited in OS X too if you press and hold on the Close X. In Löve, when you press the Close X, the action stops (Update and draw don't update or draw) until you let go. (Move the mouse away from the X before letting go unless you want to quit Löve.) Since this game just takes the time you started and subtracts it from the current time and uses that for where you are in the level, it lets people exploit the problem by holding the mouse button. Don't know if Linux has a similar problem. OS X doesn't have the "pause action when dragging window" problem due to the way it displays graphics vs. Windows, but I assume Linux also has a problematic graphics rendering engine.bartbes wrote:Ugh.. windows..
Code: Select all
gametime = gametime + dt
Code: Select all
function love.load()
startGame() --Or wherever your start game function goes, probably when the Start Game button is clicked.
end
function love.update(dt)
gameTime = gameTime + dt --Put it inside whatever function or code is executed when the game is running
end
function love.draw()
love.graphics.print(gameTime, 0, 0)
--Will draw this time as a number. Do whatever formatting you want to it to make it look good.
end
function startGame()
gameTime = 0 --Put it in whatever function you call when you start a game
end
Code: Select all
function love.update(dt)
dt = math.min(dt, 0.1) -- or whatever
-- ...
end