Game development with Cocos2d-x Engine

29
Game development with Cocos2d-x Engine

description

 

Transcript of Game development with Cocos2d-x Engine

Page 1: Game development with Cocos2d-x Engine

Game development with

Cocos2d-x Engine

Page 2: Game development with Cocos2d-x Engine

About Me

Ngoc Le Van

Work at Android Team at Seesaa VietNam Company

Email: [email protected]

Page 3: Game development with Cocos2d-x Engine

Why need Game Engine

Page 4: Game development with Cocos2d-x 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!!!

Page 5: Game development with Cocos2d-x Engine

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

Page 6: Game development with Cocos2d-x Engine

Game Engine might has Sprite, Scene, Animation

Modifier

Particle System

Event Handling

Game Thread

Renderer

Physics Engine

Collision Detection

Script Language

Page 7: Game development with Cocos2d-x Engine

Mobile Game Frameworks Landscapes

Corona

Unity

Cocos2d-x

Many other…

Page 8: Game development with Cocos2d-x Engine

Corona

2D Game Framework

Support iOS, Android

Lua

Closed Source

Free to use Starter Version

Http://corolalabs.com

Page 9: Game development with Cocos2d-x Engine

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

Page 10: Game development with Cocos2d-x Engine

Cocos2d-x

2D Game Framework

iOS, Android, Windows Phone, Desktop

Open Source

C++ 11 (from version 3.0)

www.cocos2d-x.org

Page 11: Game development with Cocos2d-x Engine

Why use Cocos2d-x

Cross Platform

Open source engine game

High Performance

A game engine proven by the community

Page 12: Game development with Cocos2d-x Engine

Why use Cocos2d-x

Page 13: Game development with Cocos2d-x Engine

Why use Cocos2d-x TOP GAMES

Page 14: Game development with Cocos2d-x Engine

Developer

Page 15: Game development with Cocos2d-x Engine

Partners of Cocos2d-X

Page 16: Game development with Cocos2d-x Engine

Platform&Contributors

Page 17: Game development with Cocos2d-x Engine

Architecture

Page 18: Game development with Cocos2d-x Engine

Modules Graphics and Animation

Audio

GUI

Data Structure

Physic

Network

Events System

Schedule and Timer Callbacks

Input

Memory management

Debugging, File Stream

Page 19: Game development with Cocos2d-x Engine

Graphics& Animation Scene

Layer

Sprite

Node

Action

Page 20: Game development with Cocos2d-x Engine

Node Anything that gets drawn or contains

things that get drawn is a Node

The most popular Nodes are:

Scene, Layer, Sprite, Menu.

Page 21: Game development with Cocos2d-x Engine

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)

Page 22: Game development with Cocos2d-x Engine

Scene Scene an Node are almost identical with the difference that Scene

has it’s anchor point at center of the screen

Page 23: Game development with Cocos2d-x Engine

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

Page 24: Game development with Cocos2d-x Engine

Sprite

Page 25: Game development with Cocos2d-x Engine

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

Page 26: Game development with Cocos2d-x Engine

Action

Page 27: Game development with Cocos2d-x Engine

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.

Page 28: Game development with Cocos2d-x Engine
Page 29: Game development with Cocos2d-x Engine