Simple Scene Management a layer has the size of the device screen it defines appearance and behavior a scene is composed of one or more layers app transitions.

Slides:



Advertisements
Similar presentations
GAME:IT Junior Learning Game Maker: The Control Tab.
Advertisements

OpenGL Open a Win32 Console Application in Microsoft Visual C++.
View-Based Application Development Lecture 1 1. Flows of Lecture 1 Before Lab Introduction to the Game to be developed in this workshop Comparison between.
Tilemaps In tilemap games, the graphics consist of a small number of images, called tiles, that align with each other Tilemap can be bigger than screen.
Better Interactive Programs
September, 2004Patient Care Inquiry PCI - Customizing Your Patient ID Menu.
Microsoft® Small Basic
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
Microsoft® Small Basic
16 HTML Tables and Frames Section 16.1 Create a basic table using HTML Define borders Merge cells Align content in tables Section 16.2 Create a frames-based.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 2 More Controls.
© by Pearson Education, Inc. All Rights Reserved. continued …
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
View Controllers (second part) Content taken from book: “iPhone SDK Development” by Bill Dudney and Chris Adamson.
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
Flowchart Start Input weight and height
PowerPoint: Tables Computer Information Technology Section 5-11 Some text and examples used with permission from: Note: We are.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
PROG Mobile Java Application Development PROG Mobile Java Application Development Event Handling Creating Menus.
Visual Basic Chapter 1 Mr. Wangler.
MrsBillinghurst. net A2 Computing A2 Computing Projects Game Animation in Pascal.
Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0 Key Abstractions in Game Maker Foundations of Interactive Game Design Prof. Jim Whitehead.
J2ME: M3G/11 Intro to J2ME. Prog. v Objectives: –to introduce M3G; –to start talking about "M3G Chapter 2. An Animated Model" u leave the floor,
CIS 205—Web Design & Development Flash Chapter 1 Getting Started with Adobe Flash CS3.
CSC461 Lecture 11: Interactive Programs Contents and Objectives Picking Writing modes – XOR/Copy Rubberbanding Display list.
Tutorial 5 Making a Document Interactive. XP Objectives Explore the different button states Add a button from the Button library Create a button Learn.
VIDEO GAME PROGRAMMING Video Game Programming Junior – DigiPutt INSTRUCTOR TEACHER’S ASSISTANT.
iOS components in Swift
PRACTISCORE MATCH SET UP
Macromedia Dreamweaver 4.0 INTERFACE This presentation will run automatically.
Checking for Collisions: Alternative Method Erin Taylor Under the Direction of Susan Rodger July 2015 Duke University.
(C) 2010 Pearson Education, Inc. All rights reserved. Omer Boyaci.
How to Create a Videogame By: Connor McCann. Java Java is one of many programming languages Java is used to run web browsers and most PC video games I.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
1 Better Interactive Programs. 2 Objectives Learn to build more sophisticated interactive programs using ­Picking Select objects from the display Three.
11 Working with Images Session Session Overview  Find out more about image manipulation and scaling when drawing using XNA  Start to implement.
11 Adding Tomato Targets Session Session Overview  We now have a game which lets a player bounce a piece of cheese on a bread bat  Now we have.
Learning Unity. Getting Unity
View Controllers Content taken from book: “iPhone SDK Development” by Bill Dudney and Chris Adamson.
Game Maker Terminology
Creating and Customizing your First S&R (Multiple Choice) Slide Gerald Bergtrom, Ph.D. Learning Technology Center University of Wisconsin – Milwaukee October.
Return to Outline Copyright © 2011 by Maribeth H. Price 3-1 Labeling and annotation.
Rob Miles. How does an XNA game program work? Programs tell computers what to do A program is written in a programming language – C# is a programming.
Session 16 Pinball Game Construction Kit:. Pinball Version 1 Replaced the fire button with a mouse event. Multiple balls can be in the air at once. –Uses.
Flash CS 5 Interface BY NSCHEWCZYK | ©2012. MENU BAR A bar at the top of the window. It lists menu options including: File, Edit, View, Insert, Modify,
Course Summary Xcode & iPhone Simulator
Sprites Actions/Particles/Sound Revisit the 'flying saucer' sprite: Again add it to the game Implement Chipmunk Physics collision feedback with missiles.
Guide to Programming with Python Chapter Twelve Sound, Animation, and Program Development: The Astrocrash Game.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
Chipmunk Physics Remember that we talked about this a bit when we did collision handlers for the space ship integration task (SpritesActionsPhysicsSound).
1 OGRE Programming Intermediate Tutorial: Volume Selection.
Sound Effects The library Cocosdenshion subproject of cocos2d-iphone targeted at game audio needs Sound effects can be loaded at application startup, so.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
1 Android Development Lean and mean introduction Based on a presentation by Mihail L. Sichitiu.
Galactic Mail Part 2. Winning and Losing Exploding Asteroids Including Scoring Adding Levels And more.
VB.NET and Databases. ADO.NET VB.Net allows you many ways to connect to a database. The technology used to interact with a database or data source is.
GAME:IT Junior Paddle Ball Objectives: Review skills from Introduction Create a background Add simple object control (up and down) Add how to create a.
Design Visualization Software Introduction / Review.
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
School of Engineering and Information and Communication Technology KIT305/KIT607 Mobile Application Development Android OS –Permissions (cont.), Fragments,
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Review Scene Management (Scene, Layer, Director) Sounds Menus Sprites & Actions.
UMBC GDC Programming Tutorial
Menus. Menus are a common user interface component in many types of applications. The options menu is the primary collection of menu items for an activity.
Course Summary Xcode & iPhone Simulator
MOM! Phineas and Ferb are … Aims:
Chapter 1: An Introduction to Visual Basic 2015
Review Scene Management (Scene, Layer, Director) Sounds Menus
Chapter 2 Visual Basic Interface
AWT Components and Containers
Presentation transcript:

Simple Scene Management a layer has the size of the device screen it defines appearance and behavior a scene is composed of one or more layers app transitions take place through scenes the director takes care of transitioning between scenes. iphone.org/wiki/doku.php/prog_guide:basic_conce pts

Simple Scene Management typically one scene is used for the “playable” part of the game others scenes for: title, high scores, options runWithScene tells director to use that scene replaceScene replaces the running scene with another pauseScene puts the current scene on hold for another iphone.org/wiki/doku.php/prog_guide:lesson_3._m enus_and_scenes

What we have so far... Source files: AsteroidsAppDelegate.h/m implements UIApplicationDelegate AsteroidScene.h/m is-a CCLayer (the game layer), and implements CCTargetedTouchDelegate

What we will add... A layer over the game layer showing game statistics A new scene to go to when the ship hits an asteroid

For an Overlay Layer add a layer (overlay layer) on top of the game layer containing game status add a scene that uses the overlay layer and the game layer

Overlay layer OverlayLayer : CCLayer { CCLabelAtlas *labelAtlas; (readwrite,assign) CCLabelAtlas *labelAtlas; -(id) init; -(void)

Overlay layer labelAtlas; -(id) init { if( (self=[super init])) { // current game score label... labelAtlas = [CCLabelAtlas itemWidth:16 itemHeight:24 startCharMap:'.']; [self addChild:labelAtlas]; [label setAnchorPoint:ccp(0,0.5f)]; // left align, the default is center align [label setPosition:ccp(20,20)]; } return self; } - (void) draw { [labelAtlas setVisible: YES]; // Update the score on the screen.... NSString *str = [NSString asteroidCount, nil]; [labelAtlas setString:str];

Modify application delegate to use it - (void) applicationDidFinishLaunching:(UIApplication*)application { CC_DIRECTOR_INIT(); // Obtain the shared director in order to... CCDirector *director = [CCDirector sharedDirector]; // Sets landscape mode [director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft]; // Whether or not to display the Frames/Second (FPS) on the bottom-left corner //[director setDisplayFPS:YES]; // UIView subclass for rendering OpenGL scene into. EAGLView *view = [director openGLView]; // Turn on multiple touches [view setMultipleTouchEnabled:YES]; //[director runWithScene: [AsteroidsScene scene]]; CCScene *scene = [CCScene node]; [scene addChild: [AsteroidsScene node] z:0]; // 'z' gives the order stacking [scene addChild: [OverlayLayer node] z:1]; [director runWithScene: scene]; }

For a new scene Create the layer to be used by the new scene Write the call into the code

Translation to layer YouLost : CCLayer { } -(id)

Translation layer YouLost -(id) init { if( (self=[super init])) { CCLabel *label = [CCLabel You hit an asteroid!" Typewriter" fontSize:24]; [self addChild:label]; [label setPosition:ccp(170,20)]; } return self;

Write the call into the code //// //// Chipmunk Physics colission callbacks... //// // Begin: Two shapes just started touching for the first time this step. Return true from the callback to process the collision // normally or false to cause Chipmunk to ignore the collision entirely. If you return false, the pre-solve and post-solve // callbacks will never be run, but you will still recieve a separate event when the shapes stop overlapping. int beginShipHitAsteroid(cpArbiter *arb, cpSpace *space __attribute__ ((unused)), void *data __attribute__ ((unused))) { CCScene *scene = [[CCScene node] addChild:[YouLost node] z:0]; [[CCDirector sharedDirector] replaceScene: scene]; // Returning 0 will cause the collision to be discarded. This allows you to do conditional collisions. return 1; }

Try some fancy scene translations iphone.org/wiki/doku.php/prog_guide:lesson_3._m enus_and_scenes Try some fancy transitions: CCFadeTransition CCFlipAngularTransition CCShrinkGrowTransition CCMoveInBTransition CCMoveInTTransition CCMoveInLTransition CCMoveInRTransition CCFadeTRTransition CCFadeUpTransition CCFlipXTransition CCFlipYTransition CCPageTurnTransition CCCrossFadeTransition [[CCDirector sharedDirector] replaceScene: [CCFadeTransition transitionWithDuration:3.0f scene:scene]];