2d game development with starling

30

Upload: juwal-bose

Post on 09-May-2015

1.789 views

Category:

Technology


1 download

DESCRIPTION

Introduction to 2D game development with focus on Starling framework.

TRANSCRIPT

Page 1: 2D Game Development with Starling
Page 2: 2D Game Development with Starling

Me & Csharks

● 10 years of Game Development

● 2D games for PC, Web, iOS & Android

● Eye candy art

● More than 300 games created

● Covers tech like Actionscript, Starling, LibGDX, Cocos2D, OpenFL, Unity, CreateJS, Smartfox Server, Torque etc

● Creators of top games in Job / Management game category

● Active in evangelising game development

Page 3: 2D Game Development with Starling

Some of our games

Page 4: 2D Game Development with Starling

You

Let me know my audience

Page 5: 2D Game Development with Starling

Some 2D Game examples

Page 6: 2D Game Development with Starling

How to make them ?

Page 7: 2D Game Development with Starling

Building blocks of a game

● Art & UI - Artists

● Code - Programmer

● Sound & Music - Sound Artists

● Story & Game Play - Creative Director

● Play testing – Testers

● Marketing team, Publisher, Analytics team, ...

Page 8: 2D Game Development with Starling

Platforms

● PC (Mac , Linux)

● Web

● PS4

● Xbox

● Android

● iPhone, iPad

● Wii, DS, PSP

● Microconsoles, Smart TVs

Page 9: 2D Game Development with Starling

Different tracks for a game programmer

● C++ - Ultimate, Hard, Free, Puli

● Java - Medium, Moderate, Android, Free

● C# - Great, Modern, XNA, Unity, Moderate, Microsoft ?

● Javascript - Web, Unity, Easy, Free, Fragmented

● Starling uses Actionscript which is Java + javascript

Page 10: 2D Game Development with Starling

A Game Engine

We use game frameworks to build our game engine

Page 11: 2D Game Development with Starling

Alternate 2D Game frameworks

● Web - Phaser, CreateJS

● Android - LibGDX (crossplatform), AndEngine

● IOS - Cocos2DX (crossplatform), Sparrow, SpriteKit

Under the hood

● DirectX

● OpenGL / OpenGL ES

Page 12: 2D Game Development with Starling

For the Non – Programmer ???

● Web – Construct 2

● Crossplatform - Gamemaker

Page 13: 2D Game Development with Starling

The slide many of you may hate...

What else does a game developer need

● Programming skill

● Creative imagination

● Patience

● Should be a gamer

● Logic & analytical skill. Find hacks & shortcuts.

● Above all strong MATH skills - trigonometry, matrices, physics equations, progressions etc

Page 14: 2D Game Development with Starling

Hero of the day – Starling Framework

● Created by Daniel Sperl of Gamua

● Actionscript 3 language

● Optimised for touch based devices

Page 15: 2D Game Development with Starling

Flash & Actionscript

Flash is now only used for

● Games

● Video

Page 16: 2D Game Development with Starling

Why Starling ?

● Crossplatform

● High Performance

● Optimised for touch

● Easy to learn, very same as AS3 default classes

● Field tested & port of Sparrow

● Great community

● Supported by Adobe

● Open source !

Page 17: 2D Game Development with Starling

OOP refresher

● AS3 is same as Java

A Class

● Independent blue prints of functionality. Eg, Ball

● Methods (functions). Eg, bounce()

● Properties (variables). Eg, weight

var myBall:Ball=new Ball();

trace(myBall.weight);

myBall.bounce();

Page 18: 2D Game Development with Starling

OOP refresher

Inheritance

● Class can extend another class's functionality

● Uses 'extends' keyword for the same

eg, Tiger extends Cat which already extends Animal

public class Cat extends Animal {

...

}

Page 19: 2D Game Development with Starling

Development setup

We will need the following for Starling development

● Flash Builder / Flashdevelop / FDT

● Flex SDK, Compiler

● AIR SDK, for crossplatform deployment

● Flash Player standalone program for testing

● Starling framework classes

Page 20: 2D Game Development with Starling

Starling Graphics

Page 21: 2D Game Development with Starling

Simple Starling code

Page 22: 2D Game Development with Starling

Break !

Next we will start some exercises.

Let us check the development setup first.

Page 23: 2D Game Development with Starling

Exercise 1

Add an image to stage!

Page 24: 2D Game Development with Starling

Exercise 2

a. Move the image!b. Set image at click position!

c. Frame based v/s Time based

Page 25: 2D Game Development with Starling

Exercise 3

Texture Atlas!Add an animated MovieClip to stage!

Start / Stop animation on click!

Page 26: 2D Game Development with Starling

Exercise 4

Bouncing Ball!

Page 27: 2D Game Development with Starling

Exercise 5

Trigonometry!Rotating arrow!

Page 28: 2D Game Development with Starling

Exercise 6

Move the arrow with arrows!

Page 29: 2D Game Development with Starling

Exercise 7

Trigonometry!Rotate & move arrow with arrows!

Page 30: 2D Game Development with Starling

Let us create a game!

WORKSHOP& crossplatform deployment