<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SHAZAML! &#187; PlaySoundAction</title>
	<atom:link href="http://www.shazaml.com/archives/tag/playsoundaction/feed" rel="self" type="application/rss+xml" />
	<link>http://www.shazaml.com</link>
	<description>The Blog for Design &#38; Development Superheroes</description>
	<lastBuildDate>Wed, 28 Jul 2010 21:02:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Video: Creating a Silverlight 3 Casual Game using Blend 3 and Triggers, Actions, and Behaviors</title>
		<link>http://www.shazaml.com/archives/video-silverlight-casual-game</link>
		<comments>http://www.shazaml.com/archives/video-silverlight-casual-game#comments</comments>
		<pubDate>Mon, 09 Nov 2009 15:19:11 +0000</pubDate>
		<dc:creator>Mark Tucker</dc:creator>
				<category><![CDATA[Hidden Object Game]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Action]]></category>
		<category><![CDATA[Behavior]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[ChangePropertyAction]]></category>
		<category><![CDATA[ContinuousPlayMediaBehavior]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[GlobalCounterMinReachedTrigger]]></category>
		<category><![CDATA[GoToStateAction]]></category>
		<category><![CDATA[IncrementGlobalCounterAction]]></category>
		<category><![CDATA[InvokeCommandAction]]></category>
		<category><![CDATA[MagnifierOverBehavior]]></category>
		<category><![CDATA[MouseCursorBehavior]]></category>
		<category><![CDATA[ParticlesBehavior]]></category>
		<category><![CDATA[PlaySoundAction]]></category>
		<category><![CDATA[RemoveElementAction]]></category>
		<category><![CDATA[SetGlobalCounterAction]]></category>
		<category><![CDATA[SetInteractionPropertyAction]]></category>
		<category><![CDATA[ShowGlobalCounterBehavior]]></category>
		<category><![CDATA[Trigger]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[Visual State Manager]]></category>
		<category><![CDATA[VSM]]></category>

		<guid isPermaLink="false">http://www.shazaml.com/?p=333</guid>
		<description><![CDATA[Video presentation from Desert Code Camp 2009 - Silverlight 3 Casual Game]]></description>
			<content:encoded><![CDATA[<p>On Saturday, November 7, 2009 at 9:00am I presented at the Desert Code Camp in Phoenix, AZ. The topic of my presentation was Silverlight casual game development. In less than an hour I demonstrated how to use triggers, actions, and behaviors in Blend 3 to create a hidden object game. Because all code was contained in the TABs (Triggers, Actions, and Behaviors) there was no code behind for the main UserControl.</p>
<p>Here is a link to the <a title="Video - Creating a Silverlight 3 Casual Game using Blend 3 and Triggers, Actions, and Behaviors" href="http://www.shazaml.com/downloads/DesertCodeCamp2009-Silverlight3CasualGame.wmv">presentation video</a> in WMV format.</p>
<p>If you like you can see <a href="http://www.shazaml.com/archives/creating-a-hidden-object-game-in-silverlight-3">all the episodes</a> and follow along with the tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shazaml.com/archives/video-silverlight-casual-game/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
<enclosure url="http://www.shazaml.com/downloads/DesertCodeCamp2009-Silverlight3CasualGame.wmv" length="63294285" type="video/x-ms-wmv" />
		</item>
		<item>
		<title>Hidden Object: Episode 3 &#8211; Marking Items off the List</title>
		<link>http://www.shazaml.com/archives/hidden-object-episode-3</link>
		<comments>http://www.shazaml.com/archives/hidden-object-episode-3#comments</comments>
		<pubDate>Fri, 18 Sep 2009 00:10:27 +0000</pubDate>
		<dc:creator>Mark Tucker</dc:creator>
				<category><![CDATA[Hidden Object Game]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Action]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[ChangePropertyAction]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[PlaySoundAction]]></category>

		<guid isPermaLink="false">http://www.shazaml.com/?p=57</guid>
		<description><![CDATA[A clever use of Paths and the ChangePropertyAction will quickly mark items of the list.]]></description>
			<content:encoded><![CDATA[<p>In this episode of <a href="http://www.shazaml.com/archives/creating-a-hidden-object-game-in-silverlight-3">Creating a Hidden Object Game in Silverlight 3</a> we overlay the items in the image with paths and associate the ChangePropertyAction to change the Opacity of the TextBlock to indicate that the item has been found.</p>
<p>In order to detect when an item is clicked in the office image, we need a hotspot. A Path works great for this and odd-shaped items can be outlined using the Pen tool. Press the &#8220;P&#8221; key and the Pen tool will be selected:</p>
<p><img src="http://www.shazaml.com/wp-content/uploads/2009/09/091809_0010_HiddenObjec1.png" alt="" /></p>
<p>Center the mouse cursor over the stapler and use the mouse wheel to zoom in. Now click various points to outline the shape of the stapler:</p>
<p><img src="http://www.shazaml.com/wp-content/uploads/2009/09/091809_0010_HiddenObjec2.png" alt="" /></p>
<p>I started with a point in the bottom left corner and clicked a total of 7 points to outline the shape. When I got to point 5 in the top left, the path&#8217;s fill started obstructing my view of the rest of the object. Simply move over to the Appearance group and set the Opacity below 50%. Continue to draw the remaining points. When you get back to the first point, the mouse cursor will change to the pen with a loop indicating that clicking will close the path. Give the path a name (staplerPath) and set the Opacity to 0%. It is time to add the ChangePropertyAction to the path. On the Assets tab, click Behaviors and find the ChangePropertyAction.</p>
<p> </p>
<p><img src="http://www.shazaml.com/wp-content/uploads/2009/09/091809_0010_HiddenObjec3.png" alt="" /></p>
<p> </p>
<p>Drag the action from the Assets tab to the Object tree and drop it on staplerPath:</p>
<p> </p>
<p><img src="http://www.shazaml.com/wp-content/uploads/2009/09/091809_0010_HiddenObjec4.png" alt="" /></p>
<p> </p>
<p>This action is now associated with staplerPath object. Adding this action to our object tree caused two assemblies to be added to the References folder:</p>
<ul>
<li>Microsoft.Expression.Interactions.dll</li>
<li>System.Windows.Interactivity.dll</li>
</ul>
<p>Looking at the Properties panel you will see the properties for this action and notice that there is already an EventTrigger selected to fire when the staplerPath object gets a MouseLeftButtonDown event. That is exactly what we want. In the Common Properties group you will see TargetName and PropertyName. The TargetName is the name of the object that will have its property changed and PropertyName is the name of the property. Since we want the staplerText TextBlock to be dimmed when the staperPath object is clicked, then we set the TargetName to staplerText. An easy way to do that is to grab the bullseye (called the artboard element picker) and drag it to staplerText on either the canvas or the object tree. The Properties for this action should now look like this:</p>
<p> </p>
<p><img src="http://www.shazaml.com/wp-content/uploads/2009/09/091809_0010_HiddenObjec5.png" alt="" /></p>
<p>Press F5 to run the project and click on the stapler. The text for stapler is now dimmed.</p>
<p> </p>
<p><img src="http://www.shazaml.com/wp-content/uploads/2009/09/091809_0010_HiddenObjec6.png" alt="" /></p>
<p>You can play with the Animation Properties by setting duration for the property change and even set an easing value if you don&#8217;t want a linear change in the Opacity from 100% to 40%. Let&#8217;s make this even better by adding a sound effect when an item is clicked.  I found a nice <a title="Magic Wand Sound" href="http://soundbible.com/474-Magic-Wand-Noise.html">magic wand sound on SoundBible.com</a> and added it to the project in an Audio folder. Now drag the PlaySoundAction from the Assets list onto staplerPath and set the Properties to use the audio file:</p>
<p> </p>
<p><img src="http://www.shazaml.com/wp-content/uploads/2009/09/091809_0010_HiddenObjec7.png" alt="" /></p>
<p> </p>
<p>Now repeat this same process for the other 12 items. We have the core of our very own hidden object game!</p>
<p> </p>
<p>In our <a href="http://www.shazaml.com/archives/hidden-object-episode-4">next episode</a>, we will write a custom behavior that will shoot a spray of particles when an item is clicked.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shazaml.com/archives/hidden-object-episode-3/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
