#5150 - blaow - Tue Apr 22, 2003 7:54 am
ok i have a class sprite that has the attributes activeFrame and spriteFrame(an array), these attributes are used for Sprite animation purpose. when i use them like this:
(lets say we pointing the attributes to a sprite with 2 frames)
spriteName.activeFrame = 0;
spriteName.spriteFrame[0]=0;
spriteName.spriteFrame[1]=8;
it works perfectly fine... however when i try to do this
(same thing but in a function in a different class so it can do this process for n sprites)
void setFrame(Sprite name, int numberFrames){
int c2=0;
for(int c=0; c<numberFrames; c++){
name.spriteFrame[c] = c2;
c2=c2+8;
}
my code compiles fine but when the sprite shows it is not animated.. it stays in its activeFrame all the way.. any clues people?
many thanks
_________________
blaow~~
(lets say we pointing the attributes to a sprite with 2 frames)
spriteName.activeFrame = 0;
spriteName.spriteFrame[0]=0;
spriteName.spriteFrame[1]=8;
it works perfectly fine... however when i try to do this
(same thing but in a function in a different class so it can do this process for n sprites)
void setFrame(Sprite name, int numberFrames){
int c2=0;
for(int c=0; c<numberFrames; c++){
name.spriteFrame[c] = c2;
c2=c2+8;
}
my code compiles fine but when the sprite shows it is not animated.. it stays in its activeFrame all the way.. any clues people?
many thanks
_________________
blaow~~