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

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!destroyer!cs.ubc.ca!unixg.ubc.ca!ucla-mic!ucla-cs!kona.cs.ucla.edu!tj
  3. From: tj@kona.cs.ucla.edu (Tom Johnson)
  4. Subject: Arcade-style animation...
  5. Message-ID: <1993Jan23.014127.5750@cs.ucla.edu>
  6. Sender: usenet@cs.ucla.edu (Mr Usenet)
  7. Nntp-Posting-Host: kona.cs.ucla.edu
  8. Organization: UCLA, Computer Science Department
  9. Date: Sat, 23 Jan 93 01:41:27 GMT
  10. Lines: 44
  11.  
  12. Yes, I know this is a FAQ, but it's not in the list, and poking around
  13. archie hasn't helped me find anything suitable.
  14.  
  15. I'm working on a sprite library, for doing arcade games for the mac. I
  16. would like to support multiple bit depths, complex background screens,
  17. etc... I don't want to limit movement to some small are of the screen; the
  18. whole screen should be available for the game.
  19.  
  20. The obvious method, using CopyBits (or CopyMask), drawing to an offscreen
  21. buffer, and then on-screen is a little slow.  More than a little.
  22. Here is what I first envisioned in pseudo-code:
  23.     
  24.     foreach sprite 
  25.         CalculateNewLocation()
  26.     foreach sprite
  27.         EraseSprite()    // by copying the sprites old location from
  28.                 // a bkgnd screen to an offscreen world
  29.     foreach sprite
  30.         DrawSprite()    // by copying the sprite onto the offscreen
  31.                 // world
  32.     UpdateScreen()        // by copying the offscreen world onto the
  33.                 // screen.    
  34.  
  35. But in 8bits, on a IIci or IIfx I can't update the screen fast enough when
  36. a large area requires updating.
  37.  
  38. It looks like drawing directly to the window's pix map will be required.
  39.  
  40. But!  If I'm drawing directly to the screen, how do I handle the
  41. "EraseSprite()" function?  Since I want to support a complex color
  42. background (ie a 256 color pict, not just a black bacground with a few
  43. stars like most other games I've seen), I need to restore the old location
  44. of the sprite.                                                
  45.  
  46.  
  47. How do I erase my sprite and restore my background quickly?
  48.  
  49. Thanks-
  50.  
  51.   Tom
  52.     
  53. -- 
  54. Tom Johnson             "They say Confucious does his crossword with a pen."
  55. tj@cs.ucla.edu                               -Tori Amos
  56.