Page 1 of 1
Sliding Skeleton!
Posted:
Thu Sep 08, 2011 3:51 pm
by Hblade
- Code: Select all
if (transp==0) {
if (distance(x, y, COLBOX.x, COLBOX.y)<325) {
timer++; if (timer==1 || timer==11) {
CreateActor("TEST", "Skeloton 1 Shot - Sprite Sheet", "(none)", "(none)", 0, 0, false);
}
if (timer==100) {
timer=0; }
if (enhp<2 && yvelocity<2 && timer2==0) {
if (x<COLBOX.x) {
x+=1;
ChangeAnimation("Event Actor", "WalkRight", NO_CHANGE);
}
if (x>COLBOX.x) {
x-=1;
ChangeAnimation("Event Actor", "WalkLeft", NO_CHANGE);
}
}
if (enhp>=2) {
ChangeAnimation("Event Actor", "Death", NO_CHANGE);
CreateActor("Explosions", "FIRE", "(none)", "(none)", rand(14)-7, rand(14)-7, false);
}
if (timer2==20) {
timer2=0; }
yvelocity+=.4;
}
if (timer2>=1) {
timer2++;
}
}
r+=50;
g+=50;
b+=50;
if (RESPAWN==1) {
transp=0;
enhp=0;
timer=0;
timer2=0;
timer3=0;
xvelocity=0;
yvelocity=0;
SKELIACTIVE=0;
x=SKELYX;
y=SKELIY; }
Alright so heres my problem, the skeleton SLIDES when moving right! This happened out of noware too! Last night it was perfectly fine, now I open up game editor this morning to play test it (Didn't even LOOK AT any code), and suddenly the skeletons Spaz out when walking left! not right but left! Any help?... This is the skeletons AI code.
Re: Sliding Skeleton!
Posted:
Thu Sep 08, 2011 5:06 pm
by NERDnotGEEK
Looking at your code it seems sound.
I made a small game and used your code in it, it seemed to work fine. can you define spazzing out?
Re: Sliding Skeleton!
Posted:
Thu Sep 08, 2011 5:17 pm
by ikarus
Does it do it exported?
Re: Sliding Skeleton!
Posted:
Thu Sep 08, 2011 5:19 pm
by Hblade
Yeah it does it exported too. I can't figure it out. Sometimes he will just face left and slide, sometimes he will repeatedly and rapidly change animation.
Like I said It was working fine last night, (saved the game, all that) and this morning I go to play test it without even bothering any actors at all, and boom it glitches.
Re: Sliding Skeleton!
Posted:
Thu Sep 08, 2011 5:40 pm
by NERDnotGEEK
is this the only piece of code that attempts to change the skeletons animation?
Re: Sliding Skeleton!
Posted:
Thu Sep 08, 2011 7:35 pm
by Hblade
Yes it is. strangely.
Re: Sliding Skeleton!
Posted:
Thu Sep 08, 2011 9:12 pm
by NERDnotGEEK
well its late so my brain has stopped working
you are aware that your change animation direction setting is set to NO CHANGE right? if when you refer to the skeleton sliding do you mean the animation is not playing?
send me the ged and ill be able to get a better understanding of what exactly is going wrong and ill be able to try some things to fix it if you like
declare the variable "face" and try this code in your codes place, just added in a small part to stop any bugging out of left and right, worth a try if you have yet to fix it
- Code: Select all
if (transp==0) {
if (distance(x, y, COLBOX.x, COLBOX.y)<325) {
timer++; if (timer==1 || timer==11) {
CreateActor("TEST", "Skeloton 1 Shot - Sprite Sheet", "(none)", "(none)", 0, 0, false);
}
if (timer==100) {
timer=0; }
if (enhp<2 && yvelocity<2 && timer2==0) {
if (x<COLBOX.x) {
face = 1;
}
if (x>COLBOX.x) {
face = 2;
}
}
if (enhp>=2) {
ChangeAnimation("Event Actor", "Death", NO_CHANGE);
CreateActor("Explosions", "FIRE", "(none)", "(none)", rand(14)-7, rand(14)-7, false);
}
if (timer2==20) {
timer2=0; }
yvelocity+=.4;
}
if (timer2>=1) {
timer2++;
}
}
if (face == 1)
{
x+=1;
ChangeAnimation("Event Actor", "WalkRight", NO_CHANGE);
}
if (face == 2)
{
x-=1;
ChangeAnimation("Event Actor", "WalkLeft", NO_CHANGE);
}
r+=50;
g+=50;
b+=50;
if (RESPAWN==1) {
transp=0;
enhp=0;
timer=0;
timer2=0;
timer3=0;
xvelocity=0;
yvelocity=0;
SKELIACTIVE=0;
x=SKELYX;
y=SKELIY; }
Re: Sliding Skeleton!
Posted:
Thu Sep 08, 2011 11:15 pm
by Hblade
That didn't work either. And for some reason, when you pass ONE of them, they all work fine (left and right) but when your on the left side of the first skeleton, they stop working again...
Re: Sliding Skeleton!
Posted:
Fri Sep 09, 2011 5:17 am
by lcl
Is COLBOX the player actors collision box?
Re: Sliding Skeleton!
Posted:
Fri Sep 09, 2011 7:55 am
by skydereign
Ok, well, I found your problem, and it indeed is a problem with gE. You are relying on sequences. Currently in gE 1.4 versions, sequences are broken. Every clone using them will increase all of their frames. So, if you have two of them, with an animation at 1fps, then they will move at 2fps, and so on. It just happened to be that you have just enough clones that are facing left, that you wouldn't see an animation change. Same goes for your right moving animation. I reported this a while back, and as far as I know has not been fixed, but it is a pretty major problem. The only fix is to use actual animations.
Re: Sliding Skeleton!
Posted:
Fri Sep 09, 2011 12:57 pm
by akr
Sky, I am happy that u found the problem. Thanks a lot! I saw a ticket some time ago about this. Can u point me to or give me the number?
thx
andreas
Re: Sliding Skeleton!
Posted:
Fri Sep 09, 2011 2:03 pm
by Jagmaster
Shoot, I'm using animation sequences as well.
Hblade, by sliding, do you mean the animation kind of stops and then goes at twice the fps? if so, that's the same problem I'm having.
(These are on clones that are parented to a collision block.)
Well, I guess I'll try replacing them with regular old animation strips. I have a question Sky, do you think it will glitch out the same way if I had a single animation with multiple files?
Re: Sliding Skeleton!
Posted:
Fri Sep 09, 2011 3:08 pm
by Hblade
Thank you so much sky!
Thank goodness the sequences work fine for the player O-o
Re: Sliding Skeleton!
Posted:
Fri Sep 09, 2011 10:34 pm
by skydereign
akr, it is ticket number 35.
http://sourceforge.net/apps/trac/game-editor/ticket/35And, Jagmaster, multiple filed animations work fine.
Re: Sliding Skeleton!
Posted:
Fri Sep 09, 2011 11:00 pm
by Jagmaster
Thanks for clearing that up Sky.