|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
|
|
|
|
|
|
namespace SeeNoEvil.Character {
|
|
|
|
@ -7,8 +9,18 @@ namespace SeeNoEvil.Character {
|
|
|
|
|
Width = AnimationController.Width;
|
|
|
|
|
Height = AnimationController.Height;
|
|
|
|
|
Facing = facing;
|
|
|
|
|
//FIXME Can probably share this code
|
|
|
|
|
switch(Facing) {
|
|
|
|
|
ChooseAnimation(Facing);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Move(Direction direction) {
|
|
|
|
|
if(!Moving) {
|
|
|
|
|
ChooseAnimation(direction);
|
|
|
|
|
base.Move(direction);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ChooseAnimation(Direction direction) {
|
|
|
|
|
switch(direction) {
|
|
|
|
|
case Direction.Up:
|
|
|
|
|
AnimationController.ChangeAnimation(3);
|
|
|
|
|
break;
|
|
|
|
@ -24,23 +36,20 @@ namespace SeeNoEvil.Character {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Move(Direction direction) {
|
|
|
|
|
if(!Moving) {
|
|
|
|
|
switch(direction) {
|
|
|
|
|
case Direction.Up:
|
|
|
|
|
AnimationController.ChangeAnimation(3);
|
|
|
|
|
break;
|
|
|
|
|
case Direction.Down:
|
|
|
|
|
AnimationController.ChangeAnimation(4);
|
|
|
|
|
break;
|
|
|
|
|
case Direction.Left:
|
|
|
|
|
AnimationController.ChangeAnimation(1);
|
|
|
|
|
break;
|
|
|
|
|
case Direction.Right:
|
|
|
|
|
AnimationController.ChangeAnimation(2);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
base.Move(direction);
|
|
|
|
|
public void Scared() {
|
|
|
|
|
switch(Facing) {
|
|
|
|
|
case Direction.Up:
|
|
|
|
|
AnimationController.ChangeAnimation(7);
|
|
|
|
|
break;
|
|
|
|
|
case Direction.Down:
|
|
|
|
|
AnimationController.ChangeAnimation(8);
|
|
|
|
|
break;
|
|
|
|
|
case Direction.Left:
|
|
|
|
|
AnimationController.ChangeAnimation(5);
|
|
|
|
|
break;
|
|
|
|
|
case Direction.Right:
|
|
|
|
|
AnimationController.ChangeAnimation(6);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|