[plt-scheme] how to optimize my code ?

From: Ziboon (ziboon at gmail.com)
Date: Fri Apr 24 14:50:08 EDT 2009

Hi, I try to code a game:
I have double buffer and I use thread for refreshing.

My method to refresh my canvas:
(define (start)
  (set! PLAY #t)
  (set! TH (thread (λ() (do () ((not PLAY))
                                   (send my-canvas refresh)
                                   (sleep/yield 0.001))))))


And now I have 4 class% :
ball               (with x y dx dy timer%)
target%         (just a bitmap)
target-destroy%           (my target become 3 pieces ( with dx dy ) of
initial target bitmap to simulate a destruction when ball is close to
target)
cannon%                      (72 bitmaps into a vector for rotation (my
cannon follow my mousse))


Now my game has some slow-down !!!!!!!
maybe I must use more thread ? a specific bitmap-dc%  for each  class ?

(sorry for my english)
thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090424/0d48e97a/attachment.html>

Posted on the users mailing list.