Date post: | 02-Dec-2014 |
Category: |
Software |
Upload: | duy-tan-geek |
View: | 120 times |
Download: | 3 times |
Game development with
Cocos2d-x Engine
Why need Game Engine
Create a Game
Everyone has creativity
We might want to clone a existing game
We have a good idea for game
Writing Game is COOL, and We are COOL!!!
Game Engine help us
Faster Development
Easier Development (You might don't know
OpenGL...)
Abstract Layer (You might need to port your game to
another platform....).
Focus on FUN
If you spend more time on fighting with code, you has less time
to think about your game, especially most of us are independent
programmer
Game Engine might has Sprite, Scene, Animation
Modifier
Particle System
Event Handling
Game Thread
Renderer
Physics Engine
Collision Detection
Script Language
Mobile Game Frameworks Landscapes
Corona
Unity
Cocos2d-x
Many other…
Corona
2D Game Framework
Support iOS, Android
Lua
Closed Source
Free to use Starter Version
Http://corolalabs.com
Unity 3D
2D,3D Environment for creating game
Support Desktop, Android, iOS, BlackBerry
C#, JavaScript
Closed Source
Free to develop and publish
Http://unity3d.com
Cocos2d-x
2D Game Framework
iOS, Android, Windows Phone, Desktop
Open Source
C++ 11 (from version 3.0)
www.cocos2d-x.org
Why use Cocos2d-x
Cross Platform
Open source engine game
High Performance
A game engine proven by the community
Why use Cocos2d-x
Why use Cocos2d-x TOP GAMES
Developer
Partners of Cocos2d-X
Platform&Contributors
Architecture
Modules Graphics and Animation
Audio
GUI
Data Structure
Physic
Network
Events System
Schedule and Timer Callbacks
Input
Memory management
Debugging, File Stream
Graphics& Animation Scene
Layer
Sprite
Node
Action
Node Anything that gets drawn or contains
things that get drawn is a Node
The most popular Nodes are:
Scene, Layer, Sprite, Menu.
Node The main features of a Node are:
o They can contain other Node nodes
(addChild,removeChild,etc)
o They can schedule perodic callback (schedule,
unschedule, etc)
o They can execute actions (runAction,
stopAction,etc)
Scene Scene an Node are almost identical with the difference that Scene
has it’s anchor point at center of the screen
Layer
Layer is a subclass of Node that implement
TouchEventsDelegate protocol
All features from Node are valid, plus the following
new features:
• It can receive touch event
• It can receive Accelerometer input
Sprite
Sprite
Sprite is a 2D image
Sprite can be created with a image, or with sub-
rectangle of image
Objects in the game was created by a Sprite or its
subclasses
Action
Action
Actions are orders given to a Node object
These actions usually modify some of the object’s attributes like position, rotation, scale, etc.
Basic Action
• Position : MoveBy, MoveTo, JumpBy, JumpTo, etc.
• Scale : ScaleBy, ScaleTo.
• Rotate : RotateBy, RotateTo.
• Visibility : Show, Hide, Blink.
• Opacity : FadeIn, FadeOut, FadeTo.
• Color : TintBy, TintTo.