Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Kirillentity : Mob
- {
- MobState state;
- Animation idle;
- Animation move;
- Animation attack;
- Sprite[] idleFrames;
- Sprite[] moveFrames;
- Sprite[] attackFrames;
- update(deltaTime)
- {
- if (state == ATTACK)
- {
- if (attack.update(deltaTime)) // Если анимация атаки завершилась
- {
- state = IDLE;
- }
- }
- }
- draw(sb)
- {
- if (state == IDLE) sb.drawSprite(idleFrames[idle.currentFrameIndex]);
- if (state == MOVE) sb.drawSprite(moveFrames[move.currentFrameIndex]);
- if (state == ATTACK) sb.drawSprite(attackFrames[attack.currentFrameIndex]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment