Walk cycle with gun

Non-platform specific questions.

Walk cycle with gun

Postby Pyathus » Thu Jun 30, 2011 4:59 pm

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?
Pyathus
 
Posts: 12
Joined: Mon Jun 13, 2011 2:59 am
Score: 0 Give a positive score

Re: Walk cycle with gun

Postby Game A Gogo » Thu Jun 30, 2011 5:42 pm

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;
}
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Walk cycle with gun

Postby savvy » Fri Jul 01, 2011 6:23 pm

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!
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest