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 Mastering Cocos2d Cross-Platform Game Development
  • Table Of Contents Toc
Mastering Cocos2d Cross-Platform Game Development

Mastering Cocos2d Cross-Platform Game Development

By : Alex Ogorek
4.5 (4)
close
close
Mastering Cocos2d Cross-Platform Game Development

Mastering Cocos2d Cross-Platform Game Development

4.5 (4)
By: Alex Ogorek

Overview of this book

If you are a developer who is experienced with Cocos2d and Objective-C, and want to take your game development skills to the next level, this book is going to help you achieve your goal.
Table of Contents (10 chapters)
close
close
9
Index

Pulse on unit combine


When our units combine, nothing special really happens. So, what we're going to do is add a slight pulse effect. Basically, when two units combine we want the unit to grow in a fashion similar to the button visual we just created (where it expands and then scales down again).

Tip

You can also do fancy things in general when the units spawn, such as particle effects (for example, a subtle explosion/burst effect), sprite animations, and other various things.

The key to polishing is thinking out of the box, yet looking at things you already have within the game to keep the aesthetic consistent and solid.

To carry out the pulsing we desire, since we'll most likely be placing the same code in multiple places, let's create a method that takes in a CCNode object and applies the effect we have in mind. So in MainScene.m, add the following method somewhere in the code (preferably near the combination code):

-(void)pulseUnit:(CCNode*)unit
{
  CGFloat baseScale = 1.0f;
  if (UI_USER_INTERFACE_IDIOM...
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.
Mastering Cocos2d Cross-Platform 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