<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Fishy &#38; Flashy</title>
	<atom:link href="http://fishyandflashy.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://fishyandflashy.wordpress.com</link>
	<description>Flash Programming &#38; Gaming</description>
	<lastBuildDate>Sun, 17 Apr 2011 02:41:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='fishyandflashy.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/2f9b613612952b6be479bc34a6dbb607?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Fishy &#38; Flashy</title>
		<link>http://fishyandflashy.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://fishyandflashy.wordpress.com/osd.xml" title="Fishy &#38; Flashy" />
	<atom:link rel='hub' href='http://fishyandflashy.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Updated superHero game!</title>
		<link>http://fishyandflashy.wordpress.com/2010/07/15/updated-superhero-game/</link>
		<comments>http://fishyandflashy.wordpress.com/2010/07/15/updated-superhero-game/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 23:45:50 +0000</pubDate>
		<dc:creator>Screwed Loose</dc:creator>
				<category><![CDATA[Works-in-Progress]]></category>
		<category><![CDATA[superhero]]></category>

		<guid isPermaLink="false">http://fishyandflashy.wordpress.com/?p=60</guid>
		<description><![CDATA[An updated version of the superHero game.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fishyandflashy.wordpress.com&amp;blog=14036855&amp;post=60&amp;subd=fishyandflashy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;" class="getsocial"><a title="Like This!" href="http://getsociallive.com/gslike.php?likeurl=http%3A%2F%2Ffishyandflashy.wordpress.com%2F2010%2F07%2F15%2Fupdated-superhero-game%2F&amp;liketitle=superHero%20-%20The%20Online%20Game!" rel="nofollow" target="_blank"><img style="border:0;margin:0;padding:0;" src="http://getsocialserver.files.wordpress.com/2010/04/gslk3.png?w=49&#038;h=23" width="49" height="23" alt="Like This!" /></a></p>
<p>Hey, guys. <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I updated the superHero game a bit. Graphics and such. Check it out!</p>
<p><a href="http://www.swfcabin.com/open/1279235155">http://www.swfcabin.com/open/1279235155</a></p>
<h1>- Screwed Loose</h1>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;overflow:hidden;">&lt;p style=&#8221;text-align:left;&#8221; class=&#8221;getsocial&#8221;&gt;&lt;a title=&#8221;Like This!&#8221; href=&#8221;http://getsociallive.com/gslike.php?likeurl=http%3A%2F%2Ffishyandflashy.wordpress.com%2F2010%2F07%2F15%2Fupdated-superhero-game%2F&amp;amp;liketitle=superHero%20-%20The%20Online%20Game!&#8221; rel=&#8221;nofollow&#8221; target=&#8221;_blank&#8221;&gt;&lt;img style=&#8221;border:0;margin:0;padding:0;&#8221; src=&#8221;http://getsocialserver.files.wordpress.com/2010/04/gslk3.png&#8221; width=&#8221;49&#8243; height=&#8221;23&#8243; alt=&#8221;Like This!&#8221; /&gt;&lt;/a&gt;&lt;/p&gt;</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fishyandflashy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fishyandflashy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fishyandflashy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fishyandflashy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fishyandflashy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fishyandflashy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fishyandflashy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fishyandflashy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fishyandflashy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fishyandflashy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fishyandflashy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fishyandflashy.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fishyandflashy.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fishyandflashy.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fishyandflashy.wordpress.com&amp;blog=14036855&amp;post=60&amp;subd=fishyandflashy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fishyandflashy.wordpress.com/2010/07/15/updated-superhero-game/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee92894aa0c8eaa1a9308a3c4222ae5e?s=96&#38;d=&#38;r=PG" medium="image">
			<media:title type="html">screwloosecomics</media:title>
		</media:content>

		<media:content url="http://getsocialserver.files.wordpress.com/2010/04/gslk3.png" medium="image">
			<media:title type="html">Like This!</media:title>
		</media:content>
	</item>
		<item>
		<title>Drawing Shiny Orbs &#8211; A Basic Design Tutorial</title>
		<link>http://fishyandflashy.wordpress.com/2010/06/22/drawing-shiny-orbs-a-basic-design-tutorial/</link>
		<comments>http://fishyandflashy.wordpress.com/2010/06/22/drawing-shiny-orbs-a-basic-design-tutorial/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 20:15:35 +0000</pubDate>
		<dc:creator>Screwed Loose</dc:creator>
				<category><![CDATA[Design Tutorials]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[shiny orbs]]></category>

		<guid isPermaLink="false">http://fishyandflashy.wordpress.com/?p=47</guid>
		<description><![CDATA[A tutorial on how to draw shiny orbs.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fishyandflashy.wordpress.com&amp;blog=14036855&amp;post=47&amp;subd=fishyandflashy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-48" title="shinyorb_ex" src="http://fishyandflashy.files.wordpress.com/2010/06/shinyorb_ex.png?w=435&#038;h=264" alt="" width="435" height="264" /></p>
<p>Hey, guys! This is just a random design tutorial on how to make professional-looking shiny orbs that can be used as buttons, etc.</p>
<p><span id="more-47"></span></p>
<p>First, start off by drawing a circle with the line thickness set to 4. Then, we&#8217;ll work on the fill. We&#8217;ll need a gradient fill. Use the pictures below as a guide.</p>
<p><img class="aligncenter size-full wp-image-49" title="shinyorbs_gradientfill_ex" src="http://fishyandflashy.files.wordpress.com/2010/06/shinyorbs_gradientfill_ex.png?w=435&#038;h=264" alt="" width="435" height="264" />Now convert the whole thing to a movie clip. Add a new layer. Copy the fill from the old layer, lock it, move on to the new layer, and paste the fill in place. Create a new linear fill that goes from zero visibility to 80%. Position the fill off the top of the circle. Resize the circle down. and then reposition it.</p>
<p><img class="aligncenter size-full wp-image-50" title="shinyorbs_fill2_ex" src="http://fishyandflashy.files.wordpress.com/2010/06/shinyorbs_fill2_ex.png?w=435&#038;h=264" alt="" width="435" height="264" />Exit out of the movie clip. Add a Drop Shadow. It should be black with a blur <em>X</em> and <em>Y</em> of 10, a strength of 38%, and a high quality.</p>
<p>And, we&#8217;re done! <img src='http://s2.wp.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Here&#8217;s the finished product.</p>
<p><img class="aligncenter size-full wp-image-51" title="shinyorb_ex1" src="http://fishyandflashy.files.wordpress.com/2010/06/shinyorb_ex1.png?w=208&#038;h=222" alt="" width="208" height="222" /></p>
<p>There are also some other cool things you can do with this. For example&#8230;</p>
<p><img class="aligncenter size-full wp-image-55" title="shinyorbs_heart" src="http://fishyandflashy.files.wordpress.com/2010/06/shinyorbs_heart.png?w=187&#038;h=187" alt="" width="187" height="187" /><img class="aligncenter size-full wp-image-56" title="shinyorbs_smiler" src="http://fishyandflashy.files.wordpress.com/2010/06/shinyorbs_smiler.png?w=187&#038;h=187" alt="" width="187" height="187" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fishyandflashy.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fishyandflashy.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fishyandflashy.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fishyandflashy.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fishyandflashy.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fishyandflashy.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fishyandflashy.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fishyandflashy.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fishyandflashy.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fishyandflashy.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fishyandflashy.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fishyandflashy.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fishyandflashy.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fishyandflashy.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fishyandflashy.wordpress.com&amp;blog=14036855&amp;post=47&amp;subd=fishyandflashy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fishyandflashy.wordpress.com/2010/06/22/drawing-shiny-orbs-a-basic-design-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee92894aa0c8eaa1a9308a3c4222ae5e?s=96&#38;d=&#38;r=PG" medium="image">
			<media:title type="html">screwloosecomics</media:title>
		</media:content>

		<media:content url="http://fishyandflashy.files.wordpress.com/2010/06/shinyorb_ex.png" medium="image">
			<media:title type="html">shinyorb_ex</media:title>
		</media:content>

		<media:content url="http://fishyandflashy.files.wordpress.com/2010/06/shinyorbs_gradientfill_ex.png" medium="image">
			<media:title type="html">shinyorbs_gradientfill_ex</media:title>
		</media:content>

		<media:content url="http://fishyandflashy.files.wordpress.com/2010/06/shinyorbs_fill2_ex.png" medium="image">
			<media:title type="html">shinyorbs_fill2_ex</media:title>
		</media:content>

		<media:content url="http://fishyandflashy.files.wordpress.com/2010/06/shinyorb_ex1.png" medium="image">
			<media:title type="html">shinyorb_ex1</media:title>
		</media:content>

		<media:content url="http://fishyandflashy.files.wordpress.com/2010/06/shinyorbs_heart.png" medium="image">
			<media:title type="html">shinyorbs_heart</media:title>
		</media:content>

		<media:content url="http://fishyandflashy.files.wordpress.com/2010/06/shinyorbs_smiler.png" medium="image">
			<media:title type="html">shinyorbs_smiler</media:title>
		</media:content>
	</item>
		<item>
		<title>Side-Scrolling Character Movement Tutorial &#8211; Flash Gaming</title>
		<link>http://fishyandflashy.wordpress.com/2010/06/22/side-scrolling-character-movement-tutorial-flash-gaming/</link>
		<comments>http://fishyandflashy.wordpress.com/2010/06/22/side-scrolling-character-movement-tutorial-flash-gaming/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 14:30:10 +0000</pubDate>
		<dc:creator>Screwed Loose</dc:creator>
				<category><![CDATA[Gaming Tutorials]]></category>
		<category><![CDATA[character movement]]></category>
		<category><![CDATA[gaming]]></category>

		<guid isPermaLink="false">http://fishyandflashy.wordpress.com/?p=41</guid>
		<description><![CDATA[A tutorial outlining the basics of character movment.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fishyandflashy.wordpress.com&amp;blog=14036855&amp;post=41&amp;subd=fishyandflashy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>This was originally posted on <a href="http://screwloosecomics.wordpress.com">my other site</a>.
</pre>
<p>Hey, guys! So, I’ve  decided to make some Flash game tutorials for  those of you interested in making games. I guess I should start from the  beginning, hence the character movement tut, here.</p>
<p><em>For this tutorial, I am assuming you know some ActionScript 2.  Just the littlest bit. <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Not an insane amount.</em></p>
<p>Okay, so moving your character is certainly one of the most important  aspects of RPG gameplay, among other things. In order to make sure  you’re on the same page I am, here’s a little link to what we will be  making. Just the basic side-scrolling character movement. Go to the link  below, click on the presentation to get focus, and look at it. Left and  right arrow keys to move, up to jump.</p>
<p><a href="http://www.swfcabin.com/open/1276795848">Character Movement  Expectations.</a></p>
<p><img title="More..." src="http://screwloosecomics.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /><span id="more-41"></span></p>
<p>Let’s pretend we just came up with the idea. We need to plan it out.  Even if you have an example of <em>exactly</em> what you’re making, you  need to plan it out. That’s how great code gets jumbled and painful to  come back and update.</p>
<p>Our character should be able to:</p>
<p>…move left and right when the corresponding keys are pressed, play a  walking animation, and change the way he is facing.</p>
<p>…jump when the up key or the spacebar is pressed and look like his  feet are “dangling” in the air.</p>
<p>…when he moves, he should be kept in the center of the screen until  he comes to either wall, and then be able to move out of the center.</p>
<p>That’s everything. Let’s get started.</p>
<p><strong>Part One  &#8211; Mechanical</strong></p>
<p>The “mechanical” part is pretty much void of intense coding. We’re  just setting up our stage. I’m just going to give you hard directions  here, but feel free to take some creative license.</p>
<p><a href="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_1.png"><img title="charactermov_1" src="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_1.png?w=132&#038;h=82" alt="" width="132" height="82" /></a>Draw a line the width of the stage  and place it close to the bottom. Convert this to a movie clip. Name it  whatever you want, but when you get back to the stage, name the instance  of the movie clip you have on there “ground”.</p>
<p>On to the character. Draw four circles; a large one for the head, a  smaller one just below it, and two even smaller<a href="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_2.png"><img title="charactermov_2" src="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_2.png?w=251&#038;h=156" alt="" width="251" height="156" /></a> ones below that for the feet.  Convert this entire thing to a movie clip and name the instance on the  stage “character”.</p>
<p>Next, we’ll create the background. For testing and practical  purposes, there must be some way to tell if you’re moving at all, so we  will make the background a gradient. If you had a full-fledged game, you  might not need this. Example, in a Mario-style game, there would be  platforms, enemies, hills, holes, etc, to tell you that you’re moving.  So, draw a square without outlines. Make this square have a linear  gradient fill (Windows &gt; Color Mixer, if you don’t already have it  open). For those who haven’t done this before: Open the window. Select <a href="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_3.png"><img title="charactermov_3" src="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_3.png?w=300&#038;h=118" alt="" width="300" height="118" /></a>the fill icon. In the Type  drop-down box, select “linear”. Proceed to make your gradient. I used  three colors because it was a little more obvious. Now, after you’ve  done that, select your square and make it 1,000 pixels wide and, for the  width, it’ll be “the height of the stage minus the height of your  ground”. Position it at (0,0) and it should extend out the right side of  the screen. Convert it to a movie clip and name the instance “bg”.</p>
<p>The last thing we are going to do is make our character animations.  He has to <em>look</em> like he’s walking, right? So, go into your  “character” movie clip and name the first frame “standing”. In the  actions panel for that frame, type stop();. Create three new frames (for  a total of four). Name them “walking”, “jumping”, and “attacking”. (We  will not be going over attacks in this tutorial, but I will provide the  link to that tutorial at the bottom.)<a href="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_4.png"><img title="charactermov_4" src="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_4.png?w=246&#038;h=153" alt="" width="246" height="153" /></a></p>
<p>Now, go back to the walking frame. Convert everything inside of it to  a movie clip. Go inside the move clip. Convert the two feet ONLY into  two separate movie clips. Highlight them, right-click, and press  “distribute to layers”. This allows you to animate them separately.  Create a keyframe at 20 for both of them. At frame twenty, switch the  places of the two feet. Now, create motion tweens for both of them.  Ta-da! A walking animation.</p>
<p>Next, we’ll do the jumping. Go back to the character and go to the  jumping frame. Since our <a href="http://screwloosecomics.files.wordpress.com/2010/06/charactermov5.png"><img title="charactermov5" src="http://screwloosecomics.files.wordpress.com/2010/06/charactermov5.png?w=219&#038;h=136" alt="" width="219" height="136" /></a>jumping isn’t an animation, we  don’t need to make another movie clip. Just make his feet look spread or  whatever. Think <em>Mario</em>.</p>
<p>And, we’re done! Let’s get to the coding, shall we?</p>
<p><strong>Part Two &#8211; ActionScripting The Jump</strong></p>
<p>We’ll start at the top of our first frame with the almighty stop();.  It’s good to get in this habit, because what if you want to add some  frames after this or something? Anyways, next we’ll create a basic  function:</p>
<pre>onEnterFrame = function(){
}</pre>
<p>I always put in both brackets so I don’t forget them later. Anyways,  what this at-first-glance-useless function does is create a “loop” of  sorts. So if I were to say, “If a variable is equal to a value” outside  of this, it would only check once. But this will continue to check as  long as you’re in the frame. Handy if you want to constantly check for  key presses.</p>
<p>Let’s start with the hardest part first &#8211; <em>jumping</em>. We need to  “simulate” gravity with this. Nothing too complex, just as we go up, the  amount we subtract from our character’s <em>y</em> coordinate gets  smaller and smaller, until we go down (because now we’re adding) and  then hit ground level and the whole process stops.</p>
<p><a href="http://screwloosecomics.files.wordpress.com/2010/06/charactermov6.png"><img title="charactermov6" src="http://screwloosecomics.files.wordpress.com/2010/06/charactermov6.png?w=232&#038;h=144" alt="" width="232" height="144" /></a>A little reminder for those new to  flash: the <em>x</em> and <em>y</em> coordinates are <em>not</em> the same as  those you learned in geometry. The origin (0<em>x</em>, 0<em>y</em>) is at  the top left-hand corner. As you go down, you <em>add</em> to the <em>y</em> value, not subtract.</p>
<p>Place this piece of code inside your onEnterFrame function.</p>
<pre>if(Key.isDown(Key.UP) &amp;&amp; !jumping) {
jumping = true;
jumpingSpeed = jumpingSpeedPerm;
}</pre>
<p>What this code does is essentially “if I’m pressing the UP key, AND  I’m not already jumping, then I am jumping (our jumping variable is set  to true) and I’m resetting the speed of my jump”. Now, the jumpingSpeed  variable is not actually jump speed. Instead, it is the value we  subtract from our character’s <em>y</em> value for that “jump” movement.  And it constantly decreases (as we will see in our next piece of code).  So we need to reset it each time we jump.</p>
<p>Now, we want that bit of code (that sets the jumping variable equal  to true) to trigger another piece of code. Put this in the onEnterFrame  function:</p>
<pre>if(jumping==true) {
jumpingSpeed--;
character._y -= jumpingSpeed;
character.gotoAndStop("jumping");
if(character._y &gt; groundLevel) {
character._y = groundLevel;
jumping = false;
}
}</pre>
<p>What this says is “if jumping equals true, then subtract one from my  jump speed, and subtract the result from my character’s y.” You see what  this does? If we keep subtracting from our jump speed, eventually we’ll  have a negative number. Then if we subtract <em>that</em> from our  character’s <em>y</em> value, it will essentially be adding, which will  send our character down at some point.</p>
<p>The next line of code tells the character movie clip to go to our  Mario-equse jumping frame.</p>
<p>Finally, we reach our ground exception. We want this jump cycle to  STOP as soon as we touch the ground. So, if the character’s <em>y</em> value becomes greater than the ground level (which is defined in a  variable as we will later use it for platforms), we set the character’s y  value to the value of ground level and set the jumping variable to stop  which breaks the cycle. Now, if the user continues to hold down the up  key&#8230;</p>
<p>Now, define the variables we just referenced at the top, <em>out</em> of the onEnterFrame function.</p>
<pre>jumping = false;
jumpingSpeedPerm = 20;
jumpingSpeed = 0;
groundLevel = ground._y - _root.character._height;</pre>
<p>Ta-DA! Test it to make sure it works. Jump a few times.</p>
<p><strong>Part Three &#8211; Actionscripting the Movement</strong></p>
<p>Here’s to our last and final part &#8211; character movement.</p>
<p>Let’s begin by making a new function, out of the onEnterFrame  function.</p>
<pre>character.onEnterFrame = function () {
}</pre>
<p>All this does is make referring to our character a whole lot easier.  So, anyways, for the left and right movement, what we’ll need to do is  use a sequence of if statements. It should be IF the left key is down,  do this, ELSE IF the right key is down, do this, ELSE switch to our  “standing” character frame. Let’s start with the right key. Inside the  character.onEnterFrame function:</p>
<pre>if(Key.isDown(Key.RIGHT)){
}</pre>
<p>This is our if statement. Inside of that, we’ll add our frame  control.</p>
<pre>if (!jumping){
this.gotoAndStop("walking");
} else if (jumping==true) {
this.gotoAndStop("jumping");
}</pre>
<p>Basically, what this does is if we aren’t jumping (!jumping) then we  go to the walking frame. But if we ARE jumping, we go to the jumping  frame. Good?</p>
<p>Directly under that we’ll add:</p>
<pre>this._xscale = -100;
if ((_root.bg._x + (bg._width-100))&lt;=500){
if ((this._x)&gt;=500){
this._x += 0;
} else {
this._x += 15;
}
}</pre>
<p>What the first line does is switch the orientation of our character.  It turns right, rotating on the registration point. Here, you should  stop and make sure that, inside your character movie clip, the  registration point (the little X) is in the middle-top of his head.<a href="http://screwloosecomics.files.wordpress.com/2010/06/charactermov7.png"><img title="charactermov7" src="http://screwloosecomics.files.wordpress.com/2010/06/charactermov7.png?w=90&#038;h=127" alt="" width="90" height="127" /></a></p>
<p>The next piece of code, the if statement, refers to the background.  It says “if the background’s right edge (which is the background’s x  value plus the width of the background plus some room for error) is less  than or equal to five-hundred (the right edge of the stage), then allow  the character to move ONLY IF the character is inside of the screen  (not past the edge of the stage, which is at 500)”.</p>
<p>Got it? Good. Next, below that, hinging on the last if statement:</p>
<pre>else {
if(this._x&gt;=250){
_root.bg._x -= 15;
} else {
this._x += 15;
}
}</pre>
<p>This is just the else statement if our bg movie clip has NOT hit the  edge of the stage. It also contains another if statement for aligning  the character movie clip in the middle of the screen (at the 250 x  value).</p>
<p>Now we repeat that whole beautiful process for the other key, with a  few minor changes (highlighted):</p>
<pre>} else if(Key.isDown(Key.LEFT)){
if (!jumping){
this.gotoAndStop("walking");
} else if (jumping==true) {
this.gotoAndStop("jumping");
}<strong>
this._xscale = 100;
if (_root.bg._x&gt;=0){</strong>
if ((this._x-((1/2)*this._width))<strong>&lt;=0</strong>){
this._x -= 0;
} else {
this._x<strong> -=</strong> 15;
}
} else {
if(this._x<strong>&lt;=</strong>250){
_root.bg._x <strong>+= </strong>15;
} else {
this._x <strong>-=</strong> 15;
}
}</pre>
<p>These changes just change the direction we’re moving (plus symbols  change to minus, etc). Our xscale is now positive, so he faces left. The  biggest change is for testing for the bg’s left edge. We know that the  bg’s left edge is EXACTLY at its x value, so we don’t need to add  anything. Also, we’re only testing for it hitting zero, the stage’s left  edge value.</p>
<p>Now, here’s the last part. Hinge this on the last if statement we  did:</p>
<pre>} else {
this.gotoAndStop("standing");
}</pre>
<p>So, when neither key is pressed, we go to the “standing” frame in the  character.</p>
<p>Ta-DA! Now, you’re done! Test it out. If you see any errors in this  tutorial, need help, have questions, comments, etc, please post a  comment and I will get back to you.</p>
<p><strong>(Click on the link, click free download. Then you&#8217;ll have to wait  60 secs. Then click free download again.)</strong></p>
<p><a href="http://uploading.com/files/278fb5md/charctermovement.fla/">You  can also download the whole .fla file here.</a></p>
<p>Thanks!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fishyandflashy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fishyandflashy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fishyandflashy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fishyandflashy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fishyandflashy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fishyandflashy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fishyandflashy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fishyandflashy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fishyandflashy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fishyandflashy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fishyandflashy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fishyandflashy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fishyandflashy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fishyandflashy.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fishyandflashy.wordpress.com&amp;blog=14036855&amp;post=41&amp;subd=fishyandflashy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fishyandflashy.wordpress.com/2010/06/22/side-scrolling-character-movement-tutorial-flash-gaming/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee92894aa0c8eaa1a9308a3c4222ae5e?s=96&#38;d=&#38;r=PG" medium="image">
			<media:title type="html">screwloosecomics</media:title>
		</media:content>

		<media:content url="http://screwloosecomics.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" medium="image">
			<media:title type="html">More...</media:title>
		</media:content>

		<media:content url="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_1.png?w=300" medium="image">
			<media:title type="html">charactermov_1</media:title>
		</media:content>

		<media:content url="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_2.png?w=300" medium="image">
			<media:title type="html">charactermov_2</media:title>
		</media:content>

		<media:content url="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_3.png?w=300" medium="image">
			<media:title type="html">charactermov_3</media:title>
		</media:content>

		<media:content url="http://screwloosecomics.files.wordpress.com/2010/06/charactermov_4.png?w=300" medium="image">
			<media:title type="html">charactermov_4</media:title>
		</media:content>

		<media:content url="http://screwloosecomics.files.wordpress.com/2010/06/charactermov5.png?w=300" medium="image">
			<media:title type="html">charactermov5</media:title>
		</media:content>

		<media:content url="http://screwloosecomics.files.wordpress.com/2010/06/charactermov6.png?w=300" medium="image">
			<media:title type="html">charactermov6</media:title>
		</media:content>

		<media:content url="http://screwloosecomics.files.wordpress.com/2010/06/charactermov7.png" medium="image">
			<media:title type="html">charactermov7</media:title>
		</media:content>
	</item>
		<item>
		<title>superHero &#8211; a game in progress.</title>
		<link>http://fishyandflashy.wordpress.com/2010/06/21/superhero-a-game-in-progress/</link>
		<comments>http://fishyandflashy.wordpress.com/2010/06/21/superhero-a-game-in-progress/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 23:49:06 +0000</pubDate>
		<dc:creator>Screwed Loose</dc:creator>
				<category><![CDATA[Works-in-Progress]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[superhero]]></category>

		<guid isPermaLink="false">http://fishyandflashy.wordpress.com/?p=35</guid>
		<description><![CDATA[A cool superhero RPG game that's in the works.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fishyandflashy.wordpress.com&amp;blog=14036855&amp;post=35&amp;subd=fishyandflashy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hey, guys! So, I&#8217;ve been working on a rather extensive game lately with my brothers. It&#8217;s nowhere near finished, but I wanted to share with you all and ask what you think. ^,^ It&#8217;s called superHero, with a lot of customization features. Here are some pics:</p>
<p><a href="http://fishyandflashy.files.wordpress.com/2010/06/superheropic.png"><img class="aligncenter size-medium wp-image-36" title="superheropic" src="http://fishyandflashy.files.wordpress.com/2010/06/superheropic.png?w=300&#038;h=179" alt="" width="300" height="179" /></a><a href="http://fishyandflashy.files.wordpress.com/2010/06/superheropic3.png"><img class="aligncenter size-medium wp-image-37" title="superheropic3" src="http://fishyandflashy.files.wordpress.com/2010/06/superheropic3.png?w=300&#038;h=179" alt="" width="300" height="179" /></a></p>
<p>And now, you can go play <a href="http://www.swfcabin.com/open/1277159185">superHero</a>.</p>
<p>Thanks!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fishyandflashy.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fishyandflashy.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fishyandflashy.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fishyandflashy.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fishyandflashy.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fishyandflashy.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fishyandflashy.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fishyandflashy.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fishyandflashy.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fishyandflashy.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fishyandflashy.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fishyandflashy.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fishyandflashy.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fishyandflashy.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fishyandflashy.wordpress.com&amp;blog=14036855&amp;post=35&amp;subd=fishyandflashy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fishyandflashy.wordpress.com/2010/06/21/superhero-a-game-in-progress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee92894aa0c8eaa1a9308a3c4222ae5e?s=96&#38;d=&#38;r=PG" medium="image">
			<media:title type="html">screwloosecomics</media:title>
		</media:content>

		<media:content url="http://fishyandflashy.files.wordpress.com/2010/06/superheropic.png?w=300" medium="image">
			<media:title type="html">superheropic</media:title>
		</media:content>

		<media:content url="http://fishyandflashy.files.wordpress.com/2010/06/superheropic3.png?w=300" medium="image">
			<media:title type="html">superheropic3</media:title>
		</media:content>
	</item>
		<item>
		<title>Random Numbers &amp; Random Frames &#8211; Flash Basics</title>
		<link>http://fishyandflashy.wordpress.com/2010/06/21/random-numbers-random-frames-flash-basics/</link>
		<comments>http://fishyandflashy.wordpress.com/2010/06/21/random-numbers-random-frames-flash-basics/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 20:12:16 +0000</pubDate>
		<dc:creator>Screwed Loose</dc:creator>
				<category><![CDATA[Basic Tutorials]]></category>
		<category><![CDATA[basic tutorials]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[random numbers]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://fishyandflashy.wordpress.com/?p=18</guid>
		<description><![CDATA[A basic tutorial that explains how to use random numbers to accomplish various tasks.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fishyandflashy.wordpress.com&amp;blog=14036855&amp;post=18&amp;subd=fishyandflashy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hey, guys! <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, anyways, if you&#8217;re newer to flash, you may run into the problem of random frames/random numbers. For example, a vertical shooter and random motion of the enemies. Or just creating cards that, when &#8220;flipped&#8221;, randomly selected backings.</p>
<p>Well, a way to do this is with the <em>random(); </em>function.</p>
<pre>variable = random(<span style="color:#ff0000;">number</span>) + <span style="color:#0000ff;">min</span>;

<span id="more-18"></span></pre>
<p>The <em>random();</em> function chooses a variable for the first <span style="color:#ff0000;"><em>number</em></span> of number you specify (that&#8217;s not confusing at all <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ). Here&#8217;s the problem, though: zero counts as a number. This is where our minimum (<span style="color:#0000ff;"><em>min</em></span>) number comes in. If you want the random variable to pick a number from one to ten and you use this code:</p>
<pre>variable = random(10);</pre>
<p>It will count the zero, <em>meaning</em> that it will pick a random number between zero and nine. So, we add one to the whole thing if we want to &#8220;offset&#8221; the count and make the number we put inside the function true:</p>
<pre>variable = random(10) + 1;</pre>
<p>Now it will choose between one and ten! However, if you want it to include zero <em>and</em> count to ten, you would use:</p>
<pre>variable = random(11);</pre>
<p>You don&#8217;t have to set it to a variable, but for many cases it is easier. Here are some examples in which you might not want to set it to a variable:</p>
<pre>movieClip.gotoAndStop(random(number)+min);</pre>
<p>That&#8217;s the basic format. A more intelligent snippet would be:</p>
<pre>movieClip.gotoAndStop(random(<span style="color:#0000ff;">movieClip._totalframes</span>)+1);</pre>
<p>This works best because you do not have to reset the code if you, say, edit the movie clip. It&#8217;s a little more automated. The code highlighted in blue (<em>movieClip._totalframes</em>) gets the number of frames in the move clip in a number. Then, we add one, for reasons explained above.</p>
<p>I&#8217;ve made an example of random numbers in action. This is a pretty basic and rather boring betting game, but there are plenty of ways it could be spiced up. Graphics, such as cards, instead of text, for example.</p>
<p><a href="http://www.swfcabin.com/open/1277149637">Please click here to view my example.</a></p>
<p>Well, here ends a basic tutorial, but don&#8217;t stop there. There are tons of things you can accomplish with random numbers, especially in game programming. Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fishyandflashy.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fishyandflashy.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fishyandflashy.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fishyandflashy.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fishyandflashy.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fishyandflashy.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fishyandflashy.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fishyandflashy.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fishyandflashy.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fishyandflashy.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fishyandflashy.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fishyandflashy.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fishyandflashy.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fishyandflashy.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fishyandflashy.wordpress.com&amp;blog=14036855&amp;post=18&amp;subd=fishyandflashy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fishyandflashy.wordpress.com/2010/06/21/random-numbers-random-frames-flash-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ee92894aa0c8eaa1a9308a3c4222ae5e?s=96&#38;d=&#38;r=PG" medium="image">
			<media:title type="html">screwloosecomics</media:title>
		</media:content>
	</item>
	</channel>
</rss>
