This game is mainly about getting more knowledge about typescript and building a game around it. The base idea is to give users a simple circle which can catch blocks by using the arrow keys. Each level results in having more blocks on your screen with the same time available per level. Your will always be able to only play X amount of levels, which results in a total score at the end of your game.
While my students were starting on a Typescript game, I never used this language before. And even though it could never be 'that hard', I still wanted to make sure I mastered the basics. I focused on implementing the right code standards and eventually created a keyboard based game, which currently lacks any support on touch devices.
Thanks to the wonderful feature 'Github live pages' you can check the live demo here: Check it out!
- Make sure latest versions of node (8.11.2) and npm (5.6.0) are installed
- Install typescript with
npm install -g typescript
- Git clone this project
- Run
npm install
in the root folder for the right tools - Run
npm run watch
in the root folder while developing - Have a web server running with the
/docs
folder as root folder - Add the
dev/config.json
file as it isn't part of the git code. Contents should look like the following code. You can set thefunctionalities.mLab
property tofalse
if configuring the mLab api takes way too much time :-) Also add as much additional 'bad words' to thegame.badWords
property which are important to you, but missing within the dependency package
{
"game": {
"levelsPerGame": 10,
"startElementsPerLevel": 5,
"elementsIncreasePerLevel": 5,
"scorePerElement": 10,
"secondsPerLevel": 10,
"blockSpeed": {
"min": 1,
"max": 5
},
"blockPixels": {
"min": 10,
"max": 250
},
"player": {
"growthFactor": 1.5,
"speed": 2,
"speedIncreaseFactor": 0.2
},
"badWords": ["hitler", "fuck", "slet"]
},
"functionalities": {
"mLab": false
},
"mLab": {
"baseUrl": "https://api.mlab.com/api/1",
"apiKey": "",
"databaseName": "",
"collectionName": ""
}
}
Structure the code better. I've started with the simplest setup, but off course it needs modules/webpack and a more logical folder structure.Better styling with some CSS frameworkStore scores and show a high score listUpdate the high score logic with local storageEnter your name for the high score and show your personal best score- Optional: Make a mobile version without keyboard
- Optional: More interaction in the levels to have a more dynamic feeling, I guess the game could get boring now :-)
- Optional: convert the DOM elements to Canvas elements, because it might perform better in the end
- Find alternative implementation for MongoDB Atlas instead of mLab