Path: chuka.playstation.co.uk!news From: Andrew Murray Newsgroups: scee.yaroze.freetalk.english Subject: Re: Animation Date: Sat, 15 May 1999 22:51:53 +0100 Organization: Max Studios Lines: 133 Message-ID: <373DEC79.53394309@which.net> References: <373AEAC2.5D25C39E@which.net> <373C4FB4.40503AE4@yaroze2000.freeserve.co.uk> NNTP-Posting-Host: p02-bantam-gui.tch.which.net Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------723E9F2C6B36027D20FD9721" X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en This is a multi-part message in MIME format. --------------723E9F2C6B36027D20FD9721 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cheers tones you're a real cool guy. You helped me discover animation on the Yaroze (no mean feat!) What's yer web address and I'll put it on my web site. Mine is at http://www.netyaroze-europe.com/~leon17 Thanx Max Tones wrote: > Hi Andrew, > > Don't know of any tutorials, 'cos I was in a similar situation nearly a year > ago. If your still stuck in the meantime, try using arrays to store your u > and v values- it's quick and a great deal easier to maintain. Ie. : > > #define NUM_ANIMS (23) // Number of animations > #define ANIM_LEN_1 (10) //10 Frame animation > > int ANIM1U[10] = { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; // U > positions for anim 1 which has 10 frames > int ANIM1V[10] = { 0, 0, 0, 0, 0, 30, 30, 30, 30, 30 }; // > V positions for anim 2 > > Ie then to set player1 to frame 2 of anim 1 , do player1.u = ANIM1U[1], > player1.v = ANIM1V[1]; > > Then all I do is call an animition procedure which handles EVERY type of > animation you have set up. Even better, if you define an animation structure > as an array > the size of the number of animations, you can do all sorts of cool routines, > and it's bloody easy to maintain, such as : > > struct ANIM_STRUCT > { > int ANIM_DELAY; // How long to delay between each frame > int CURRENT_FRAME; // How far into the animation has it played? > int STILL_PLAYING; // Is the animation still playing ? > int COUNTER; // How long till the next frame plays (I.e. has the > counter reached the delay variable for this animation?) > } ANIM_DETAIL[NUM_ANIMS]; > > Make sure you write an initialisation routine though, so that the values are > set for later use. If your interested, my procedure for the animation handler > in my new game (which is still a secret :) ) looks like this : > > void AnimPlayer1Control(int AnimNumber, int *AnimArrayU, int *AnimArrayV) // > Pass the animation you want to play, and the pointers to the ANIM1U > { > // array (or ANIM2U etc) and the V array. > > // This procedure controls the animation routines required for Player 1 > > ANIM_DETAIL[AnimNumber].COUNTER++; > PLAYER_DETAIL[PLAYER_ONE].CURRENT_ANIM = AnimNumber; > PLAYER_DETAIL[PLAYER_ONE].STILL_PLAYING=1; > PLAYER_DETAIL[PLAYER_ONE].AnimArrayU = AnimArrayU; > PLAYER_DETAIL[PLAYER_ONE].AnimArrayV = AnimArrayV; > > if ( ANIM_DETAIL[AnimNumber].COUNTER > ANIM_DETAIL[AnimNumber].ANIM_DELAY ) > { > ANIM_DETAIL[AnimNumber].COUNTER=0; > if ( ANIM_DETAIL[AnimNumber].CURRENT_FRAME < LENANIM[AnimNumber] ) > { > player1.u = AnimArrayU[ANIM_DETAIL[AnimNumber].CURRENT_FRAME]; > player1.v = AnimArrayV[ANIM_DETAIL[AnimNumber].CURRENT_FRAME]; > ANIM_DETAIL[AnimNumber].CURRENT_FRAME++; > } > else > { > ANIM_DETAIL[AnimNumber].COUNTER=0; > ANIM_DETAIL[AnimNumber].CURRENT_FRAME=0; > ANIM_DETAIL[AnimNumber].STILL_PLAYING = 0; > PLAYER_DETAIL[PLAYER_ONE].STILL_PLAYING=0; > > //Reset Player 1 to normal standing stance > > player1.u = P1_STAND_U; > player1.v = P1_STAND_V; > } > } > } > > // *********end*********** > > I know it's a little crap - but it does the job nicely. If you base yours > around this, or if someone else does it a little tidier, use that - but > otherwise the general > rule of thumb is pretty much the same no matter which way you do it. And as > everything is controlled by arrays, you can muck around with the sizes and > settings to your hearts content! > > Hope this helps, > > Cheers! > > Tones 8) > > Andrew Murray wrote: > > > Does anyone know where I can pick up a tutorial on 2D animation on the > > Net Yaroze? > > > > Cheers. --------------723E9F2C6B36027D20FD9721 Content-Type: text/x-vcard; charset=us-ascii; name="mad.max.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Andrew Murray Content-Disposition: attachment; filename="mad.max.vcf" begin:vcard n:Murray;Andrew x-mozilla-html:FALSE org:Max Studios adr:;;;;;; version:2.1 email;internet:mad.max@which.net title:Mr fn:Andrew Murray end:vcard --------------723E9F2C6B36027D20FD9721--