Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the object-oriented JavaScript framework of Enchant js?

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces what the Enchant js object-oriented JavaScript framework is like, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Enchant.js is a modular, object-oriented JavaScript framework that uses html5 to create simple APP and games. It is open source based on the MIT protocol, so open source is free to use. 3D animation and game open source are created using additional plug-ins (based on WebGL).

Characteristics of enchant.js

Enchant.js is a Japanese HTML5 game engine, is a small sparrow with five internal organs, the core source code readability is very good, to make up for the lack of documentation weakness. It is also very convenient to use, as follows:

Enchant ()

_ window.onload=function () {

Game=newGame (500500)

Game.start ()

}

Specific logic specific addition, the official provides a lot of demo, and even provides picture material, can meet their own learning and entertainment use.

Enchant.js object programming

I am not very familiar with js object-oriented programming, many places are confused about the source code, and its use is quite profound in my eyes. However, I found its way of using canvas by reading the code, so I took advantage of this engine to write canvas.

Varsurface=newSurface (100100); / / parameters are written blindly

Then you can write canvas code through surface.context. Thus completed the two games of Snake and Tetris (Snake is actually a rewrite of the lua code of some great god. I have written it myself, but there are many bug and the code is messy, so I directly abandoned it. )

Later, I also saw other html5 game engines, which either made me feel over-touted or slightly higher. That's all I wanted to do, and it would be too expensive to learn how to use it. So I finally confirmed this enchant.js as the choice for me to study in depth (and I have read a lot of engine source code in the previous practice, quite a bit of emotion in …... )

The game engine generally has a genie concept, and there is also this, but if you think you really want to do something serious, you might as well learn Unity (in fact, I do want to learn, official textbooks have bought orz), this H5 js engine, can maximize its flexibility, open source everything in their own hands.

On how the Enchant js object-oriented JavaScript framework is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report