在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:IceCreamYou/HTML5-Canvas-Game-Boilerplate开源软件地址:https://github.com/IceCreamYou/HTML5-Canvas-Game-Boilerplate开源编程语言:JavaScript 97.0%开源软件介绍:This project makes starting an interactive 2D Canvas application fast and easy, even for developers who have never used Canvas before. The project includes a stripped-down version of HTML5 Boilerplate and adds some Canvas-specific boilerplate and a couple of useful JavaScript abstractions. In other words, it includes the code you were going to write for every canvas project anyway, plus a few tools for rapid prototyping of common features. Thorough documentation is an explicit goal of this project. It should be easy to learn, use, and get started. Getting StartedFirst, fork and To get started building, open up main.js. There are three functions there which are the backbone of your application:
These functions are called automatically for you. Just fill in the logic! To see your project, open index.html in your browser. By default, it has a keyboard-controlled player who can wander around. At this point you can dive in and start building right away, explore more features, or dig deeper into the documentation:
Features
You can also read a complete overview of everything this project provides. Why use H5CGB instead of a game engine?H5CGB is not a game engine -- it provides boilerplate HTML, CSS, and JavaScript, as well as some lightweight, easy-to-learn, rapid prototyping tools for any 2D canvas-based project. Because it's a boilerplate, you can edit all the files and use this project as a base rather than include a monolithic magic library. Or, if you want, you can also drop in a game engine on top of this project. It's also standards-compliant, modular, and thoroughly documented. H5CGB is a good choice if you just want to get going quickly without learning a bunch of opinioniated, engine-specific APIs, or if you are mainly interested in avoiding setup but want control over the details. Sometimes game engines are just overkill, or too overwhelming to learn, or try to do too much for you. Why use H5CGB instead of starting from scratch?H5CGB takes care of a lot of code you'd be writing yourself, and doesn't add much that you wouldn't need to write yourself. This includes standards-compliant HTML, CSS, and other web files in addition to the JavaScript code that sets up the canvas, animation loop, image caching, etc. In any case, the JavaScript is quite modular, so you can always edit or delete anything you don't want. NotesThis project is MIT-licensed. Compatible with all modern browsers, meaning not IE8. Also works in modern mobile browsers as long as you accommodate mobile input methods. The Paint demo is a good example of this. Contributions are welcome! CreditsIsaac Sukin (@IceCreamYou) is the author of this project. I'd love to hear what you make! Many other people wrote jQuery, classes.js, console-extras.js, stats.js, and parts of jQuery.hotkeys; they are credited in their respective files. Additionally, many people contributed to H5BP, from which most of the HTML and CSS, .htaccess, and robots.txt rules originated. Thanks also to JSDuck for providing the framework for the documentation site, and to Atari for the original image used to derive the centipede example sprite. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论