Path: chuka.playstation.co.uk!news From: James Shaughnessy Newsgroups: scee.yaroze.freetalk.english Subject: Re: Animation Date: Mon, 25 Jan 1999 19:19:44 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 48 Message-ID: <36ACC3D0.7099DFCC@manc.u-net.com> References: <36AC9E5C.D8E74512@which.net> NNTP-Posting-Host: manc.u-net.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en Hey there, Create/edit a .BMP image (yes any will do as they all do BitMaPs, but I personally recommend shareware PaintShop Pro) and use TimTool/TimUtil to convert it to a .TIM file (which is what the Yaroze wants to see it as). Always try and make the bit-depth of the image (ie 4,8or16) as low as possible for speed/space savings. Assuming you know what this "u" and "v" business is all about (look up the GsSPRITE structure in the manual and study code in simple sprite demos (many around!) -- they are "x+y" offsets in the frame buffer to the image/animation cell you want), and you can display a single sprite, then it should be farely straightforward. Eg. say you want an explosion animation, the sprite to be 16x16 pixels and 10 frame of animation, just create a 160x16 pixel .bmp image with the images side by side in a row. Then [assuming you put the TIM in the top left of a .tpage] setup the sprite to point to u=0, v=0, with w=16, h=16 (width/height) to define the size. Then to animate through, just keep adding 16 to the 'u' value (before GsSorting) which will then make the sprite show the next frame. Job's a good 'en. The beauty is that u + v values are relative to the true image, not the physical pixel offset in the frame buffer so you don't need to worry about the bit-depth (if the 160x16 .bmp is saved as 4-bit (ie with a CLUT), then it will only actually take up 40x16 pixels on the frame buffer). How to implement it in the code is simply down to you're understanding of C, but this method is most likely much preferable than re-'LoadImage'ing new TIMs to the same area of VRAM (faster but of course uses up more space). As they always say, there is no correct way of doing anything, only a better way for the program in question. Which is nice. Jim Andrew Murray wrote: > Good Day, > > Does anyone know the method of implementing animation in 2D games? > Like how do I make images for the animation and can I use any paint > program to make them. > How do I implement the animation in the code? > > Please reply anyone ASAP. > > Max