Commits

Christian Kellermann committed d4cb356

Adjust timing values to latest doodle

Comments (0)

Files changed (1)

               (radial-point-from pos (- radius (random variation)) a)
               es))))))
   (let* ((angle (random 360))
-         (speed (max 0.1 (random 2)))
+         (speed (max 0.1 (random 100)))
          (es (edges n))
          (velocity (map - (radial-point-from pos speed angle) pos)))
     (make-thing 'asteroid pos velocity 0 0 radius es)))
 ;; Move one thing around
 (define (move-thing dt t)
   (let* ((pos (thing-pos t))
-         (thrust  (* dt (thing-thrust t)))
+         (thrust  (* (/ dt 1000) (thing-thrust t)))
          (heading (thing-heading t))
          (velocity (thing-velocity t))
          (thrust-vec (map - (radial-point-from pos thrust heading) pos))
-         (scaled-vel (map (cut * 100 <> dt) (map + velocity thrust-vec)))
+         (scaled-vel (map (cut * <> (/ dt 1000)) (map + velocity thrust-vec)))
          (new-vel  (map + velocity thrust-vec)))
 
     (thing-pos-set! t (map + pos scaled-vel))
           (unless *muted* (play-sample *firing-sound* channel: 2 duration: 1000))
           (world-bullets-left-set! world (sub1 bullets-left))
           (world-bullets-set! world
-                              (cons (make-bullet (radial-point-from pos (+ r 10) a) a 2)
+                              (cons (make-bullet (radial-point-from pos (+ r 10) a) a 200)
                                     (world-bullets world))))))
 
 ;; Start with a new world
 (set! *time* (current-milliseconds))
 (set! *frames* 0)
 (set! *fps* "??")
+(set! *thrust* 20)
 
 ;; make us a global new world
 (world-inits
    (set! *firing-sound* (load-sample "assets/Bottle Rocket-SoundBible.com-332895117.wav"))
    (set! *explosion-sound* (load-sample "assets/Bomb_Exploding-Sound_Explorer-68256487.wav"))
    (set! *background-music* (load-music "assets/MyVeryOwnDeadShip.ogg"))
-   (play-music *background-music*)
+   (unless *muted*
+     (play-music *background-music*))
    (music-finished (lambda () (play-music *background-music*)))
    (set! *w* (new-world level: 1))))
 
           (pos (thing-pos s))
           (shield (world-shield *w*)))
      (cond (*thrusting*
-             (thing-thrust-set! s (+ (thing-thrust s) (* 10 dt)))
+            (thing-thrust-set! s (+ (thing-thrust s) (* *thrust* (/ dt 10))))
              (unless (and (not *muted*) (channel-playing? 1))
                (play-sample *thrust-sound* duration: 40 channel: 1)))
            (else
                    (when (< 0 (world-upgrade-timer *w*))
                            (world-upgrade-timer-set!
                             *w*
-                            (max 0 (- (world-upgrade-timer *w*) dt))))
-               (world-shield-set! *w* (max 0 (- shield dt))))))
+                            (max 0 (- (world-upgrade-timer *w*) (/ dt 1000)))))
+               (world-shield-set! *w* (max 0 (- shield (/ dt 1000)))))))
 
    (when (zero? (world-upgrade-timer *w*))
          (world-upgrades-set! *w* '()))
    (when (and (not *paused*) *rotating*)
      (world-ship-set!
       *w*
-      (rotate-ship (world-ship *w*) *rotating*)))
+      (rotate-ship (world-ship *w*) (ceiling (* *rotating* (/ dt 10))))))
 
    (draw-things (world-asteroids *w*)
                 (world-bullets *w*)