[plt-scheme] how to optimize my code ?
How do you measure its speed?
What speed are you trying to attain?
2009/4/24 Ziboon <ziboon at gmail.com>:
> 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!
>
>
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>
--
http://www.wisdomandwonder.com/