Developed a web game engine with typescript, open source code

Source: Internet
Author: User

One of the first driving forces to learn computer programming is to want to write their own game, on the other hand very curious about how these games are made out, on the other hand feel that some of the design is unreasonable, I hope that computer games can make people play fun, but not wasting time.

School five years, graduated 10 years, learned to use more than 10 programming languages. There have been several attempts to do the game, but because of the difficulty of mastering the complexity of the game program, are halfway. After reading a book this January, I was re-inspired by my desire to play games.

The book's name is Building JavaScript games, which describes how to use HTML5 technology to draw pictures on a Web page, play sounds, handle keyboard and mouse input, move the image up, and so on, until a basic game engine is built. It also uses four real-world game examples to add functionality to the game engine incrementally, and it's easy to see.

But as the author mentions in the book, not everyone will fully agree with the way the code is organized in the book, and the reader can organize the code according to his own ideas, thus writing a new game engine. Plus now with the typescript tool, you can intuitively use the "class definition" syntax and provide compile-time type checking and code refactoring to help you write concise code and improve development efficiency.

So I used typescript to reorganize and write the sample code in the book, and to add some of my own design, and then from the book of the four games picked three I like with the new written game engine re-implemented again, gradually verify and improve the game engine functions.

Some of the core classes have the following structural relationships:

Source code on GitHub, the purpose of sharing the source code is to reduce the difficulty of developing the game, so that more people can design and make their own desired game.

  • Source code: Https://github.com/J-F-Liu/CanvasGames
  • Play the game: http://canvasgames.net/

Developed a web game engine with typescript, open source code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.