Sunday, September 20, 2015

javascript - Making a way to fight monsters in my clicker game


I want a working next and previous button for killing monsters http://prntscr.com/o375y7 http://prntscr.com/o37609 Im new to this concept so i don't know how to go about doing this.


html code(all i have so far)


  Rat   Hp: id="CurrentEnemyHp">10    















The "Rat" in the middle of the button stuff should be like "span id="currentenemy" span" just didnt know how to set up my switch statement or array to be able to switch between current enemy, hp and damage from clicking the next button. if someone can help me set it up id appreciate it. never used this concept before.


I expect after my program is running for the next button to be by itself disabled until you kill a rat 10 times then it becomes enabled then after you click it for the enemy to change and hp to change(damage to) then the previous arrow will become unhidden. But my actual output i can't get this to work.




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...