Skip to content

A first-person game from the perspective of a 2D life form, which makes it a 1D game. Try to make it to level 5 without getting a headache!

License

Notifications You must be signed in to change notification settings

Dunya-8a/2D-to-1D-Game

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1D-Game

A first-person game from the perspective of a 2D life form, which makes it a 1D game. Try to make it to level 5 without getting a headache!

This project has some of the most messy code that I've written in recent years, but I've already spent too much time on it.

You probably shouldn't play if you are sensitive to flashing colors, especially on the "trippy" setting.

You can play it in your browser by clicking on this link.

Controls

Run cd nodeSocketArduino in the terminal to move into the nodeSocketArduino folder and run node app.js to start the server for connecting the controller to the game. Modify the name of your Arduino device if you need to. Then, open the game in your browser (ideally with the VS Code Live Server extension) and use the arrow keys to move. You can also use the mouse to click on the buttons.

Important

To run this game, you need to open it in Google Chrome. Safari and Brave (which is Chromium-based) will not work, as they block certain requests.

State Diagram

                                 ┌──────────────────┐
                                 │   INITIALIZATION │
                                 └──────────────────┘
                                           │
                                           ▼
                                 ┌──────────────────┐
                                 │    GAME RUNNING  │──────────────────────────────┐
                                 └──────────────────┘                              │
                                          │  ▲                                     │
            Player Health > 0             │  │ Player Health <= 0                  │
      ┌─────────────┴────────────────┐    │  │                                     │
      │                              │    │  │                                     │
      ▼                              │    │  │                                     │

┌──────────────────┐ │ │ │ │ │ PLAYER MOVE │<────Key Press─────┘ │ │ │ └──────────────────┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Collectible Found │ │ │ │ │ │ │ │ │ │ │ ▼ │ │ │ ┌──────────────────┐ │ │ │ │ COLLECT ITEM │ │ │ │ └──────────────────┘ │ │ │ │ │ │ │ Items < 3 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ▼ │ │ │ ┌──────────────────┐ │ │ │ │ PLAYER COLLIDE │ │ │ │ └──────────────────┘ │ │ │ │ │ │ │ │ │ │ │ ▼ │ │ │ ┌──────────────────┐ │ │ │ │ ENEMY SHOT │ │ │ │ └──────────────────┘ │ │ │ │ │ │ │ │ │ │ │ ▼ │ │ │ ┌──────────────────┐ │ │ │ │ GAME OVER │<──────────────────────┘ └─────────────────────────────────────┘ └──────────────────┘ ▲ │ │ │ │ │ Items = 3 │ │ │ │ │ ▼ ┌──────────────────┐ │ VICTORY │ └──────────────────┘

About

A first-person game from the perspective of a 2D life form, which makes it a 1D game. Try to make it to level 5 without getting a headache!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 91.8%
  • HTML 8.2%