Open ricardofsilva7 opened 5 days ago
---
title: UML Diagram
---
classDiagram
Character <|-- PacMan
Character <|-- Ghost
MazeBlock <|-- GameBoard
class GameBoard {
- pacMan: PacMan
- ghosts: Ghost[]
- dx: int
- dy: int
- isGameOver: boolean
- gameRunning: boolean
- startTime: long
- mazeLayout: int[][]
- TILE_SIZE: int
- MAP_HEIGHT: int
- MAP_WIDTH: int
- map: MazeBlock[][]
- pacmanRightUp: Image
- pacmanRight: Image
- pacmanRightDown: Image
- pacmanLeftUp: Image
- pacmanLeft: Image
- pacmanLeftDown: Image
- staticGhostUp: Image
- Empty: Image
- Pellet: Image
- SuperPellet: Image
- UpperLeftCornerObstacle: Image
- ObstacleTopRightCorner: Image
- LowerLeftCornerObstacle: Image
- ObstacleLowerRightCorner: Image
- LeftVerticalHalfObstacleOrRightVerticalCornerWall: Image
- RightVerticalHalfObstacleOrLeftVerticalCornerWall: Image
- LowerHalfHorizontalObstacleOrUpperHalfHorizontalWall: Image
- UpperHalfHorizontalObstacleOrLowerHalfHorizontalWall: Image
- LowerRightCurveObstacleOrLowerRightCornerWall: Image
- LowerLeftCurveObstacleOrLowerLeftCornerWall: Image
- ObstacleUpperRightCornerOrWallUpperRightCorner: Image
- ObstacleUpperLeftCornerOrWallUpperLeftCorner: Image
- FullBlock: Image
- FullBlockTopLeftCornerRounded: Image
- FullBlockTopRightCornerRounded: Image
- FullBlockBottomLeftCornerRounded: Image
- FullBlockBottomRightCornerRounded: Image
- Portal: Image
- CageUpperLeftCorner: Image
- CageUpperRightCorner: Image
- LowerLeftCornerCage: Image
- CageLowerRightCorner: Image
- UpperHorizontalHalfCage: Image
- LowerHorizontalHalfCage: Image
- LeftHalfVerticalCage: Image
- RightHalfVerticalCage: Image
- UpperHorizontalHalfCageWithRightDoorCorners: Image
- UpperHorizontalHalfCageWithDoorCornersOnTheLeft: Image
- DoorCage: Image
- gameOverImage: Image
- lifeImage: Image
+ start(Stage) void
+ loadImages() void
+ getImageForType(int) Image
+ initializeMap() void
+ initializeCharacters() void
+ drawMap(GraphicsContext) void
+ drawCharacters(GraphicsContext) void
+ handleKeyPressed(KeyEvent) void
+ handleKeyReleased(KeyEvent) void
+ checkCollision() void
+ update(long) void
+ drawScore(GraphicsContext) void
+ ghostLocation(int, int[][]) int[]
+ resetGame() void
+ main(String[]) void
}
class Character {
- x: int
- y: int
- tileSize: int
+ Character(int, int, int)
+ draw(GraphicsContext) void
+ move(int, int, MazeBlock[][]) void
+ getX() int
+ getY() int
}
class PacMan {
- image: Image
- direction: String
- lastMoveTime: long
- moveInterval: long
- Empty: Image
- score: int
- translateX: DoubleProperty
- translateY: DoubleProperty
- gameBoard: GameBoard
- speed: double
- bufferX: double
- bufferY: double
+ PacMan(int, int, int, Image, Image)
+ draw(GraphicsContext) void
+ move(int, int, MazeBlock[][]) void
+ animateMove(int, int) void
+ collectPellet(MazeBlock[][]) void
+ collectSuperPellet(MazeBlock[][]) void
+ setImage(Image) void
+ getDirection() String
+ setDirection(String) void
+ getScore() int
}
class Ghost {
- initialX: int
- initialY: int
- image: Image
- lastMoveTime: long
- moveInterval: double
- speed: double
- isChasing: boolean
- isExitingBase: boolean
- hasExitedBase: boolean
- CHASE_RANGE: int
- lastDirection: int
+ Ghost(int, int, int, Image)
+ draw(GraphicsContext) void
+ move(int, int, MazeBlock[][]) void
+ move(PacMan, MazeBlock[][], long) void
+ isWithinChaseRange(PacMan) boolean
+ chasePacMan(PacMan, MazeBlock[][]) void
+ exitBase(MazeBlock[][]) void
+ moveRandomly(MazeBlock[][]) void
+ getX() int
+ getY() int
+ setChasing(boolean) void
}
class MazeBlock {
- type: int
- x: int
- y: int
- tileSize: int
- image: Image
+ MazeBlock(int, int, int, int, Image)
+ draw(GraphicsContext) void
+ isWall() boolean
+ isPellet() boolean
+ isSuperPellet() boolean
+ setType(int) void
+ setImage(Image) void
+ getType() int
}
Diagrama de Classes