Sound Effects The library Cocosdenshion subproject of cocos2d-iphone targeted at game audio needs Sound effects can be loaded at application startup, so.

Slides:



Advertisements
Similar presentations
OpenGL Open a Win32 Console Application in Microsoft Visual C++.
Advertisements

Module 4- Build a Game I Can’t Hear You! Sound. Sound formats in Scratch  Scratch can read MP3 files and uncompressed WAV, AIF, and AU files.  Just.
Creating Games For Windows, Xbox 360, and Windows Phone 7 Ryan Plemons
Getting to know Greenfoot
Dan Waters, Academic Relations Manager, Microsoft.
CHAPTER 16 Audio © 2008 Cengage Learning EMEA. LEARNING OBJECTIVES In this chapter you will learn about: – –The fundamentals of sound – –DirectX Audio.
Asteroids Games and Simulations O-O Programming in Java The Walker School The Walker School – Games and Simulations
Touches Detection and Other Remaining Parts Lecture 3 1.
Scratch Programming Session 6 of 10 If-then-else statements interactions Final projects specifications.
©Sara Duncan 1998 Instructions for the game... Click on the text box that says “your text here. Enter your text in the box. Add pizzazz by using graphics.
Copyright © 2002 Bolton Institute Sound in SDL Andrew Williams
Games at Bolton Sound in SDL Andrew Williams adw1.
Chapter 9 Audio.
Solar System Assignment By: Sam Shon. Top down view of the Solar System Interactive Background Simulates Correct Physics Gravity Collisions Ambient Music.
CHAPTER 1 XNA Game Studio 4.0. Your First Project A computer game is not just a program—it is also lots of other bits and pieces that make playing the.
MrsBillinghurst. net A2 Computing A2 Computing Projects Game Animation in Pascal.
Open-Source Graphics Development with the Delta3D Game Engine Chris Osborn Lead Software Engineer Delta3D, MOVES Institute
ITEC 109 Lecture 26 Sound (2). Sound Review Sound –How does it work in real life? –What are the different types of waves that represent sounds? –How are.
How to make Space Invaders
Audio. Why Audio Essential tool for – Interface – Narrative – Setting & Mood.
Copyright © 2015 – Curt Hill Minecraft Blocks Properties and Methods.
My First ACCESSIBLE Flash Movie. Course notes Detailed course notes, a printable copy of my slides, and all the samples shown today can be downloaded.
Greenfoot. Getting Started Open the Greenfoot download site: Select Greenfoot
Tennis for Two, 1958, by William Higinbotham, Brookhaven National Lab CSE 380 – Computer Game Programming Graphics Device Management.
Basic Android Tutorial USF’s Association for Computing Machinery.
(c) 2008 E.S.Boese All Rights Reserved. Threads and Media Chapter 8 - Lecture Slides 1.
A Spring 2005 CS 426 Senior Project By Group 15 John Studebaker, Justin Gerthoffer, David Colborne CSE Dept., University of Nevada, Reno Advisors (CSE.
VIDEO GAME PROGRAMMING Video Game Programming Level One – Breakout INSTRUCTOR Big Dan Teague TEACHER’S ASSISTANT Delmar O'Donnell.
DUE Hello World on the Android Platform.
ACE Address Configuration Executive. Why ACE? ACE provides access to several address resolution protocols under a single API ACE is the only API available.
11 Adding Sounds Session 7.1. Session Overview  Find out how to capture and manipulate sound on a Windows PC  Show how sound is managed as an item of.
HTML Extras. Adding a button   This is what it would look like:  Add color to your button: 
OpenGL-ES 3.0 And Beyond Boston What is EGL? EGL handles: –provides available surface specifications –context management –surface binding –render.
1 VR assignment#2 WTK SDK Introduction By Jin-Bey Yu 2001/11/12.
111 Introduction to OGRE3D Programming: Main Loop.
Course Summary Xcode & iPhone Simulator
Audio Yu Feng CGDD Review 1. Set up 2. IOS sound – Core Audio – Short Sound – Long Sound – Control Sound – Background Sound 3.Cocos2d sound.
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.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.
Guide to Programming with Python Week 15 Chapter Twelve Sound, Animation, and Program Development: The Astrocrash Game.
Chipmunk Physics Remember that we talked about this a bit when we did collision handlers for the space ship integration task (SpritesActionsPhysicsSound).
Iconoclast Game Engine and test game “Scumbag”. 3D 3D rendering with use of the latest OpenGL standards. Multiple light sourcing Mesh data loaded from.
Super EastGate Jon Caron, Ryan Fleming, Antonio Guarino, and Mike LoVerme Merrimack College Introduction Super EastGate is a 2D side scroller game that.
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.
Photo Story. How to use Photo Story Photo Story 3 can be located in the Accessories folder on school computers. You will need to have your pictures already.
Assignment 3 Your going to modify your last Best Movies page and Recipe page Your going to modify your last Best Movies page and Recipe page You will need.
Lecture Set 7 Procedures and Event Handlers Part B - The Structure of an Application Event Handlers.
SE Team 9 GlobalFlyer Cole Hoosier Ryan Hannebaum Leanne Gray Alex Stampbach.
// Increment i i += 1; // Restart timer this->start(Cycles::rdtsc() + clock->updateIntervalCycles); updater->start(0); // Start immediately. CS 190 Lecture.
Microsoft Foundation Classes
1 EiffelMedia. 2 Overview Features of the library Documentation Demos Community Stats Roadmap.
Java Threads 1 1 Threading and Concurrent Programming in Java Threads and Swing D.W. Denbo.
Introduction to JavaScript Events Instructor: Sergey Goldman 1.
Internet & World Wide Web How to Program, 5/e.  JavaScript events  allow scripts to respond to user interactions and modify the page accordingly  Events.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Review Scene Management (Scene, Layer, Director) Sounds Menus Sprites & Actions.
Course Summary Xcode & iPhone Simulator
GridWorld.
WITH PYGAME ON THE RASPBERRY PI
Introduction to JavaScript Events
Delegates and Events 14: Delegates and Events
Review Scene Management (Scene, Layer, Director) Sounds Menus
I Can’t Hear You! Sound Get out your notes.
1/10/2019 JavaFX Events COSC 330.
Player preferences, Loading Scenes, Activating and Enabling
I Can’t Hear You! Sound Get out your notes.
I Can’t Hear You! Sound Get out your notes.
Presentation transcript:

Sound Effects The library Cocosdenshion subproject of cocos2d-iphone targeted at game audio needs Sound effects can be loaded at application startup, so there's no delay during play iphone.org/wiki/doku.php/cocosdenshion:faq

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... Include the.wav files in the 'Resources' Group (crtl-click → Add → Existing Files) Import 'SimpleAudioEngine' in AsteroidsScene.h to have access to the API Make a '#define' for.wav files in AsteroidsScene.h to reference them in multiple places Preload the.wav files in AsteroidsAppDelegate applicationDidFinishLaunching Play the.wav effects where needed

AsteroidScene.h... // Importing Chipmunk headers #import "chipmunk.h" #import "SimpleAudioEngine.h" // // All of these wav files are preloaded in AsteroidsAppDelegate.m in // AsteroidsAppDelegate::applicationDidFinishLaunching // These wav files were maked as 'Public domain' and downloaded from // #define #define enum CollisionTypes {...

window; - (void) applicationDidFinishLaunching:(UIApplication*)application { … // Turn on multiple touches EAGLView *view = [director openGLView]; [view setMultipleTouchEnabled:YES]; // Default texture format for PNG/BMP/TIFF/JPEG/GIF images // It can be RGBA8888, RGBA4444, RGB5_A1, RGB565 // You can change anytime. [CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888]; [[SimpleAudioEngine sharedEngine] preloadEffect: MISSILE_HIT_ASTEROID_WAV]; [[SimpleAudioEngine sharedEngine] preloadEffect: MISSILE_FIRED_WAV]; [[CCDirector sharedDirector] runWithScene: [AsteroidsScene scene]]; }

AsteroidScene.m // Handler called by Chipmunk Physics when it detects a collision between two registered objects. // In this case a Missile and an Asterois. int beginMissileHitAsteroid(cpArbiter *arb, cpSpace *space, void *data __attribute__ ((unused))) { // Add code here to break up the asteroid if it's hasn't reached it's smallest size (in this // case remove it). Quite important to note that you need to use 'post-step' callbacks to add or remove // objects from the space. You CAN"T do it in a callback like this one. see... // // Get the cpShapes involved in the collision // The order will be the same as you defined in the handler definition cpShape *missileShape, *asteroidShape; cpArbiterGetShapes(arb, &missileShape, &asteroidShape); // Add a post step callback to safely remove the body and shape from the space. // Calling cpSpaceRemove*() directly from a collision handler callback can cause crashes. // You can only register one post step callback per object. cpSpaceAddPostStepCallback(space, (cpPostStepFunc)postStepDistroyAsteroid, asteroidShape, NULL); cpSpaceAddPostStepCallback(space, (cpPostStepFunc)postStepDistroyMissile, missileShape, NULL); [[SimpleAudioEngine sharedEngine] playEffect:MISSILE_HIT_ASTEROID_WAV]; // The object is dead, don't process the collision further return 0; }

AsteroidScene.m // Invoked when the finger leaves the screen... - (void)ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event { CGPoint loc = [touch locationInView: [touch view]]; loc = [[CCDirector sharedDirector] convertToGL: loc]; cpVect p = shipBody->p; shipBody loc touchMoved p.x, p.y, loc.x, loc.y, (touchMoved // If there was a "move" during this touch, then fire the thrusters, otherwise fire a missle if (touchMoved) { // If the touch was near the last [end] touch then we fire the thrusters, // otherwise, we fire a missile. cpVect shipAngleVector = cpvforangle(shipBody->a); //cpVect shipAngleVector = cpv(cos(shipBody->a),sin(shipBody->a)); // Note that the magnitude of the thrust needs to be based on the mass of the object // being moved cpFloat thrustMagnitude = SHIP_MASS * THRUST_MULTIPLIER; cpBodyApplyImpulse(shipBody, cpvmult(shipAngleVector, thrustMagnitude), cpvzero); } else { // then fire a missle... [[SimpleAudioEngine sharedEngine] playEffect:MISSILE_FIRED_WAV]; fireMissile(); }

CocosDenshion FAQ Q & A to some problems that you might bump into... I've got some wave files but they don't work, what can I do? iphone.org/wiki/doku.php/cocosdenshion:faq

Background music from ipod library You’ll need a provisioned device because the Simulator has no access to a device’s iPod library. Follow these instructions... ntation/Audio/Conceptual/iPodLibraryAccess_Gui de/Introduction/Introduction.html