- Notifications
You must be signed in to change notification settings - Fork1
A roguelike dungeon crawler game built with React, Redux, and Node.js
License
NotificationsYou must be signed in to change notification settings
Yahir-F/roguescape
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Play the gamehere!
A roguelike dungeon crawler game built with React, Redux, and Node.js. The game is a single-player game where the player must navigate through a dungeon and defeat monsters to reach the next floor. The game is built with a React frontend and a Node.js backend. The game is deployed on Heroku.
git clone
this repository- Run
npm install
to install all dependencies - Run
npm run develop
to run the app locally - Navigate to
localhost:3000
to play the game. - Run
npm run build
, thennpm start
to generate a build version and run it onlocalhost:3001
Navigate to thedeployed link to play the game. Create an account on the login page and start playing. Use the arrow keys to move around the map. Defeat enemies to gain experience and level up. Enter the pink portal to go to the next floor. The game is over when the player dies.
- User authentication
- User can create an account and login
- User can move around the map
- User can attack enemies
- User can level up
- User can spend coins to increase stats
- User can go to the next floor
- User can see their stats
- User can save their progress
- User can load their progress
- React
- Redux /react-redux
- MongoDB
- Mongoose
- MaterialUi
- rot-js
- Javascript /JSX
- Node.js
- Express
- JWT /JWT Decode
- bcrypt
- tsParticles
- lodash
- swipeable
- toastify
Expand Snippet
// calculate damage and health values and update player/enemy values// gain coins and xp based on floor levelcase'enemy':{constplayerHealth=player.attributes.health;constplayerDamage=player.attributes.damage+player.attributes.bonusDamage;constenemyHealth=newEntity.attributes.health;letenemyDamage=newEntity.attributes.damage-player.attributes.bonusArmor;if(enemyDamage<0){enemyDamage=0;};dispatch({type:DAMAGE,payload:{entityName:newEntity.entityName,dmgValue:playerDamage}});addToLog(`Dealt${playerDamage} damage to${newEntity.entityName} (Current health:${state.entities[newEntity.entityName].attributes.health})`);dispatch({type:DAMAGE,payload:{entityName:'player',dmgValue:enemyDamage}});addToLog(`Recieved${enemyDamage} damage from${newEntity.entityName}`);// check if enemy livedif(enemyHealth>playerDamage){// check if player diedif(enemyDamage>=playerHealth){toast.error("YOU DIED");reset();window.location.reload();return;}}else{dispatch({type:MOVE,payload:{entity:player,vector:vector}});dispatch({type:REMOVE_ENTITY,payload:{entityName:newEntity.entityName}});constbaseXP=Math.floor((5*(state.floor)**2+5));constxpVariance=Math.floor(Math.random()*(baseXP/5)-(baseXP/10));dispatch({type:GAIN_XP,payload:{value:baseXP+xpVariance}});addToLog(`Gained${baseXP+xpVariance} XP`);dispatch({type:LEVEL_UP,payload:{stats:calculateStats,level:calculateLevel}});constbaseCoins=Math.floor((2*(state.floor)**1.5+5));constcoinVariance=Math.floor(Math.random()*(baseCoins/5)-(baseCoins/10));dispatch({type:GAIN_COINS,payload:{coins:baseCoins+coinVariance}});addToLog(`Gained${baseCoins+coinVariance} coins`);}break;}
This Project is licensed under theMIT license.
Yahir Federico | Sean Oh |
---|---|
Github | Github |