d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > A Few Hundred Lines Of Javascript > Stupid Stuff Is Happening
Add Reply New Topic New Poll
Member
Posts: 13,155
Joined: Nov 12 2008
Gold: 633.00
Jul 19 2017 11:30am
I am creating a silly game just to get used to programming game logic for simple somewhat incremental games.

The code can be found here: https://github.com/mastaerf/Tiny-Game2 (I hope that works....this is my first time using GitHub)

The stupid issue I am having Can be seen https://www.youtube.com/watch?v=_GQaPiwZYkU&feature=youtu.be at about 3:30

In short: I used some for loops to generate some html buttons. When I click one that should give me 'nurses' the first 10 give me nurses. Any after that might give me greaterHives as well as nurses......

Any help would be appreciated.



/edit:

The issue most likely lies in the fact that I tried to be clever. I noticed that In one area I was going to have a lot of if statements that had the same characteristics (if this condition, then subtract from these and add to those). So I made a function that handles that and called to that function elsewhere.

This post was edited by mastaerf on Jul 19 2017 11:55am
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
Jul 19 2017 02:34pm
line 166, 167, 168: missing break
Member
Posts: 13,155
Joined: Nov 12 2008
Gold: 633.00
Jul 19 2017 05:31pm
Quote (nuvo @ Jul 19 2017 01:34pm)
line 166, 167, 168: missing break


Thank you! I knew it had to be something small(yet huge).
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll