A Platform game in F# and SpriteKit – Part 5.5 – Sound Effects

Micro-post:

Playing sound effects in SpriteKit:

//Load the sound
use jumpSound = SKAction.PlaySoundFileNamed("Jump.wav", true)
//Play the sound
scene.RunAction jumpSound

Note that the File extension is important here – unlike the graphics formats loaded into SpriteKit.

Winning!

Next Time

So far our level plays for 10 seconds and then goes to game over. Next time I’ll add success and failure criteria, and we can start to contemplate how to handle multiple levels.

Source available here and assets from here

Advertisements

About thedo666

Software developer trying to learn a new language - English!
This entry was posted in F#, iOS, Mono, Uncategorized and tagged , , , . Bookmark the permalink.

One Response to A Platform game in F# and SpriteKit – Part 5.5 – Sound Effects

  1. Pingback: F# Weekly #42, 2013 | Sergey Tihon's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s