dwjohnston / dwjohnston/vibe-coded-nemon
Create the game 'nemon'
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Vibe code up the classic DOS game _Nemon_.
## Application Requirements
- Create this as a Vanilla JS SPA.
- Use Vite as the bundler.
- Use TypeScript.
- Use canvas as the drawing output.
- The game uses keyboard input only. When the user is focused on the browser page, keyboard events should be captured as input.
- For mobile users display controlling keys - four directional keys on the right and a 'fire' button.
## Instructions for interpreting the instructions
- The game rules section will reference variables like: N_TILES_WIDTH (15) - in this case a globally accessible variable should be created and the number in brackets should be the initial value. It should be easy for a developer to then change these values.
## Game rules
### Game board, entities
- The game takes place on a N_TILES_WIDTH (15) by N_TILES_HEIGHT (15) board.
- The game is 2d live action game. The entities that exist on the board are:
- The player's avatar - a flash light. A torch beam will extend in the direction the torch is facing until it hits any other board entity.
- Blocks.
- The dragon.
- Fire ball
- Fire.
- Keys.
Only a single entity can exist on each board tile. (Exception: The flash light can move on to the tile that a key exists to collect it).
- When the user presses the arrow keys the flash light will orient itself in that direction and move in that direction if possible.
- The user can move a maximum of once every TIME_PLAYER_MOVE_COOLDOWN_MS (100)
### Game objective, levels, stages
- The game consists of 3 stages each having 7 levels.
- Level 1 of each stage starts with 3 keys, (1, 2, 3). The player's objective is to collect all the keys, in order.
- Collecting a key earns the player POINTS_COLLECT_KEY (200)
- Completing a level earns the player POINTS_COMPLETE_LEVEL (1000)
- When the level is complete the next level starts, it has one more key.
- In stage 1 the keys start visible on the player board.
- In stage 2 the keys are invisible, until the flashlight's beam has illuminated them, at which point they remain visible.
- In stage 3 the keys are invisible, and are only visible while the flashlight's beam is on them.
### Blocks
- Each level has a timer starting with the value TIME_LEVEL_INIT_TIME_SECONDS (30)
- This timer counts down once the game starts.
- Every TIME_NEW_BLOCK_INTERVAL_MS (1000) a new block will appear randomly on the board, in an empty tile.
- If the timer reaches 0 the board fills with blocks and the game is only.
- A user can destroy blocks by aiming the flashlight at them, and pressing and holding space bar (fire) key.
- Destroying a block takes TIME_BLOCK_DESTROY_TIME_MS (100) and earns the player POINTS_DESTROY_BLOCK (100). It also increases the game time (TIME_BLOCK_DESTROY_TIME_AWARD_SECONDS (1).
- Multiple blocks can be serially destroyed in one hold of the space bar key, in which case each subsequent block earns a bonus based on the variable POINTS_SERIAL_DESTROY_FACTOR (1.5) eg. say the users destroys three blocks in one space bar hold, they earn 100 for the first block, 150 for the second block and 225 for the third block.
### The Dragon
- A dragon exists on the game board.
- It has an orientation like the flash light.
- Every TIME_DRAGON_MOVE_MS (200) the dragon moves in a random direction. It has a bias to moving toward the torch.
- Every TIME_DRAGON_FIRE_MS (300) the dragon fires a fireball.
- The fireball moves in a straight line in the direction the dragon is oriented.
- The fireball moves at a speed of TIME_FIREBALL_MOVE_SPEED_MS (50) per tile.
- The fireball will stop at a random tile between the dragon and the next board entity and become a fire entity.
- If the dragon is oriented towards and immediately adjacent to the flashlight and the dragon fires, the player is killed and the game is over.
- If the dragon is oriented towards and immediately adjacent to any other board entity, the dragon will move instead of firing.
- Fires can not be extinguished except for naturally burning out.
- Fires will naturally burn out in a random time between TIME_FIRE_BURN_MIN_MS (3000) and TIME_FIRE_BURN_MAX_MS (5000).
- The dragon can be destroyed in the same manner blocks can be, in which case the player earns POINTS_DESTROY_DRAGON (1000). These points are subject to the same serial destroy bonus.
- The dragon will respawn after after TIME_DRAGON_RESPAWN_SECONDS (30)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.