public void Handle(ChunksWalker walker, List <Vector2> convex) { int state = walker.State(); if (state == 15) { walker.Jump(-walker.tileWidth, -walker.tileHeight); } else if (walker.Direction() == ChunksWalker.DIRECTION_STAY) { // start point convex.Add(walker.Pos()); if (state == 1 || state == 5 || state == 13 || state == 9) { walker.WalkUp(); } else if (state == 2 || state == 3 || state == 7 || state == 6) { walker.WalkRight(); } else if (state == 8 || state == 10 || state == 11) { walker.WalkDown(); } else if (state == 4 || state == 12 || state == 14) { walker.WalkLeft(); } convex.Add(walker.Pos()); } }
public void Handle(ChunksWalker walker, List <Vector2> convex) { int direction = walker.Direction(); if (direction == ChunksWalker.DIRECTION_STAY) { return; } int state = walker.State(); if (state == 2 || state == 3 || state == 7 || (direction == ChunksWalker.DIRECTION_DOWN && state == 6)) { walker.WalkRight(); convex.Add(walker.Pos()); } }