public void setOriginalDirection() { originalPoxX = posX; originalPoxY = posY; originalDirection = gameAnimation.animationDirection; }
public void setDirection(int x, int y) { GameAnimationDirection dir = GameDefine.getDirection(gameMovement.PosX, gameMovement.PosY, x, y); gameMovement.setDirection(dir); }
public void playAnimationRPG(GameAnimationType type, GameAnimationDirection dir, OnEventOver over) { animationType = type; animationDirection = dir; int index = 0; int size = safHead.count3[(int)type]; switch (type) { case GameAnimationType.Stand: { index += (int)dir * size; startFrame = index; endFrame = index + size; loop = true; } break; case GameAnimationType.Move: { index += safHead.count3[(int)GameAnimationType.Stand] * 4; index += (int)dir * size; startFrame = index; endFrame = index + size; loop = true; } break; default: break; } if (size == 0) { start = false; if (over != null) { over(); } } else { frame = startFrame; updateFrame(frame); onEventOver = over; start = true; } }
public void originalPosition() { if (originalPoxX == 0 && originalPoxY == 0) { return; } setPos(originalPoxX, originalPoxY); gameAnimation.playAnimationRPG(GameAnimationType.Stand, originalDirection, null); originalDirection = GameAnimationDirection.Count; originalPoxX = 0; originalPoxY = 0; }
public void updateAnimation(GameAnimationDirection direction) { if (!IsAlive) { gameAnimation.stopAnimation(); gameAnimation.clearAnimation(); return; } gameAnimation.playAnimationBattle(GameAnimationType.Stand, direction, null); if (IsActed) { gameAnimation.stopAnimation(); } updateEffects(); }
public void moveTo(GameAnimationDirection dir) { if (movement.isMoving) { return; } int posX = movement.PosX; int posY = movement.PosY; bool exit = false; switch (dir) { case GameAnimationDirection.South: { if (posY + 1 == activeDTL.Height) { exit = true; break; } posY++; } break; case GameAnimationDirection.West: { if (posX == 0) { exit = true; break; } posX--; } break; case GameAnimationDirection.North: { if (posY == 0) { exit = true; break; } posY--; } break; case GameAnimationDirection.East: { if (posX + 1 == activeDTL.Width) { exit = true; break; } posX++; } break; } if (exit || GameRPGPathFinder.instance.isBlock(posX, posY)) { gameAnimation.playAnimationRPG(GameAnimationType.Stand, dir, null); return; } movement.moveTo(posX, posY, false, true, false, 2, onMoveOver); }
public void clearOriginalPosition() { originalDirection = GameAnimationDirection.Count; originalPoxX = 0; originalPoxY = 0; }
public void setDirection(GameAnimationDirection d) { gameAnimation.playAnimationRPG(GameAnimationType.Stand, d, null); }
public void playAnimationBattle(GameAnimationType type, GameAnimationDirection dir, OnEventOver over) { gameAnimation.playAnimationBattle(type, dir, over); }