This was bugging me (no, fps_limit is no guarantee).
This was bugging me (no, fps_limit is no guarantee).


Index: driving.py
===================================================================
--- driving.py	(revision 438)
+++ driving.py	(working copy)
@@ -24,16 +24,16 @@
 speed = 0
 clock = pyglet.clock.Clock(fps_limit=30)
 while not w.has_exit:
-    clock.tick()
+    dt = clock.tick()
     w.dispatch_events()

     # handle input and move the car
-    car.angle += (keyboard[K_LEFT] - keyboard[K_RIGHT]) * 5
-    speed += (keyboard[K_UP] - keyboard[K_DOWN]) * 2.5
-    if speed > 10: speed = 10
-    if speed < -5: speed = -5
+    car.angle += (keyboard[K_LEFT] - keyboard[K_RIGHT]) * 150 * dt
+    speed += (keyboard[K_UP] - keyboard[K_DOWN]) * 75
+    if speed > 300: speed = 300
+    if speed < -150: speed = -150
     r = Matrix3.new_rotate(math.radians(car.angle))
-    v = speed * (r * Vector2(0, 1))
+    v = dt * speed * (r * Vector2(0, 1))
     car.x += v.x
     car.y += v.y

--HG--
extra : convert_revision : svn%3A14d46d22-621c-0410-bb3d-6f67920f7d95/trunk%40439

infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore