Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualvastrolorde

Posted 26 April 2013 - 10:05 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?


#3vastrolorde

Posted 26 April 2013 - 06:40 AM

Delete this topic


#2vastrolorde

Posted 26 April 2013 - 06:38 AM

public int getFrame(){
		
		if(aeg % 60 == 0){
			if(frame == 0){
				beforeframe = frame;
				frame +=1;
				}
		}
		else if(aeg % 10 == 0){
				if(frame != 0){		
					if(frame == 1){
						if(beforeframe == 0){
							beforeframe = frame;
							frame +=1;
							}
						if(beforeframe == 2){
							beforeframe = frame;
							frame -=1;
							}
						}
						
					else if(frame == 2){
						if(beforeframe == 1){
							beforeframe = frame;
							frame +=1;
							}
						if(beforeframe == 3){
							beforeframe = frame;
							frame -=1;
							}					
						}
						
					else if(frame == 3){
						if(beforeframe == 2){
							beforeframe = frame;
							frame +=1;
							}
						if(beforeframe == 4){
							beforeframe = frame;
							frame -=1;
							}					
						}
						
					else if(frame == 4){
						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 for somereason when it reaches the last frame it doesent draw the sprite at all. other sprites work fine but the last one where the eye is closed it doesent draw it.


#1vastrolorde

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?


PARTNERS