
-----------------------------------
plato
Sun Jun 08, 2014 11:04 pm

Help - The speed at which my game runs on different computers
-----------------------------------
What is it you are trying to achieve?
For my comp sci summative project, I made a game in which the user controls a car on a 3-lane road, where other cars come from the top of the screen and the user has to dodge the cars to stay alive. 


What is the problem you are having?
When working at school, the game seems to run fine and the controls seem good and the speed at which the cars move is good. However at home on my much more powerful computer, the program runs much quicker, making the enemy cars as well as the user's car move so quick it is impossible to control it. 


Describe what you have tried to solve this problem
I've tried to use delays and changing the values to find some middle-ground, however I've had no luck.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
This is a bare bones version of the program.



var chars : array char of boolean
var y1 := 400
var y2 := 450
var xrand : int := 0
var carx : int := 191
var carx2 : int := 226
var roady1 : int := 400 %yellow
var roady2 : int := 350 %yellow
View.Set ("offscreenonly")
procedure Background
    Draw.ThickLine (180, 400, 180, 0, 1, 7) %road line
    Draw.ThickLine (390, 400, 390, 0, 1, 7) %road line
    if y2 