https://mattrich98.github.io/SecurityGameRemake/
Plans/Todos:
- To complete this project with my current knowledge + some research.
- To understand what I am doing.
plans:Game timer loop on ticks when play button startsAdd timer that links with timer loopuse math.random api to make enemy and person move random spaces on boardonclick enemy -1 point, onclick person +1 pointpoint system with alert at end saying score.able to restart game from play button without refreshing page-> Alert button refreshes page.play button click -> game loop will startplay button will say "Click to restart" after game loop ended"-> attempted and decided to use 'location.reload();' once alert is closed.To move the player around, i'll make the person and enemy divs reappear and disappear every game interval. Plus they will be split into groups and somehow whilst incorporating math.random.
I recieved advice and I will try to use it well
-
Add a bunch of console.log("gameTime is", gameTime); See what happens.
-
Put a breakpoint in your code. Many browsers will let you do this. If not, use a debugger. Step through the code and look at the variable values.
-
write down what each step of the code will do. Go line by line.
-When I removed the scrollbar in CSS, it cropped the extra enemy div at the bottom so the board div is always full of squares now.
Conclusion:There are things that things that could be changed and improved, but for now I'm happy with the current state of this project as it's playable and fun. In the future, I may come back to polish it up and fix my mistakes.
- The reason I didn't put the gameTime intervals in a loop is because I couldn't figure out how to adjust the loop speed and stop the loop at the same time.