- Learning Cocos2d-JS Game Development
- Emanuele Feronato
- 218字
- 2021-08-06 19:43:52
The structure of your Cocos2d-JS project
Every HTML5 game is basically a web page with some magic in it; this is what you are going to create with Cocos2d-JS: a web page with some magic in it.
To perform this magic, a certain file structure needs to be created, so let's take a look at a screenshot of a folder with a Cocos2d-JS project in it:

This is what you are going to build; to tell you the truth, this is a picture of the actual project folder I built for the example to be explained in this chapter, which is placed in the WAMP localhost
folder on my computer. It couldn't be any more real.
So, let's take a look at the files to be created:
cocos2d-html5
: This is the folder you will find in the zip archive.index.html
: This is the web page that will contain the game.main.js
:This is a file required by Cocos2d-JS with the Cocos2d-JS function calls to make the game start. You will create this within the next few minutes.project.json
: This is a JavaScript Object Notation (JSON) with some basic configurations. This is what you need to make your game run. Well, almost, because the actual game will be placed in thesrc
folder. Let's see a few other things first.
推薦閱讀
- scikit-learn Cookbook
- JavaScript前端開發模塊化教程
- Drupal 8 Blueprints
- Maven Build Customization
- 深入理解Django:框架內幕與實現原理
- Spring Boot+Spring Cloud+Vue+Element項目實戰:手把手教你開發權限管理系統
- Blockly創意趣味編程
- 零基礎學單片機C語言程序設計
- Multithreading in C# 5.0 Cookbook
- The Professional ScrumMaster’s Handbook
- Extending Unity with Editor Scripting
- TypeScript 2.x By Example
- Natural Language Processing with Python Quick Start Guide
- Instant Automapper
- 官方 Scratch 3.0 編程趣味卡:讓孩子們愛上編程(全彩)