Game-JAVA / Low-Code

Project to create the PacMan Game in Java for teaching purposes.
MIT License
0 stars 0 forks source link

20 - Atualizar Diagrama UML #25

Open ricardofsilva7 opened 5 days ago

ricardofsilva7 commented 5 days ago

Diagrama de Classes


---
title: UML Diagram
---

classDiagram

Character <|-- PacMan
Character <|-- Ghost
MazeBlock <|-- GameBoard

class GameBoard {
    - pacMan: PacMan
    - ghosts: Ghost[]
    - dx: int
    - dy: int
    - 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
    + start(Stage): void
    + loadImages(): void
    + initializeMap(): void
    + initializeCharacters(): void
    + drawMap(GraphicsContext): void
    + drawCharacters(GraphicsContext): void
    + handleKeyPressed(KeyEvent): void
    + handleKeyReleased(KeyEvent): void
    + checkCollision(): void
    + update(): void
    + ghostLocation(int, int)
    + isGhostAt(int, int): boolean
    + 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
    + setX(int): void
    + setY(int): void
}

class PacMan {
    - image: Image
    - direction: String
    - lastMoveTime: long
    - moveInterval: long
    - gameBoard: GameBoard
    + PacMan(int, int, int, Image, GameBoard)
    + draw(GraphicsContext): void
    + move(int, int, MazeBlock[][]): void
    + collectPellet(MazeBlock[][]): void
    + setImage(Image): void
    + getDirection(): String
    + setDirection(String): void
    + setMoveInterval(long): void
}

class Ghost {
    - image: Image
    - direction: String
    - lastMoveTime: long
    - moveInterval: long
    + Ghost(int, int, int, Image)
    + draw(GraphicsContext): void
    + move(int, int, MazeBlock[][]): void
    + setImage(Image): void
    + setDirection(String): void
    + setMoveInterval(long): void
}

class MazeBlock {
    - type: int
    - x: int
    - y: int
    - tileSize: int
    + MazeBlock(int, int, int, int)
    + draw(GraphicsContext): void
    + isWall(): boolean
    + isPellet(): boolean
    + setType(int): void
}
scryng commented 2 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
}