Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Cocos2d-JS Game Development
  • Table Of Contents Toc
Learning Cocos2d-JS Game Development

Learning Cocos2d-JS Game Development

By : Emanuele Feronato
3.9 (11)
close
close
Learning Cocos2d-JS Game Development

Learning Cocos2d-JS Game Development

3.9 (11)
By: Emanuele Feronato

Overview of this book

If you are a Java developer who wants to learn about Java EE, this is the book for you. It's also ideal for developers who already have experience with the Java EE platform but would like to learn more about the new Java EE 7 features by analyzing fully functional sample applications using the new application server WildFly.
Table of Contents (11 chapters)
close
close
9
9. Creating Your Own Blockbuster Game – A Complete Match 3 Game
10
Index

Loading and placing graphic resources


You need to build the game over the blueprint created in the first chapter, so here is the content of the assets folder:

You can see the spaceship, the asteroid you have to avoid, a small circle to create particle effects, and the scrolling background.

You will spend some time trying to understand the background. As the game is 480 x 320 pixels, your background should be at least 480*2=960 pixels wide, which is made by two 480 x 320 seamless images.

With the following image, you will be able to give the player the possibility to fly through an endless cityscape:

All these images need to be preloaded by the loadassets.js file located in src, which will become:

var gameResources = ["assets/background.png","assets/ship.png","assets/particle.png","assets/asteroid.png"];

You also need to make some changes to main.js because this time you want a game in the landscape mode:

cc.game.onStart = function(){
  cc.view.setDesignResolutionSize(480, 320, cc.ResolutionPolicy...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Cocos2d-JS Game Development
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon