Node.JS ASCII Game
Table Of Contents
This is a game that runs completely in the command line. The player can move around the screen using the arrow keys. It has animations, screen transitions, collision detection, and even audio support through starting a simple HTTP server and connecting to it.
I am proud of this because it is written all from scratch. And it is the first game engine that I wrote.
Full List Of Technology Used
- Used to write all of the source code
- It uses my NPM dsCom to create colored output and more.
One interesting thing to note about the design of the code of the game is that it has two loops. One for rendering just the ASCII chars and one for running all the logic.
The drawing loop runs a lot faster than the logic loop. This was a great boost to performance. Because simply the logic for the game does not be processed as much as the content that is shown on screen.
Other thing that is interesting is that the game has three kind of things that are displayed. One being the background (which can have animations), the player, and a special object called an entity.
The entity is something is specific to a game screen. It implements an interface with two functions them being run and draw. The run function is ran in the logic loop while the draw function is ran in the draw loop.