Javascript final project



I just wanted to share my approach to the final javascript project. Instead of using pop up windows I just made a website as the environment for the game. I hope you guys like it. I have never done any programming before discovering codeacademy so it's a big thing for me guys, sharing my first stuff online. I appreciate all the critique, suggestions and feedback! Cheers!

Javascript Final Project

Oh, I tottaly forgot to add - the site is not optimized for all browsers, in fact I just did it so I have some kind of visual representation of the code so my advice is play it on Google Chrome and I suggest doing it on fullscreen. :smile:


uhh nerf rats, infinite damage :<

(0 DEF, i suppose it might be considered a feature.. working as intended)

The respec button pops up right under the defence button when allocating attributes!

You're not getting away with this though:

Round 2
Enemy turn
mutated rat hits you for 0 damage
Game over!
Your hp dropped below 0
(All DEF after the previous misadventure)
..oh, 0 health... But I definitely didn't drop below 0!

I have my build now.
10 hp
2 atk
remaining def!
pretty sure i will win now

This is interesting..

hit = Math.floor(atk * (enemies[enemy].atk / enemies[enemy].def));
var ehit = Math.floor(enemies[enemy].atk * (atk / def));

But doesn't it make attack a useless stat other than for speeding up the game? I haven't really thought it through : D


0 def?:stuck_out_tongue:

I need to try it :stuck_out_tongue:

hit = Math.floor(atk * (enemies[enemy].atk / enemies[enemy].def));
var ehit = Math.floor(enemies[enemy].atk * (atk / def));`

I thought the equation is quite reasonable. From all the different approaches this one seemed most interesting.

But what do you think about the game itself?


What I think of the game? I see it more as a technical achievement. Haha sorry, wrong person to ask.


Hi I'm Frank. I just made it to the end of the Javascript section and thought I would check out some of the projects before starting mine.

Well done! Your game looks great and everything ran smoothly on my end. I liked how you made it as a website, how you set up the attribute allocation screen, and the 'progress badges' that popped up throughout the game were a nice touch.

Some thoughts:

  • If I had "food:3 water:1" and the travel cost was "food:1 water:3," the display would show that the travel consumed 1 food and 1 food for +1 water penalty, and I was left with" food:1 and water:0." I felt like if the water cost was 3, and I only had 1, it should be a +2 water penalty - and left me with 0/0. Also - I think it let me travel if I had like 1 food, 0 water, and the travel cost was 3 food 1 water. It felt like I should have died during travel from doing that.

-Before the fights, it would be cool to see how many hit points the enemy had before deciding to attack.

-I'm not quite sure on this, but there didn't seem to be any variability in the attacks. Once a fight started, if I was hit for 12 damage, and I hit them for 14 damage, each subsequent strike on me would be for 12 damage, and on them for 14 damage.

Again, great game. You must have put a lot of work into it and you inspired me to do something bigger than what I was planning.



For some reason it won’t load. Do you have it anywhere else so I can see it? I want to use a website as well instead of pop up windows so it would be awesome to check it out (I did use Google Chrome to try and open it tho)