📄 animchar.java
字号:
/* * AnimChar.java * * Copyright 2000 JJKING Software, Junichi Ito <jun1@mailhost.net> * Permission to use, copy, modify, and distribute this software and its * documentation without fee for NON-COMMERCIAL is free. */import com.sun.kjava.Graphics;/** * This is the super-class for a stateful animation character to * be managed AnimManager. The sub-class has responsible for managing state * of character */public abstract class AnimChar{ /** * The state of character which means manager need not the character * that has this state. The manager removes the character from the list * of managed ones. */ public static final int STATE_HIDE = 0; /** * The reference to manager to get information. */ protected AnimManager mgr; /** * The state of the character. * If the character has this state, the manager remove it from list and stop to manage. */ protected int state = STATE_HIDE; /** * The x coordinate of top-left corner of a character. */ protected int x; /** * The y coordinate of top-left corner of a character. */ protected int y; /** * The duration of the current state continues. */ protected int duration; /** * The flag to control display the character. */ protected boolean appear; /** * This method is invoked when manager starts to manage this character. * The subclass can set initial state by overriding this method. * @param mgr the animation manager. */ public void start(AnimManager mgr) { this.mgr = mgr; } /** * Sets the state. * @param the state of character. */ public void setState(int state) { this.state = state; } /** * Returns the state. */ public int getState() { return state; } /** * Move the character. */ public abstract void move(); /** * Draw the character on the given graphics. * @param g the graphics. */ public abstract void paint(Graphics g); /** * Returns the X coordinate of the character. */ public int getX() { return x; } /** * Returns the Y coordinate of the character. */ public int getY() { return y; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -