Updated Readme#29
Conversation
| let gameCounter = 0 | ||
| let gameStatus = "playing" | ||
|
|
||
| class Character { |
There was a problem hiding this comment.
What could be the drawbacks of big-sized Class including many methods?
|
|
||
| //appends to game board | ||
| addChar() { | ||
| let $char = $("<div>") |
There was a problem hiding this comment.
Is there any problem if I change the line as const $char?
| } | ||
|
|
||
| if (this.type === "player") { | ||
| $body.on("keydown", e => { |
There was a problem hiding this comment.
If I suggest moving those eventListners to the outside of Class method moveChar(), where you want to put that?
| if (this.type === "player") { | ||
| //mouse targeting | ||
| shootSoundPlayer.play() | ||
| $gameBoard.on("mousemove", e => { |
There was a problem hiding this comment.
If this event listener is moved to the outside, what is the benefit?
| if (pause === false) { | ||
| return | ||
| } | ||
| for (key in enemyList) { |
| const shootSoundPlayer = new Audio("./assets/audio/shootSoundPlayer.wav") | ||
| const $startGame = $(".startGame") | ||
| let level = 1 | ||
| let enemyList = [] |
There was a problem hiding this comment.
What is the difference of let and const?
| @@ -0,0 +1,990 @@ | |||
| const $gameBoard = $(".gameBoard") | |||
There was a problem hiding this comment.
What will be the difference if you wrap the entire code with $(function() { ... }) ?
| } | ||
|
|
||
| spawnEnemy() | ||
| for (key in enemyList) { |
There was a problem hiding this comment.
You may try another iteration like .forEach().
| } | ||
|
|
||
| //60 fps | ||
| requestAnimationFrame(update) |
There was a problem hiding this comment.
Is there any approach that makes your game loop looks slim?
|
Project Workflow: 4 / 5 GlowStrong mindset on difficult logic, ability to make the logic works. GrowYou may use more classes with slim methods. Things to look forTry functional method like |
No description provided.