@startuml Geometry Dash - Diagramme de classe

skinparam style strictuml
skinparam classAttributeIconSize 0
skinparam classFontStyle Bold
hide enum methods

class GameManager {
  - score: int
  - isPaused: Boolean
  + StartGame()
  + RestartLevel()
  + PauseGame()
  + ResumeGame()
  + UpdateScore(points: int)
}

class Level {
  - name: String
  - musicName: String
  + StartLevel()
  + EndLevel()
  + CheckCompletion(): Boolean
}

abstract class LevelElement {
  - x: Float
  - y: Float
}

abstract class Obstacle extends LevelElement {
  + TriggerEffect(player: Player)
}

class Platform extends LevelElement {
}

class Spike extends Obstacle {
  + TriggerEffect(player: Player)
}

class Portal extends LevelElement {
  - destination: Vector2
  - type: PortalType
  + Teleport(player: Player)
}

enum PortalType {
  Normal, Gravity, Speed
}

class Bumper extends LevelElement {
  - bounceForce: Float
  + Bounce(player: Player)
}

class LevelEnd extends LevelElement {
  + TriggerEndGame()
}

class Collectible extends LevelElement {
  - points: int
  + Collect(player: Player)
}

class Player {
  - JUMP_FORCE: static const Float = 26.6581
  - SPEED: static const Float = 8.6
  - rigidBody: Rigidbody2D
  - isColliding: Boolean
  - isGrounded: Boolean
  - gravityScale: Float
  + Jump()
  + IsJumping(): Boolean
  + OnCollisionEnter2D(collision: Collision2D)
  + OnCollisionExit2D(collision: Collision2D)
  + ChangeGravity()
  + Die()
  + Respawn()
  + CollectItem(item: Collectible)
}

class LevelLoader {
  + LoadLevel(jsonPath: String): Level
  + UnloadLevel(level: Level)
}

class LevelParser {
  + ParseJSON(jsonData: String): Level
}

class MusicManager {
  - currentTrack: String
  - volume: Float
  + PlayMusic(musicPath: String)
  + StopMusic()
  + SetVolume(level: Float)
}

GameManager *--> Level : <<Manages>>
GameManager --> LevelLoader : <<Uses>>
LevelLoader --> LevelParser : <<Uses>>
Level *--> LevelElement : <<Contains>>
GameManager *--> Player : <<Owns>>
GameManager --> MusicManager : <<Controls>>
Player --> LevelEnd : <<Triggers>>
Player --> Portal : <<Interacts>>
Player --> Collectible : <<Collects>>
Obstacle --> Player : <<Affects>>

@enduml
