intro to starling framework for actionscript 3.0

21
TM & © 2012 Rivello Multimedia Consulting [email protected] Starling Framework Samuel Asher Rivello Principal, Rivello Multimedia Consulting An Introduction

Upload: rivello-multimedia-consulting

Post on 09-May-2015

4.998 views

Category:

Career


2 download

TRANSCRIPT

Page 1: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Starling Framework

Samuel Asher Rivello

Principal, Rivello Multimedia Consulting

An Introduction

Page 2: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Speaker•Samuel Asher Rivello is the principal of Rivello Multmedia Consultng (RMC). Rivello Multmedia Consultng (RMC) provides sofware consultng services for Adobe’s Flash and Flex as well as HTML5 standards.

•We consult on sofware architecture for apps and for games, advergames, and monetzed virtual worlds targetng browsers, desktop, and cross-device mobile.

•We champion best practces, setup efcient team workfows, and provide corporate technical training.

Agenda•Learn the benefts and syntax of Starling for gaming

Audience•Intermediate to Advanced ActionScript 3.0 Developers

Take-Away•All source code and documentation will be available to attendees

Topic

Page 3: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Notice

1. Stage3D is new

2. Starling is new

3. I am new

So... features and syntax may change and my code may not show the 'best' solutions.

Topic

Page 4: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Three Sections

1. What is Stage3D?

• Benefits & Challenges

• Frameworks

2. What is Starling?

• Overview

• Implementation (Code Samples!)

3. Conclusion

• Q&A

• References

Agenda

Page 5: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

SECTION 1What is Stage3D?

Page 6: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

What is Stage3D

● Stage 3D, previously codenamed "Molehill," is a method of 2D and 3D rendering with a set of low-level GPU-accelerated APIs● Available for Flash Player 11.x and AIR 3.2 (iOS/Android)● Runs on a unique layer under the display list (See Figure 1.)

Stage3D

Figure 1

Today, you can publish the fastest Flash games ever on the widest array of devices including iPad 3!

Page 7: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Benefits

● With Stage3D – Render hundreds of thousands of z-bufered triangles to be rendered at HD resoluton in full screen at 60 Hz (instead of just 'thousands' at 30 Hz without Stage3D).● GPU not CPU now handles rendering so rendering is more performant and you have more CPU power for your coding.

Stage3D

Page 8: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Challenges

● The language is very low-level (difcult* to read and write)● All 'sprites' must be patched together from triangles (triangles are the 'pixel' of 3D graphics)● Sprites handling mouse gestures and using vector graphics is not supported

Stage3D

* Especially compared to the (non-Stage3D) traditonal Display List

Page 9: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Sounds powerful, but hard to use...

●True. ●Luckily, we have some help.●Many frameworks exist to make our lives easier.

Stage3D

Page 10: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Frameworks

AS3 frameworks with Stage3D for 2D gaming;● Starling● ND2D● Citrus Engine (Recently Upgraded To Stage3D)

AS3 frameworks for Stage3D for 3D gaming;● Flare3D● Alternatva3D (Recently Open-Source)

Stage3D

Page 11: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

SECTION 2What is Starling?

Page 12: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

What is Starling? – A 2D AS3 Framework for Stage3D● Free & Open Source – Easy to use so you can focus on your games!● Platorm independent – Browser, Desktop, iOS, Android, Blackberry Tablet.● Amazing Performance & Familiar API -Starling is a pure ActonScript 3 library that mimics the conventonal Flash display list architecture.● Embraced* by Adobe – Adobe supports the development of Starling and plans to integrate it tghtly into its tools. You get the best of both worlds: corporate commitment and a vivid community.

Starling

* Very Interestng – This means tghter integraton with Flash Player / AIR improvements and bigger marketng muscle

for the framework. The 2D Framework with the biggest community has a distnct advantage.

Page 13: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Core Classes

Starling

Page 14: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Assets● TextureAtlas – An instance is required for each 'asset' you want to render. Its defned by a SpriteSheet and XML info about it. You cannot directly use vector source assets such as Flash tmeline animaton.● I don't use TextureAtlas or SpriteSheets – I use a Starling extension DynamicTextureAtlasGenerator that allows for full vector source assets.

Starling

Core Concepts

●Setup - The Startup.as document-class extends Sprite and composes an instance of Game.as. ● Starling.juggler.add (displayObject) - Required to have 'enterFrame'.

Vector (FLA) SpriteSheet (JPG)

Page 15: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

DEMOLet's See Starling In Action!

1. The Official Demo - http://gamua.com/starling/demo/2. My Hello World3. My Flyer Game (Simple Version)4. My Flyer Game (OOP Version)

Page 16: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Starling

Extensions

●Allow for additonal functonality within Starling projects. My favorites;●PartcleSystem – Generate efects like smoke & fre●DynamicTextureAtlas Generator – Use vector source assets

ParticleSystem Designer Particle System In Game (FlyerGame)

Page 17: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Three Sections

1. What is Stage3D?

• Benefits & Challenges

• Frameworks

2. What is Starling?

• Overview

• Implementation (Code Samples!)

3. Conclusion

• Q&A

• References

Q&A!

Page 18: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

SECTION 3Conclusion

Page 19: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Starling Framework

References

Today's Presentation (Includes All Other Links)

http://bit.ly/IntroStarling

Page 20: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Thanks!

Presentation Questions

Send Questions & Comments

[email protected]

Consulting Inquiries (RivelloMultimediaConsulting.com)

Software Architecture, Consulting, Development, & Training.

[email protected]

Page 21: Intro To Starling Framework for ActionScript 3.0

TM & © 2012 Rivello Multimedia Consulting

[email protected]

Thanks!

Presentation Questions

Send Questions & Comments

[email protected]

Consulting Inquiries (RivelloMultimediaConsulting.com)

Software Architecture, Consulting, Development, & Training.

[email protected]