<?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>The Tutorial Blog &#187; basic game</title>
	<atom:link href="http://www.thetutorialblog.com/tag/basic-game/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetutorialblog.com</link>
	<description></description>
	<lastBuildDate>Tue, 08 Nov 2011 19:21:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<image>
<link>http://www.thetutorialblog.com</link>
<url>http://www.thetutorialblog.com/wp-content/plugins/maxblogpress-favicon/icons/favicon-28.ico</url>
<title>The Tutorial Blog</title>
</image>
		<item>
		<title>Basic Actionscript 3 Game Part 1</title>
		<link>http://www.thetutorialblog.com/flash-actionscript/basic-actionscript-3-game/</link>
		<comments>http://www.thetutorialblog.com/flash-actionscript/basic-actionscript-3-game/#comments</comments>
		<pubDate>Sun, 06 Apr 2008 19:16:20 +0000</pubDate>
		<dc:creator>Wez Pyke</dc:creator>
				<category><![CDATA[Flash/Actionscript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Text Tutorials]]></category>
		<category><![CDATA[Video Tutorials]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[basic game]]></category>
		<category><![CDATA[easy game]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[how to make a game]]></category>
		<category><![CDATA[make game]]></category>
		<category><![CDATA[shoot]]></category>
		<category><![CDATA[shooting game]]></category>
		<category><![CDATA[thetutorialblog]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.thetutorialblog.com/?p=16</guid>
		<description><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	A video tutorial showing how to create a basic game using Actionscript 3. The first thing which we do is create two movieclips, one called player and one called bullet then we remove them from our stage by pressing the delete key on your keyboard. Comment 1 var Player:player = new player(); This creates a [...]


Related posts:<ol><li><a href='http://www.thetutorialblog.com/cocoa-objective-c/creating-a-basic-ipad-application/' rel='bookmark' title='Permanent Link: Creating a basic iPad application'>Creating a basic iPad application</a> <small>Because of the recent announcement of the iPad 2 more...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[	<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
		<style>
	#code_div { border: 1px solid #DFF4B5; background-color: #F0FFD2; padding-left: 50px; padding:10px;}
	</style>
	
	<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fflash-actionscript%2Fbasic-actionscript-3-game%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thetutorialblog.com%2Fflash-actionscript%2Fbasic-actionscript-3-game%2F&amp;source=wezpyke&amp;style=normal&amp;service=bit.ly" height="61" width="50" title="Basic Actionscript 3 Game Part 1" alt=" Basic Actionscript 3 Game Part 1" /><br />
			</a>
		</div>
<p>A video tutorial showing how to create a basic game using Actionscript 3.<br />
<span id="more-16"></span></p>
<p><object width="480" height="392" data="http://flash.revver.com/player/1.0/player.swf?mediaId=794233&#038;affiliateId=42154" type="application/x-shockwave-flash" id="revvervideoa17743d6aebf486ece24053f35e1aa23"><param name="Movie" value="http://flash.revver.com/player/1.0/player.swf?mediaId=794233&#038;affiliateId=42154"></param><param name="FlashVars" value="allowFullScreen=true&#038;backColor=#000000&#038;frontColor=#ffffff&#038;gradColor=#000000"></param><param name="AllowFullScreen" value="true"></param><param name="AllowScriptAccess" value="always"></param><embed type="application/x-shockwave-flash" src="http://flash.revver.com/player/1.0/player.swf?mediaId=794233&#038;affiliateId=42154" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" flashvars="allowFullScreen=true&#038;backColor=#000000&#038;frontColor=#ffffff&#038;gradColor=#000000" allowfullscreen="true" width="480" height="392"></embed></object></p>
<p>The first thing which we do is create two movieclips, one called player and one called bullet then we remove them from our stage by pressing the delete key on your keyboard.</p>
<p><strong>Comment 1</strong><br />
<em>var Player:player = new player();</em> <span style="color: #888888;">This creates a new instance of the movieclip which we made called player.</span><br />
<em>Player.x = mouseX;</em> <span style="color: #888888;">This sets the X position of Player to the X position of the mouse.</span><br />
<em>Player.y = mouseY; </em><span style="color: #888888;">This sets the Y position of Player to the Y position of the mouse.</span><br />
<em>addChild(Player); </em><span style="color: #888888;">This adds the Player instance that we have just created to the stage.</span></p>
<p><strong>Comment 2<br />
</strong><em>stage.addEventListener(MouseEvent.MOUSE_MOVE, mousemove);</em> <span style="color: #888888;">An event listener listens out for an event which has been defined within the paranthesis. Here when the mouse moves on the stage then the function mousemove is called.</span><br />
<em>stage.addEventListener(MouseEvent.MOUSE_DOWN, shoot); </em><span style="color: #888888;">When the left mouse button is pressed then the shoot function is called.</span></p>
<p><strong>Comment 3<br />
</strong><em>function mousemove(e:MouseEvent):void{</em><span style="color: #888888;">, This creates the function mousemove and looks for mouse events.<br />
</span>Player.x = mouseX;<span style="color: #999999;"> Update the Player X position to the mouses X when the mouse is moved.</span><br />
Player.y = mouseY; <span style="color: #999999;">Update the Player Y position to the mouses Y when the mouse is moved.<br />
</span>} <span style="color: #999999;">Close the function.</span></p>
<p><strong>Comment 4</strong><br />
function shoot(e:Event):void{ <span style="color: #999999;">create a function called shoot.</span><br />
var Bullet:bullet = new bullet();<span style="color: #888888;"><span style="color: #000000;"> <span style="color: #999999;">This creates a new instance of the bullet movieclip.<br />
</span></span></span>Bullet.x = Player.x;<span style="color: #888888;"><span style="color: #000000;"> <span style="color: #999999;">The Bullet X position is set to the same as the Player X position.<br />
</span></span></span>Bullet.y = Player.y;<span style="color: #888888;"><span style="color: #000000;"><span style="color: #999999;"><span style="color: #000000;"> <span style="color: #999999;">The Bullet Y position is set to the same as the Player Y position.<br />
</span></span></span></span></span>addChild(Bullet);<span style="color: #888888;"><span style="color: #000000;"><span style="color: #999999;"><span style="color: #000000;"><span style="color: #999999;"> Add the instance Bullet to the stage.<br />
</span></span></span></span></span>Bullet.addEventListener(Event.ENTER_FRAME, moveBullet); <span style="color: #999999;">Add an event listener to Bullet for when it enters the frame and when it does call the function moveBullet.</span><br />
}<span style="color: #888888;"><span style="color: #000000;"> <span style="color: #999999;">Now we close the function.</span></span></span></p>
<p><strong>Comment 5<br />
</strong>function moveBullet(e:Event):void{ <span style="color: #999999;">create a function called moveBullet</span>.<br />
e.target.y -= 5; <span style="color: #999999;">When the function is called the targets Y position will be subract by 5 pixels every frame, this makes the movieclip move up. The target is the Bullet movieclip.</span><br />
if(e.target.y &lt;= -10){ <span style="color: #999999;">If the Y of Bullet is less than or equal to minus 10 then the event listener will be removed and so will the movieclip.</span><br />
e.target.removeEventListener(Event.ENTER_FRAME, moveBullet);<br />
removeChild(MovieClip(e.target));<br />
} <span style="color: #999999;">Close the function</span></p>
<p>Thanks for watching the tutorial and reading through the notes. If there is anything that you don’t understand then please post a omment and I will try to explain your problem as best as I can.</p>


<p>Related posts:<ol><li><a href='http://www.thetutorialblog.com/cocoa-objective-c/creating-a-basic-ipad-application/' rel='bookmark' title='Permanent Link: Creating a basic iPad application'>Creating a basic iPad application</a> <small>Because of the recent announcement of the iPad 2 more...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thetutorialblog.com/flash-actionscript/basic-actionscript-3-game/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

