Skip to content

feat: add easy, medium, and hard difficulty modes with ghost speed scaling - #38

Open
Shubhankar-P wants to merge 1 commit into
dishu4u:mainfrom
Shubhankar-P:feat/difficulty-levels
Open

feat: add easy, medium, and hard difficulty modes with ghost speed scaling#38
Shubhankar-P wants to merge 1 commit into
dishu4u:mainfrom
Shubhankar-P:feat/difficulty-levels

Conversation

@Shubhankar-P

Copy link
Copy Markdown

Summary

Adds a difficulty selection screen between the title screen and gameplay.
Players choose Easy, Medium, or Hard before the game starts, which adjusts
the game tick rate and therefore ghost effective speed.

Changes

  • Added showDifficultySelect boolean for difficulty screen state
  • Added ghostSpeedMultiplier field (1/2/3 for easy/medium/hard)
  • New applyDifficulty() method sets timer delay: 70ms / 50ms / 30ms
  • Difficulty selection screen rendered in draw() — consistent overlay style
  • Title screen now transitions to difficulty screen instead of game directly
  • Keys 1/2/3 select difficulty and start the game
  • Difficulty re-applied on game restart so chosen mode persists
  • actionPerformed() skips move() while on difficulty screen

How to Test

  1. Launch game → press any key → difficulty screen appears
  2. Press 1 → game starts slow (Easy)
  3. Press 2 → game starts at original speed (Medium)
  4. Press 3 → game starts fast (Hard)
  5. Die and restart → same difficulty applies again

Closes

Closes #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Multiple Difficulty Levels

1 participant