Page 1 of 1

Walk cycle with gun

PostPosted: Thu Jun 30, 2011 4:59 pm
by Pyathus
hey guys, so im rendering a lot of different animations because I want the ability to buy and use different weapons in my game so ive been animating different guns to fit my walk cycle but I was wondering if theres an easier and less time consuming way to do this without having to animate the gun to bounce up and down. Is there any code I could use to be able to make the gun parent my character's walk cycle and move up and down smoothy?

Re: Walk cycle with gun

PostPosted: Thu Jun 30, 2011 5:42 pm
by Game A Gogo
do a switch with animindex and another with animpos.


exemple:
Code: Select all
switch(animindex)
{
    case 0://first animation
    switch(animpos)
    {
        case 0: y=0; break;//first frame
        case 1: y=1; break;
        case 2: y=3; break;
        case 3: y=2; break;
        case 4: y=1; break;
    }
    break;
    case 1://second animation
    switch(animpos)
    {
        case 0: y=0; break;//first frame
        case 1: y=1; break;
        case 2: y=3; break;
        case 3: y=2; break;
        case 4: y=1; break;
    }
    break;
    //case #:
    //switch(animpos)
    //{
    //    case #: y=#; break;
    //}
    //break;
}

Re: Walk cycle with gun

PostPosted: Fri Jul 01, 2011 6:23 pm
by savvy
ye, GAGs method and yours are the easiest i know on this case :D
games require lots of graphical work, dont be put off by it... uses up a lot of making time.. hence why there teams of people making bigger games!