private void MoveDown() { if (!CurrentScene.GetCollision(X, Y + 1)) { Y++; } else { _facing++; } }
private void MoveLeft() { if (!CurrentScene.GetCollision(X - 1, Y)) { X--; } else { _facing = Direction.North; } }
private void MoveRight() { if (!CurrentScene.GetCollision(X + 1, Y)) { X++; } else { _facing++; } }
private void MoveUp() { if (!CurrentScene.GetCollision(X, Y - 1)) { Y--; } else { _facing++; } }
private void MoveRight(float deltaTime) { if (!CurrentScene.GetCollision(Sprite.Right + Speed * deltaTime, YAbsolute)) { XVelocity = Speed * deltaTime; } else { XVelocity = 0f; _facing++; } }
//move one space up private void MoveUp(float deltaTime) { if (!CurrentScene.GetCollision(XAbsolute, Sprite.Top - Speed * deltaTime)) { YVelocity = -Speed * deltaTime; } else { YVelocity = 0f; _facing++; } }
private void MoveLeft(float deltaTime) { if (!CurrentScene.GetCollision(Sprite.Left - Speed * deltaTime, YAbsolute)) { XVelocity = -Speed * deltaTime; } else { XVelocity = 0f; _facing = Direction.North; } }
private void MoveDown(float deltaTime) { if (!CurrentScene.GetCollision(XAbsolute, Sprite.Bottom + speed * deltaTime)) { YVelocity = speed * deltaTime; } else { YVelocity = 0f; _facing++; } }
private void MoveUp(float deltaTime) { // Move Up if the space is clear if (!CurrentScene.GetCollision(XAbsolute, Sprite.Top - Speed * deltaTime)) { YVelocity = -Speed * deltaTime; } // Otherwise stop and change direction else { YVelocity = 0f; _facing++; } }
private void MoveLeft(float deltaTime) { // Move Left if the space is clear if (!CurrentScene.GetCollision(Sprite.Left - Speed * deltaTime, YAbsolute)) { XVelocity = -Speed * deltaTime; } // Otherwise stop and change direction else { XVelocity = 0f; _facing = 0; } }
private void MoveDown(float deltaTime) { //move down if the space is clear if (!CurrentScene.GetCollision(XAbsolute, Sprite.Bottom + Speed * deltaTime)) { YVelocity = Speed * deltaTime; } //Otherwise stop and change direction else { YVelocity = 0f; _facing++; } }
//Move one space to the right private void MoveRight() { if (X + 1 >= CurrentScene.SizeX) { if (CurrentScene is Room) { Room dest = (Room)CurrentScene; Travel(dest.East); } X = 0; } else if (!CurrentScene.GetCollision(X + 1, Y)) { X++; } }
//Move one space to the left private void MoveLeft() { if (X - 1 < 0) { if (CurrentScene is Room) { Room dest = (Room)CurrentScene; Travel(dest.West); } X = CurrentScene.SizeX - 1; } else if (!CurrentScene.GetCollision(X - 1, Y)) { X--; } }
//Move one space to the down private void MoveDown() { if (Y + 1 >= CurrentScene.SizeY) { if (CurrentScene is Room) { Room dest = (Room)CurrentScene; Travel(dest.South); } Y = 0; } else if (!CurrentScene.GetCollision(X, Y + 1)) { Y++; } }
//Move one space to the up private void MoveUp() { if (Y - 1 < 0) { if (CurrentScene is Room) { Room dest = (Room)CurrentScene; Travel(dest.North); } Y = CurrentScene.SizeY - 1; } else if (!CurrentScene.GetCollision(X, Y - 1)) { Y--; } }