コード例 #1
0
        public void doCharacterAttack(LLESprite playerCharacter)
        {
            if (attack)
            {
                playerCharacter.stopAnimation();

                if (playerCharacter.getDirection() == LLESprite.DIRECTION_DOWN)
                {
                    playerCharacter.startAnimation(32, 35);
                }

                else if (playerCharacter.getDirection() == LLESprite.DIRECTION_RIGHT)
                {
                    playerCharacter.startAnimation(36, 39);
                }

                else if (playerCharacter.getDirection() == LLESprite.DIRECTION_UP)
                {
                    playerCharacter.startAnimation(40, 43);
                }

                else if (playerCharacter.getDirection() == LLESprite.DIRECTION_LEFT)
                {
                    playerCharacter.startAnimation(44, 47);
                }

                else if (playerCharacter.getDirection() == LLESprite.DIRECTION_LEFT_UP)
                {
                    playerCharacter.startAnimation(48, 51);
                }

                else if (playerCharacter.getDirection() == LLESprite.DIRECTION_RIGHT_UP)
                {
                    playerCharacter.startAnimation(52, 55);
                }

                else if (playerCharacter.getDirection() == LLESprite.DIRECTION_RIGHT_DOWN)
                {
                    playerCharacter.startAnimation(56, 59);
                }

                else if (playerCharacter.getDirection() == LLESprite.DIRECTION_LEFT_DOWN)
                {
                    playerCharacter.startAnimation(60, 63);
                }
            }

            attack = true;
        }