Path: chuka.playstation.co.uk!news From: "Scott Ward" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: animation, collision detection, backgrounds Date: Sun, 11 Jul 1999 02:45:45 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 55 Message-ID: <7m8sug$dq823@chuka.playstation.co.uk> References: <3786FE72.1BE9@hotmail.com> NNTP-Posting-Host: p137-penguin-gui.tch.virgin.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 john wrote in message news:3786FE72.1BE9@hotmail.com... > How do I do animation with sprites. I want a character to appear to walk > when he moves across the screen. > This is just my opinion but it's probably best to use the u and v values when creating animation with sprites. When you create your sprite frames, save them as one big TIM with all the frames the same size and sitting next to each other. So if you have a sprite that's 20 pixels wide and 20 pixels high and you have three seperate frames the TIM will be 60x20 or 20x60 depending on which way you stack them. Then all you have to do is change the u or v values to make the sprite structure point to a different frame in the main TIM. For example: Every ten code cycles--> sprite.u+=20; if(sprite.u==40) { sprite.u=0; } Obviously, your u,v values will be different depending on where in the tpage you store the TIM but hopefully you get the picture. :o) Let me know if you need more help with this. > When i wrote a simple function to test two spheres colliding as they > bounced around the screen the program slows down when the spheres are > near the edge of the screen (but only if collision detection is being > used). Also when if a higher res mode (640 x512) the screen flickered > constantly and when the spheres collided they produced a static double > image until the spheres collided again. What's wrong? > > Also the spheres sometimes stick together if they collide whilst moving > towards each other. PASS. :o( (I won't even bother trying to answer this one) > Has anyone got a simple tutorial for using the background picture > functions (ie. words not just code) Check out Andy Partington's website, I think you should find it under the name of kung-fu Coders. The tutorial's not the most thorough piece of text but it made me understand how to use the background functions so it must be good! >Thanks No problem me old cock-spadger, Scott Ward