Skip to content

qwe #1

@guordemi

Description

@guordemi

let game = setInterval(initGame, 100);

use window.requestAnimationFrame instead of setInterval.

if (snake[0].x > 15 * box) snake[0].x = 0;
don't use magic numbers like 15. Explain value with constants.

let game = setInterval(initGame, 100);
let box = 32;
Bad naming by you. box? Maybe, you mean box size? "initGame" you call this method every 100 milisecond, its game loop.

let box = 32;
If it is constant, use const instead let.

Not bad, in total.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions