From ac2f3e90f6e5571699962f2264f1a7ec8634ab29 Mon Sep 17 00:00:00 2001 From: Zach Dyer Date: Sun, 19 Mar 2017 22:55:39 +0000 Subject: [PATCH] now resting takes about 10 seconds no matter what your stamina level is --- _site/README.md | 12 ++++++++++-- _site/js/game.assets.js | 1 + _site/js/game.player.js | 5 ++++- js/game.player.js | 5 ++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/_site/README.md b/_site/README.md index be4d971..fccfb99 100644 --- a/_site/README.md +++ b/_site/README.md @@ -5,12 +5,20 @@ A topdown roguelike game! This game is in active development. Come join us on ## Instructions -### Install +### Install locally $git clone https://github.com/zachdyer/chrome-rogue.git $cd chrome-rogue $nemo . Open index.html + +### How to setup a Cloud9 development environment -### Demo +To setup your Cloud9 environment copy the SSH link `git@github.com:zachdyer/chrome-rogue.git`. +Go to the Cloud9 dashboard at `https://c9.io/yourusername` and create a new workspace. +Paste the SSH link in the clone from Git field. Select HTML5 environment and +name your workspace. Click create workspace. In bash execute `git checkout` and +wait for the files to download to Cloud9. + +## Demo To demo the game go to https://zachdyer.github.io/chrome-rogue/ diff --git a/_site/js/game.assets.js b/_site/js/game.assets.js index 451286f..62a0c3a 100644 --- a/_site/js/game.assets.js +++ b/_site/js/game.assets.js @@ -1,3 +1,4 @@ +var game = game || {}; game.assets = { files: [ diff --git a/_site/js/game.player.js b/_site/js/game.player.js index 4f8cb03..dcaee6a 100644 --- a/_site/js/game.player.js +++ b/_site/js/game.player.js @@ -151,6 +151,7 @@ game.player = { break; } //Stamina + //Sprinting state if(game.skill.stamina.cooldown > 0) { game.skill.stamina.cooldown -= game.movement.speedPerSecond(1000); game.skill.stamina.exp += game.movement.speedPerSecond(1000); @@ -164,8 +165,10 @@ game.player = { game.player.speed = 4; game.player.sprinting = false; } + //Resting state } else { - if(game.skill.stamina.cooldown < game.skill.stamina.max) game.skill.stamina.cooldown += game.movement.speedPerSecond(500); + if(game.skill.stamina.cooldown < game.skill.stamina.max) + game.skill.stamina.cooldown += game.movement.speedPerSecond(game.skill.stamina.max * 0.1); else game.skill.stamina.cooldown = game.skill.stamina.max; } if(Date.now() - game.combat.coolDown < 200) this.cropX = 0; diff --git a/js/game.player.js b/js/game.player.js index 4f8cb03..dcaee6a 100644 --- a/js/game.player.js +++ b/js/game.player.js @@ -151,6 +151,7 @@ game.player = { break; } //Stamina + //Sprinting state if(game.skill.stamina.cooldown > 0) { game.skill.stamina.cooldown -= game.movement.speedPerSecond(1000); game.skill.stamina.exp += game.movement.speedPerSecond(1000); @@ -164,8 +165,10 @@ game.player = { game.player.speed = 4; game.player.sprinting = false; } + //Resting state } else { - if(game.skill.stamina.cooldown < game.skill.stamina.max) game.skill.stamina.cooldown += game.movement.speedPerSecond(500); + if(game.skill.stamina.cooldown < game.skill.stamina.max) + game.skill.stamina.cooldown += game.movement.speedPerSecond(game.skill.stamina.max * 0.1); else game.skill.stamina.cooldown = game.skill.stamina.max; } if(Date.now() - game.combat.coolDown < 200) this.cropX = 0;