home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- 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
- From: tj@kona.cs.ucla.edu (Tom Johnson)
- Subject: Arcade-style animation...
- Message-ID: <1993Jan23.014127.5750@cs.ucla.edu>
- Sender: usenet@cs.ucla.edu (Mr Usenet)
- Nntp-Posting-Host: kona.cs.ucla.edu
- Organization: UCLA, Computer Science Department
- Date: Sat, 23 Jan 93 01:41:27 GMT
- Lines: 44
-
- Yes, I know this is a FAQ, but it's not in the list, and poking around
- archie hasn't helped me find anything suitable.
-
- I'm working on a sprite library, for doing arcade games for the mac. I
- would like to support multiple bit depths, complex background screens,
- etc... I don't want to limit movement to some small are of the screen; the
- whole screen should be available for the game.
-
- The obvious method, using CopyBits (or CopyMask), drawing to an offscreen
- buffer, and then on-screen is a little slow. More than a little.
- Here is what I first envisioned in pseudo-code:
-
- foreach sprite
- CalculateNewLocation()
- foreach sprite
- EraseSprite() // by copying the sprites old location from
- // a bkgnd screen to an offscreen world
- foreach sprite
- DrawSprite() // by copying the sprite onto the offscreen
- // world
- UpdateScreen() // by copying the offscreen world onto the
- // screen.
-
- But in 8bits, on a IIci or IIfx I can't update the screen fast enough when
- a large area requires updating.
-
- It looks like drawing directly to the window's pix map will be required.
-
- But! If I'm drawing directly to the screen, how do I handle the
- "EraseSprite()" function? Since I want to support a complex color
- background (ie a 256 color pict, not just a black bacground with a few
- stars like most other games I've seen), I need to restore the old location
- of the sprite.
-
-
- How do I erase my sprite and restore my background quickly?
-
- Thanks-
-
- Tom
-
- --
- Tom Johnson "They say Confucious does his crossword with a pen."
- tj@cs.ucla.edu -Tori Amos
-