Jump to content

  • Log In with Google      Sign In   
  • Create Account

Movement is clitchi and weird


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 vastrolorde   Members   -  Reputation: 110

Like
0Likes
Like

Posted 26 April 2013 - 05:16 AM

public int getFrame(){
        
        if(aeg % 60 == 0){
            if(frame == 0){
                beforeframe = frame;
                frame +=1;
                }
        }
        if(frame != 0){        
            if(frame == 1){
                if(aeg % 30 == 0){
                    if(beforeframe == 0){
                        beforeframe = frame;
                        frame +=1;
                        }
                    if(beforeframe == 2){
                        beforeframe = frame;
                        frame -=1;
                        }
                }
            }
            else if(frame == 2){
                if(aeg % 30 == 0){
                    if(beforeframe == 1){
                        beforeframe = frame;
                        frame +=1;
                        }
                    if(beforeframe == 3){
                        beforeframe = frame;
                        frame -=1;
                        }
                    }
                }
            else if(frame == 3){
                if(aeg % 30 == 0){
                    if(beforeframe == 2){
                        beforeframe = frame;
                        frame +=1;
                        }
                    if(beforeframe == 4){
                        beforeframe = frame;
                        frame -=1;
                        }
                    }
                }
            else if(frame == 4){
                if(aeg % 30 == 0){
                    beforeframe = frame;
                    frame -= 1;
                    }
                }
        }
        
        aeg += 1;
        if(aeg == 61)
            aeg = 0;
            
        return frame;
    }
 

This is my frame selecter code, but it doesent seem to work right. This control eye blinking. speed is easy to adjust just change the values of time and its ok. But the problem is frame selection. It seem to jump over some frames and leave other frames out. and it also dissapears randomly. what could be the problem?


Edited by vastrolorde, 26 April 2013 - 10:05 AM.


Sponsor:

#2 vastrolorde   Members   -  Reputation: 110

Like
0Likes
Like

Posted 26 April 2013 - 06:42 AM

I realised how dumb i am and found my problem :D. So how to i delete this topic?



#3 Glass_Knife   Moderators   -  Reputation: 4997

Like
0Likes
Like

Posted 26 April 2013 - 08:02 AM

You should post back the original question.  We don't delete topics, but like it if whoever finds the solution (even the original poster) posts the answer to help anyone who comes along later with a similar problem.

 

 


I think, therefore I am. I think? - "George Carlin"
Indie Game Programming

#4 vastrolorde   Members   -  Reputation: 110

Like
0Likes
Like

Posted 26 April 2013 - 10:06 AM

Solution to this problem wasnt in this code. It was in the drawing function that made the clitch. I entered the wrong number of frames there and it clitched out. And the oder problem was in the oder of lines. I had to re arrange thel ines and it worked.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS