GithubHelp home page GithubHelp logo

melcor76 / js-tetris Goto Github PK

View Code? Open in Web Editor NEW
173.0 8.0 52.0 1.2 MB

Read the article of how to make JavaScript Tetris:

Home Page: https://michael-karen.medium.com/learning-modern-javascript-with-tetris-92d532bcd057?sk=a7c22e45395da8322fc55bf3b23a309d

JavaScript 83.09% HTML 13.17% CSS 3.74%
game javascript tetris

js-tetris's Issues

constants.js refactor

Hi,

I was going through the code and in constants.js i saw that it would be neat to have the the Object.freeze been called at a single place i.e. having an array of the items that need to be freezed then run a forEach loop calling the Object.freeze method. I would love to do this if you find it helpful.

Safari Bug: SyntaxError: Unexpected token ';'.

Hello,

Thanks for writing the JS-Tetris tutorial. When using Safari, I am receiving errors in the classes. I also ran your code from Github and received the same errors. There are no errors in Chrome. I am running this on a localhost server. I rarely use classes, so I don't know how to correct the errors.

Error Messages while running your code in Safari:
image

image

Text version of errors
[Error] SyntaxError: Unexpected token ';'. Expected an opening '(' before a method's parameter list. (anonymous function) (board.js:2) [Error] SyntaxError: Unexpected token ';'. Expected an opening '(' before a method's parameter list. (anonymous function) (piece.js:2) [Error] ReferenceError: Can't find variable: Board Global Code (main.js:37) [Log] Live reload enabled. (127.0.0.1, line 66) [Error] ReferenceError: Cannot access uninitialized variable. resetGame (main.js:80) play (main.js:85) onclick (127.0.0.1:32) [Error] ReferenceError: Cannot access uninitialized variable. resetGame (main.js:80) play (main.js:85) onclick (127.0.0.1:32)

Environment:

  • Safari 13.1
  • OS: Mac OS 10.13.6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.