reidobandedo / Goat-Of-The-Hill

A game for Computational Worlds course at UW Tacoma; web-based game.
0 stars 3 forks source link

AI Goats (and humans) still able to move during transition screen #58

Closed ddh closed 8 years ago

ddh commented 8 years ago

Need to remove the goats or disable their controls during transition screens (end-round score screens). Leaving this bug in causes poor performance if left on a transition screen due to AI goats continuously charging, then their charge decays which wastes CPU. It causes my macbook to heat-up and kick in its fan (and rarely does that happen unless I'm running something extremely CPU intensive).

suchk commented 8 years ago

Seems the issue is line 76 in playgame.js, where it calls this.initGoats(). Removing that line seems to get rid of the console output. Can you confirm this fixes the issue?

ddh commented 8 years ago

Tried commenting that line out and it seems to work. PlayGame is a little messy so I'm not sure if there are no side effects of taking that line out. Nothing breaks so far, but then why was it there to begin with?

suchk commented 8 years ago

That's a good question. I'm going to try to redo all of the scene logic. Right now the this.isInTransitionScene variable is being toggled on every scene, which makes the assumption that there will always be a transition scene, then a round scene, then a transition scene, etc. That makes it difficult to add new scenes to the game.

ddh commented 8 years ago

Yeah, try to abstract some of that logic out into functions if you need to and rename some properties/get rid of things. I branched out and tried doing some of it on my own but it was an endless rabbit hole. I'll push it up if you want to take a look. It's far from working but has some better implementations in there.

suchk commented 8 years ago

I'm sure it would be worth taking a look. Can you push that to a separate branch? I'll start working off of that if you've made some progress already.

ddh commented 8 years ago

Sure but some warning, it's a mess. I gave up about halfway and started working on powerups. I'll push it up once I get this last powerup logic finished; say 5-10min?

suchk commented 8 years ago

That's perfect.

ddh commented 8 years ago

Fixed