home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22113 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.5 KB  |  42 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!mcsun!sun4nl!rulway.LeidenUniv.nl!ruls41.LeidenUniv.nl!vosse
  3. From: vosse@ruls41.LeidenUniv.nl (Theo Vosse)
  4. Subject: Re: Arcade-style animation...
  5. Message-ID: <1993Jan25.094256.12845@rulway.LeidenUniv.nl>
  6. Sender: root@rulway.LeidenUniv.nl (System PRIVILEGED Account)
  7. Nntp-Posting-Host: ruls41.leidenuniv.nl
  8. Reply-To: vosse@ruls41.LeidenUniv.nl (Theo Vosse)
  9. Organization: Leiden University, Netherlands
  10. References:  <1993Jan23.014127.5750@cs.ucla.edu>
  11. Date: Mon, 25 Jan 93 09:42:56 GMT
  12. Lines: 28
  13.  
  14. In article <1993Jan23.014127.5750@cs.ucla.edu>, tj@kona.cs.ucla.edu (Tom
  15. Johnson) writes:
  16. |> Here is what I first envisioned in pseudo-code:
  17. |>     
  18. |>     foreach sprite 
  19. |>         CalculateNewLocation()
  20. |>     foreach sprite
  21. |>         EraseSprite()    // by copying the sprites old location from
  22. |>                 // a bkgnd screen to an offscreen world
  23. |>     foreach sprite
  24. |>         DrawSprite()    // by copying the sprite onto the offscreen
  25. |>                 // world
  26. |>     UpdateScreen()        // by copying the offscreen world onto the
  27. |>                 // screen.    
  28. |> ...
  29. |> But!  If I'm drawing directly to the screen, how do I handle the
  30. |> "EraseSprite()" function?  Since I want to support a complex color
  31.  
  32. Life is simple... Forget the UpdateScreen function, and implement the
  33. EraseSprite as a copy of the old contents (that were stored under the
  34. sprite) back to its original position. So, DrawSprite must copy the
  35. contents of the sprite's position before drawing the actual sprite.
  36.  
  37.     Theo Vosse
  38.     ----------
  39.     Unit for Experimental Psychology
  40.     University of Leiden
  41.     The Netherlands
  42.