2d game development with starling
DESCRIPTION
Introduction to 2D game development with focus on Starling framework.TRANSCRIPT
![Page 1: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/1.jpg)
![Page 2: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/2.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/3.jpg)
Some of our games
![Page 4: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/4.jpg)
You
Let me know my audience
![Page 5: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/5.jpg)
Some 2D Game examples
![Page 6: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/6.jpg)
How to make them ?
![Page 7: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/7.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/8.jpg)
Platforms
● PC (Mac , Linux)
● Web
● PS4
● Xbox
● Android
● iPhone, iPad
● Wii, DS, PSP
● Microconsoles, Smart TVs
![Page 9: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/9.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/10.jpg)
A Game Engine
We use game frameworks to build our game engine
![Page 11: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/11.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/12.jpg)
For the Non – Programmer ???
● Web – Construct 2
● Crossplatform - Gamemaker
![Page 13: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/13.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/14.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/15.jpg)
Flash & Actionscript
Flash is now only used for
● Games
● Video
![Page 16: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/16.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/17.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/18.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/19.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/20.jpg)
Starling Graphics
![Page 21: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/21.jpg)
Simple Starling code
![Page 22: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/22.jpg)
Break !
Next we will start some exercises.
Let us check the development setup first.
![Page 23: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/23.jpg)
Exercise 1
Add an image to stage!
![Page 24: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/24.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/25.jpg)
Exercise 3
Texture Atlas!Add an animated MovieClip to stage!
Start / Stop animation on click!
![Page 26: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/26.jpg)
Exercise 4
Bouncing Ball!
![Page 27: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/27.jpg)
Exercise 5
Trigonometry!Rotating arrow!
![Page 28: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/28.jpg)
Exercise 6
Move the arrow with arrows!
![Page 29: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/29.jpg)
Exercise 7
Trigonometry!Rotate & move arrow with arrows!
![Page 30: 2D Game Development with Starling](https://reader033.vdocuments.us/reader033/viewer/2022050921/554dd57db4c905c70e8b4b20/html5/thumbnails/30.jpg)
Let us create a game!
WORKSHOP& crossplatform deployment