Path: utzoo!attcan!uunet!cbmvax!rutgers!ucsd!nosc!helios.ee.lbl.gov!pasteur!cory.Berkeley.EDU!soohoo From: soohoo@cory.Berkeley.EDU (Ken Soohoo) Newsgroups: comp.sys.atari.st Subject: Re: ANIMATION QUESTION Message-ID: <5458@pasteur.Berkeley.EDU> Date: 6 Sep 88 16:49:01 GMT References: <880831-204234-3799@Xerox> Sender: news@pasteur.Berkeley.EDU Reply-To: soohoo@cory.Berkeley.EDU.UUCP (Ken Soohoo) Organization: University of California, Berkeley Lines: 48 In article <880831-204234-3799@Xerox> "Robert_L._White.ESXC15"@XEROX.COM writes: [intro deleted] >My question here is, How do I make the sprite move faster than 60 pixels >per second? Is it possible? I have tried moving the sprite 2 pixels at a time, > >The way I am doing my animation is this. I am using 3 screens. One holds the >background picture, one is the drawing screen (LOG BASE), and one is the >screen being viewed (PHYS BASE). >For 1 animation sequence I copy the background screen to the LOG BASE >screen, then draw my sprite to the LOG BASE screen, Then do a [more deleted] >Thanks, >Robert L. White, Xerox Corp. You don't need to re-copy the background screen into the logical screen each time you draw a new frame, this takes a HUGE amount of time. All you 've got to do is copy the section of the screen that the sprite occupied in the previous version of the logical screen. How about an example: Show page 2 (Physbase = page 2, Logbase = page 1) Frame 1: x1 = 50, y1 = 50; x2 = 50, y2 = 50 x = 50, y = 50 Copy the area from your background at x1, y1 to page 1 Move sprite to 55, 55 (x=55, y=55) Draw sprite at x, y in page 1 Set x1 = x, y1 = y Now show page 1 (Physbase = page 1, Logbase = page 2) Frame 2: x1 = 55, y1 = 55; x2 = 50, y2 = 50 x = 55, y = 55 Copy the area from your background at x2, y2 to page 2 Move the sprite to 60, 60 (x=60, y=60) Draw sprite at x, y at page 2 Set x2 = x, y2 = y GOTO Frame 1 I've found this to be a fairly quick solution to sprites in software, but feel free to mail me with more questions (specifics). Kenneth Soohoo soohoo@cory.Berkeley.Edu --Ken Soohoo Atari 400/800/600xl/800xl/1200/130xe/65xe freelance gamer Atari 1040ST hacker Sometime Berkeley Student