Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub struct GameBoard {
- width: u8,
- height: u8,
- player_x: u8,
- player_y: u8,
- }
- impl GameBoard {
- pub fn new(width: u8, height: u8) {
- GameBoard {
- width,
- height,
- player_x: 0,
- player_y: 0,
- }
- }
- pub fn move_player(&mut self, x: u8, y:u8) {
- self.player_x = x;
- self.player_y = y;
- }
- }
Add Comment
Please, Sign In to add comment