Page 4 of 4

Re: Best game you made?

PostPosted: Tue Nov 15, 2011 11:21 pm
by NightOfHorror
Bunnies are invading GE topics. *gets gun* time to put end to this. :twisted:

Re: Best game you made?

PostPosted: Tue Nov 15, 2011 11:31 pm
by SuperSonic
Is it just me or do most people here have a tendancy to get off topic? (Including me)XD

So, if anyone wants to here the hardest function I've ever made, here it is. It is a function that draws 3d lines using a canvas. But they are all the same length and you can only draw lines in one direction:
Code: Select all
void MakeLine(int X, int Y)
{
    int xPer = view.x + view.width - X;
    int yPer = view.y + view.height - Y;
    moveto(X, Y);
    lineto(X - xPer, Y - yPer);
}

Yes, I know that it's really simple but it works. I'm using it to create a 3d platformer test :)

Re: Best game you made?

PostPosted: Wed Nov 16, 2011 2:25 am
by Hblade
=D

Swap Animations
Code: Select all
void AnimSwap(char *animation1, char*animation2, char *actorr) {
    Actor*a=getclone(actorr);
    if(a->animindex==getAnimIndex(animation1) && a->animindex!=getAnimIndex(animation2)) {
        ChangeAnimation(actorr, animation2, FORWARD); }
}


THis code is untested and was just now typed out xD what it'll do is swap the first animation with the second one but ONLY WHEN that animation is called. So it wont be a constant animation change. usage:
Code: Select all
AnimSwap("Walk Left", "Walk Right", "PLAYER");

Re: Best game you made?

PostPosted: Wed Nov 16, 2011 3:33 am
by skydereign
The problem with that function is that you can't use it on other actors. The actor whose animations you are switching has to be the event actor.

Re: Best game you made?

PostPosted: Wed Nov 16, 2011 4:25 am
by Hblade
but I thought 'a->animindex==getAnimIndex(animation1)' would clear that up :P a-> points to the actor. o.o its like saying "if PLAYER.animindex==..." :D right?

Re: Best game you made?

PostPosted: Wed Nov 16, 2011 4:31 am
by skydereign
The a->animindex part works fine. The problem is you are relying on getAnimIndex, which will get the animindex of the event actor's animation, not the clone.

Re: Best game you made?

PostPosted: Wed Nov 16, 2011 4:34 am
by Hblade
Oh! That makes sense.hmm... eh its no biggie =P Thanks for pointing that out sky =)

Re: Best game you made?

PostPosted: Wed Nov 16, 2011 11:36 am
by JamesLeonardo32
This topic's a little off topic.

I like.

Re: Best game you made?

PostPosted: Wed Nov 16, 2011 5:31 pm
by Hblade
lol and the topic likes you!.. and cookies.