Android Open Source - Sertimus Character Animation






From Project

Back to project page Sertimus.

License

The source code is released under:

GNU General Public License

If you think the Android project Sertimus listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*  Sertimus - A live wallpaper featuring a cute Chao.
  /* w  w  w .j  a  va2s  . c o m*/
    Copyright (C) 2013  Kevin Negrin

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>. */

/*  CharacterAnimation.java - Enumerated type containing a set of predefined
 *   constants that determine the animation being used from a sprite sheet. */

package gameaddict30.wallpaper.sertimus.constants;

import java.util.Arrays;

public enum CharacterAnimation {
  ANIMATION_IDLE_F(0),
  ANIMATION_WALK_F(1),
  ANIMATION_IDLE_B(2),
  ANIMATION_WALK_B(3);
  
  private int row, frameSequence[], delay=1;
  
  private CharacterAnimation(int a) {
    if (a == 0 || a == 2) {
      row = (a == 0) ? 0 : 1;
      frameSequence = new int[] {0};
    }
    
    if (a == 1 || a == 3) {
      row = (a == 1) ? 0 : 1;
      frameSequence = new int[] {0,1,0,2};
      delay = 10;
    }
  }
  
  public int getRow() {
    return row;
  }
  
  public int[] getFrameSequence() {
    return Arrays.copyOf(frameSequence, frameSequence.length);
  }
  
  public int getDelay() {
    return delay;
  }
}




Java Source Code List

gameaddict30.wallpaper.sertimus.DrawThread.java
gameaddict30.wallpaper.sertimus.LogicThread.java
gameaddict30.wallpaper.sertimus.MainCanvas.java
gameaddict30.wallpaper.sertimus.MainService.java
gameaddict30.wallpaper.sertimus.activities.MyPreferencesActivity.java
gameaddict30.wallpaper.sertimus.activities.SetWallpaperActivity.java
gameaddict30.wallpaper.sertimus.constants.CharacterAnimation.java
gameaddict30.wallpaper.sertimus.events.LiveObjectMotionEvent.java
gameaddict30.wallpaper.sertimus.interfaces.InteractiveLiveObject.java
gameaddict30.wallpaper.sertimus.interfaces.TalkableLiveObject.java
gameaddict30.wallpaper.sertimus.objects.BackgroundTile.java
gameaddict30.wallpaper.sertimus.objects.GrassStrands.java
gameaddict30.wallpaper.sertimus.objects.LiveObject.java
gameaddict30.wallpaper.sertimus.objects.Sertimus.java
gameaddict30.wallpaper.sertimus.objects.TalkBubble.java
gameaddict30.wallpaper.sertimus.utilities.Arithmetic.java
gameaddict30.wallpaper.sertimus.utilities.Strings.java