Page 1 of 1

Some questions

PostPosted: Wed Sep 26, 2007 9:12 am
by GE2007
HI all i have some questions:

- i have a 4 frame anim in .gif format [when my actor shoot things], i set delay afrer 4th frame at 50ms and between other frames 10ms. When i test it doesn't work, delay between frames is the same :?:

- my actor moving with right and left arrow... i have an anim [ 5 frames] when my actor jumps diagonally [ up + right or left arrow] my question is how can i make my actor jump when i press both arrows once because only jumps when i hold arrows :? Maybe x axis move event affect on jump event [ how can i disable this event when jumping]

Best Regards GE2007

p.e :sorry for my english

Re: Some questions

PostPosted: Wed Sep 26, 2007 1:22 pm
by Spidy
??????????????????????????????????????????what do u mean :|

Re: Some questions

PostPosted: Wed Sep 26, 2007 3:15 pm
by Bee-Ant
[quote="GE2007"]HI all i have some questions:...or moving with right and left arrow... i have an anim [ 5 frames] when my actor jumps diagonally [ up + right or left arrow] my question is how can i make my actor jump when i press both arrows once because only jumps when i hold arrows :? Maybe x axis move event affect on jump event [ how can i disable this event when jumping]

Make 2 variables... var1, var2 (on script editor>variable>add)
on KeyDown event of Left arrow, put this code :
Code: Select all
var1=1;
if(var1==1 && var2==1)
{
    yvelocity=yvelocity-10;
}

on KeyDown event of Right arrow, put this code :
Code: Select all
var2=1;
if(var1==1 && var2==1)
{
    yvelocity=yvelocity-10;
}


On KeyUp event of Left Arrow put this code :
Code: Select all
var1=0;

On KeyUp event of Right Arrow put this code :
Code: Select all
var2=0;


I hope it will help you...(sorry if this is not what are you wanted, I cant understand your English well)

Re: Some questions

PostPosted: Wed Sep 26, 2007 3:48 pm
by Spidy
yeh bee-ant is great he will help ya

Re: Some questions

PostPosted: Wed Sep 26, 2007 4:00 pm
by makslane
GE2007 wrote:i have a 4 frame anim in .gif format [when my actor shoot things], i set delay afrer 4th frame at 50ms and between other frames 10ms. When i test it doesn't work, delay between frames is the same :?:


All frames are played at the fps defined when you add the animation.

Re: Some questions

PostPosted: Thu Sep 27, 2007 12:29 pm
by Bee-Ant
Spidy wrote:yeh bee-ant is great he will help ya

:wink: you'll be great too...just need more time... :D

Oops, I know you mean on second question...maybe like this:
"If I press RightArrow the effect is move right, but if I press RightArrow+UpArrow the effect is Jump to right(diagonally). If I press LeftArrow the effect is move left, but if I press LeftArrow+UpArrow the effect is Jump to left(diagonally), with removing the move effect"..isn't it???

OK...
First, make some variables (the name is up to you) :
1. canjump (integer, actor variable))
2. moveright (integer, actor variable)
3. moveleft (integer, actor variable)

On Collision of top side of Platform(ground), put this code :
Code: Select all
canjump=1;


On CollisionFinish of Platform, put this code :
Code: Select all
canjump=0;


On Keydown of LeftArrow, put this code :
Code: Select all
if(canjump==1)
{
    x=x-3;
    ChangeAnimation("EventActor", "WalkLeft", FORWARD);
}
moveleft=1;


On Keydown of RightArrow, put this code :
Code: Select all
if(canjump==1)
{
    x=x+3;
    ChangeAnimation("EventActor", "WalkRight", FORWARD);
}
moveright=1;


On Keydown of UpArrow, put this code :
Code: Select all
if(moveleft==1)
{
    if(canjump==1)
    {
        yvelocity=yvelocity-10;
        xvelocity=xvelocity-5;
        ChangeAnimation("EventActor", "JumpLeft", FORWARD);
        canjump=0;
    }
}
if(moveright==1)
{
    if(canjump==1)
    {
        yvelocity=yvelocity-10;
        xvelocity=xvelocity+5;
        ChangeAnimation("EventActor", "JumpRight", FORWARD);
        canjump=0;
    }
}


On KeyUp of LeftArrow
Code: Select all
moveleft=0;


On KeyUp of RightArrow
Code: Select all
moveright=0;


Ummm...I hope will help... :D
Thanks,