STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229702 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2596 · P5192 |
This is the info page for Flash #55834 |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">So, you wanna make a platformer</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0"> game? Well, you've come to the</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">right place! The game will include:</font></p> |
<p align="center"><font face="Karma Future" size="23" color="#000033" letterSpacing="0.000000" kerning="0">Movement</font></p><p align="center"><font face="Karma Future" size="23" color="#000033" letterSpacing="0.000000" kerning="0">Gravity</font></p><p align="center"><font face="Karma Future" size="23" color="#000033" letterSpacing="0.000000" kerning="0">Floors</font></p><p align="center"><font face="Karma Future" size="23" color="#000033" letterSpacing="0.000000" kerning="0">Doors</font></p><p align="center"><font face="Karma Future" size="23" color="#000033" letterSpacing="0.000000" kerning="0">Walls</font></p><p align="center"><font face="Karma Future" size="23" color="#000033" letterSpacing="0.000000" kerning="0">Enemy AI</font></p><p align="center"><font face="Karma Future" size="23" color="#000033" letterSpacing="0.000000" kerning="0">Attacks</font></p><p align="center"><font face="Karma Future" size="23" color="#000033" letterSpacing="0.000000" kerning="0">Health And Items/Powerups.</font></p> |
<p align="center"><font face="Karma Future" size="15" color="#000000" letterSpacing="0.000000" kerning="0">(arrow keys to move, up to jump, SHIFT to run)</font></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Lets begin with movement! By the </font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">end of this section, you should</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">end up with something like what is</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">shown below.</font></p><p align="center"></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">First, make your character. Make</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">3 frames. Put animations in this</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">order:</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0"> 1: Standing</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">2: Running</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">3: Jumping</font></p><p align="center"></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Now, make a rectangle. Turn it into</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">a movie clip. Give it an instance</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">name of 'ground'(remove quotes).</font></p><p align="center"></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Now onto the coding!</font></p><p align="center"></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">First, we need to declare some</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">variables. Select the player</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">and press F9 to bring up the</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">actions panel. Now, write this:</font></p> |
onClipEvent(load) { |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Now the variables. Write this:</font></p> |
var speed:Number = 0; var walk:Number = 3; var run:Number = 6; var grav:Number = 0; var falling:Number = 0; var jumped:Boolean = false; var jumpHeight:Number = 15; var touchingGround:Boolean = false; var scale:Number = _xscale; |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Explanation:</font></p> |
<p align="center"><font face="Karma Future" size="17" color="#00cc00" letterSpacing="0.000000" kerning="0">var speed:Number = 0;</font></p><p align="center"><font face="Karma Future" size="17" color="#000000" letterSpacing="0.000000" kerning="0">This declares the variable 'speed' with a value of 0</font></p><p align="center"><font face="Karma Future" size="17" color="#00cc00" letterSpacing="0.000000" kerning="0">var walk:Number = 3;</font></p><p align="center"><font face="Karma Future" size="17" color="#000000" letterSpacing="0.000000" kerning="0">This declares a variable 'walk' with a value of 3</font></p><p align="center"><font face="Karma Future" size="17" color="#00cc00" letterSpacing="0.000000" kerning="0">var run:Number = 6;</font></p><p align="center"><font face="Karma Future" size="17" color="#000000" letterSpacing="0.000000" kerning="0">This declares a variable'run' with a value of 6</font></p><p align="center"><font face="Karma Future" size="17" color="#00cc00" letterSpacing="0.000000" kerning="0">var grav:Number = 0;</font></p><p align="center"><font face="Karma Future" size="17" color="#000000" letterSpacing="0.000000" kerning="0">This declares a variable'grav'with a value of 0</font></p><p align="center"><font face="Karma Future" size="17" color="#00cc00" letterSpacing="0.000000" kerning="0">var falling:Number = 0;</font></p><p align="center"><font face="Karma Future" size="17" color="#000000" letterSpacing="0.000000" kerning="0">This declares a variable 'falling' with a value of 0</font></p><p align="center"></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Explanation:</font></p> |
<p align="center"><font face="Karma Future" size="17" color="#00cc00" letterSpacing="0.000000" kerning="0">var jumped:Boolean = false;</font></p><p align="center"><font face="Karma Future" size="17" color="#000000" letterSpacing="0.000000" kerning="0">This declares a variable 'jumped', making it a false <sbr />function.</font></p><p align="center"><font face="Karma Future" size="17" color="#00cc00" letterSpacing="0.000000" kerning="0">var jumpHeight:Number = 15;</font></p><p align="center"><font face="Karma Future" size="17" color="#000000" letterSpacing="0.000000" kerning="0">This declares a variable'jumpHeight'with a value of 15</font></p><p align="center"><font face="Karma Future" size="17" color="#00cc00" letterSpacing="0.000000" kerning="0">var touchingGround:Boolean = false;</font></p><p align="center"><font face="Karma Future" size="17" color="#000000" letterSpacing="0.000000" kerning="0">This declares a variable'touchingGround', making it a </font></p><p align="center"><font face="Karma Future" size="17" color="#000000" letterSpacing="0.000000" kerning="0">false function.</font></p><p align="center"><font face="Karma Future" size="17" color="#00cc00" letterSpacing="0.000000" kerning="0">var scale:Number = _xscale;</font></p><p align="center"><font face="Karma Future" size="17" color="#000000" letterSpacing="0.000000" kerning="0">This declares a variable'scale', which has the same <sbr />value as the player's _xscale.</font></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="20" color="#000000" letterSpacing="0.000000" kerning="0">Now close the onClipEvent (load) function by adding</font></p><p align="center"><font face="Karma Future" size="20" color="#000000" letterSpacing="0.000000" kerning="0">} at the end.</font></p><p align="center"><font face="Karma Future" size="20" color="#000000" letterSpacing="0.000000" kerning="0">Now for the code that will get him moving!</font></p><p align="center"><font face="Karma Future" size="20" color="#000000" letterSpacing="0.000000" kerning="0">Start with this:</font></p> |
onClipEvent(enterFrame) { |
<p align="center"><font face="Karma Future" size="22" color="#000000" letterSpacing="0.000000" kerning="0">Everything in this is executed at the frame rate </font></p><p align="center"><font face="Karma Future" size="22" color="#000000" letterSpacing="0.000000" kerning="0">every second(in this case, 30)</font></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Below that script, put the code below in.</font></p> |
if (!touchingGround) { grav++; this._y += grav; } else { grav = 0; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Explanation</font></p> |
<p align="center"><font face="Karma Future" size="20" color="#00cc00" letterSpacing="0.000000" kerning="0">if (!touchingGround) {</font></p><p align="center"><font face="Karma Future" size="20" color="#000000" letterSpacing="0.000000" kerning="0">This checks if our variable touchingGround <sbr />is false.If so...</font></p><p align="center"><font face="Karma Future" size="20" color="#00cc00" letterSpacing="0.000000" kerning="0">grav++;</font></p><p align="center"><font face="Karma Future" size="20" color="#000000" letterSpacing="0.000000" kerning="0">Our var grav increases by 1</font></p><p align="center"><font face="Karma Future" size="20" color="#00cc00" letterSpacing="0.000000" kerning="0">this._y += grav;</font></p><p align="center"><font face="Karma Future" size="20" color="#000000" letterSpacing="0.000000" kerning="0">The _y of our player moves down(yes, down) by <sbr />how much grav is.</font></p><p align="center"></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Explanation</font></p> |
<p align="center"><font face="Karma Future" size="20" color="#00cc00" letterSpacing="0.000000" kerning="0">} else {</font></p><p align="center"><font face="Karma Future" size="20" color="#000000" letterSpacing="0.000000" kerning="0">Basically means if anthting other than this <sbr />happens(if touchingGround is true).</font></p><p align="center"><font face="Karma Future" size="20" color="#00cc00" letterSpacing="0.000000" kerning="0">grav = 0;</font></p><p align="center"><font face="Karma Future" size="20" color="#000000" letterSpacing="0.000000" kerning="0">Makes our variable grav = 0.</font></p><p align="center"><font face="Karma Future" size="20" color="#00cc00" letterSpacing="0.000000" kerning="0">}</font></p><p align="center"><font face="Karma Future" size="20" color="#000000" letterSpacing="0.000000" kerning="0">Closes the if statement.</font></p><p align="center"></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">All that code makes the gravity!</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Physics isn't always hard, see!</font></p> |
<p align="left"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Anyway, lets finish the code,</font></p><p align="left"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">so he doesn't fall through the</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">ground.</font></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Add this underneath the last code:</font></p> |
if (_root.ground.hitTest(_x,_y,true)) { touchingGround = true; } else { touchingGround = false; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Explanation</font></p> |
<p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">if(_root.ground.hitTest(_x,_y,true)) {</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Test's if the ground is hitting the <sbr />player's _x,_y and that hitting it is <sbr />true. If so...</font></p><p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">touchingGround = true;</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Our variable touchingGround is true!</font></p><p align="center"></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Explanation</font></p> |
<p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">} else {</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">If it's not touching the <sbr />ground...</font></p><p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">touchingGround = false;</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">touchingGround is false, which <sbr />means he falls!</font></p><p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">}</font></p><p align="center"></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Now test your movie. He falls and</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">stops on the ground!</font></p> |
<p align="left"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Now onto making him move!</font></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Add this beneath:</font></p> |
if (Key.isDown(Key.LEFT)) { _x -= speed; this.gotoAndStop(2); _xscale = -scale; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Explanation</font></p> |
<p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">if (Key.isDown(Key.LEFT)) {</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Checks if the key LEFT is down</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">(left arrow key). If so...</font></p><p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">_x -= speed;</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">The player's _x is moved to the left</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">by the amount of speed.</font></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Explanation</font></p> |
<p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">this.gotoAndStop(2);</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Stops on frame 2 inside the player.</font></p><p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">_xscale = -scale;</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Basically, takes the player's _xscale</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">from the player's _xscale, flipping</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">him to face to the left!</font></p><p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">}</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Ends the if statement.</font></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Now to make him move to the right. Add this:</font></p> |
if (Key.isDown(Key.RIGHT)) { _x += speed; this.gotoAndStop(2); _xscale = +scale; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Explanation</font></p> |
<p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">if (Key.isDown(Key.LEFT)) {</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Checks if the key RIGHT is down</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">(right arrow key). If so...</font></p><p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">_x -= speed;</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">The player's _x is moved to the right</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">by the amount of speed.</font></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Explanation</font></p> |
<p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">this.gotoAndStop(2);</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Stops on frame 2 inside the player.</font></p><p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">_xscale = -scale;</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Basically, adds the player's _xscale</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">to the player's _xscale, flipping</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">him to face to the right!</font></p><p align="center"><font face="Karma Future" size="25" color="#00cc00" letterSpacing="0.000000" kerning="0">}</font></p><p align="center"><font face="Karma Future" size="25" color="#000000" letterSpacing="0.000000" kerning="0">Ends the if statement.</font></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Test your movie, and he runs across</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">the ground! You will notice that</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">when you let got of LEFT or RIGHT,</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">he stays running. We'll fix that</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">later. Now for the running by</font></p><p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">pressing SHIFT.</font></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Add this underneath:</font></p> |
if (Key.isDown(Key.SHIFT)) { speed = run; } else { speed = walk; } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
if (Key.isDown(Key.SHIFT)) { Checks if the Key SHIFT is down. If so... speed = run; speed = the value of run } else { If the key SHIFT isn't down... |
Explanation |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
speed = walk; speed = the value of walk } Ends the if statement. } Ends the onClipEvent statement. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
We may have ended the onClipEvent statement, but we're not done. I like to seperate the jump code (coming next) so I keep everything a slight bit more organised :). |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
So start with this again: |
onClipEvent(enterFrame) { |
<p align="center"><font face="Karma Future" size="30" color="#000000" letterSpacing="0.000000" kerning="0">Then...</font></p> |
if (jumped) { falling += 0.5; _y += falling; |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
if (jumped){ If the variable jumped is true... falling += 0.5; The variable falling keeps increasing by 5 _y += falling; The player's _y goes down by the value of falling |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
Now(this will be a lot)... |
if (touchingGround) { jumped = false; } } else { if (Key.isDown(Key.UP)) { jumped = true; falling = -jumpHeight; this.gotoAndStop(3); } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
if (touchingGround) { If touchingGround is true... jumped = false; jumped becomes false } Closes the if statement } else { If not, then... |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
if (Key.isDown(Key.UP)) { ...If The key UP is pressed(up arrow key)... jumped = true; jumped becomes true falling = -jumpHeight; falling is taken away by the value of jumpHeight. this.gotoAndStop(3); Goes to frame 3 of the player |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
} closes the if statement } closes the if (jumped) statement. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
Now some more: |
if ((Key.isDown(Key.UP)) and (Key.isDown(Key.LEFT))) { this.gotoAndStop(3); } |
Then... |
if ((Key.isDown(Key.UP)) and (Key.isDown(Key.RIGHT))) { this.gotoAndStop(3); } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
And... |
if ((!Key.isDown(Key.UP)) and (!touchingGround)) { this.gotoAndStop(3); } else if ((Key.isDown(Key.UP)) and (!touchingGround)) { this.gotoAndStop(3); } |
Finally: |
if ((_currentframe == 3) and (touchingGround)) { gotoAndStop(1) } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
So basically we've got: |
if ((Key.isDown(Key.UP)) and (Key.isDown(Key.LEFT))) { this.gotoAndStop(3); } if ((Key.isDown(Key.UP)) and (Key.isDown(Key.RIGHT))) { this.gotoAndStop(3); } if ((!Key.isDown(Key.UP)) and (!touchingGround)) { this.gotoAndStop(3); } else if ((Key.isDown(Key.UP)) and (!touchingGround)) { this.gotoAndStop(3); } if ((_currentframe == 3) and (touchingGround)) { gotoAndStop(1) } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
Explanation: |
if ((Key.isDown(Key.UP)) and (Key.isDown(Key.LEFT))) { If key's LEFT and UP are down... this.gotoAndStop(3); Goes to and stops on frame 3 inside the player } Ends the if statement. if ((Key.isDown(Key.UP)) and (Key.isDown(Key.RIGHT))) { If Key's RIGHT and UP are down... this.gotoAndStop(3); Goes to and stops on frame 3 inside the player } Ends the if statement |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
if ((!Key.isDown(Key.UP)) and (!touchingGround)) { If the key UP isn't down, and touchingGround is false... this.gotoAndStop(3); Goes to and stops on frame 3 inside the player } else if ((Key.isDown(Key.UP)) and (!touchingGround)) { Other than that, if the key UP is down and touchingGround is false... this.gotoAndStop(3); Goes to and stops on frame 3 inside the player } Ends the else if statement |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
if ((_currentframe == 3) and (touchingGround)) { If the current frame on the player's movieclip is 3 and touchingGround is true... gotoAndStop(1) Goes to and stops on frame 1 inside the player } Ends the if statement } Ends the onClipEvent statement. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
Almost done. 1 last thing beneath that: |
onClipEvent (keyUp) { gotoAndStop(1); } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Movement</font></p> |
onClipEvent (keyUp) { Everything inbetween { and } will happen when no key's are up. gotoAndStop(1); Goes to and stop's on frame 1 inside the player. } Ends the onClipEvent statement. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
All done on movement! Now onto doors and walls. This section will be a lot shorter. You should get something like the example below. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
Now, Draw a door. Make it a movieclip and give it an instance name of 'door'. Go inside it, make an opened door on the 2nd frame. Then click the first frame and press F9. Put: |
stop(); |
Now, make a wall. Convert it into a movieclip and give it an instance name of 'wall'. Then, draw a key, turn it into a movieclip and give it an instance name of 'key'. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
Now make a dynamic text box, and give it the var name 'keys', as shown below. Then, on the frame on the main timeline, put: |
_root.keys = 0 |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
Lets get going on the code then! Beneath all of your recent actionscript, begin with: |
onClipEvent (enterFrame) { |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
Now, we need to declare some more variables. Underneath the other ones, type: |
var doorOpened:Boolean = false; var haveKey:Boolean = false; |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
Explanation |
var doorOpened:Boolean = false; Makes a variable 'doorOpened' as a false function. var haveKey:Boolean = false; Makes a variable'haveKey' as a false function. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
Now, we need to get to the REAL coding. Underneath the onClipEvent you just wrote, put: |
if ((this.hitTest(_root.door)) and (!doorOpened)) { this._x -= speed; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
if ((this.hitTest(_root.door)) and (!doorOpened)) { Checks if the player is touching the door and if the var doorOpened is false. If so... this._x -= speed; The player's _x is taken away by the value of speed(Note: If the door is on the left of the player, change the - to a +) } Ends the if statement. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
That means if the door touches the player when it's closed, he cant go through the door. Test your movie, and hopefully he stops at the door! Now, lets get us opening the door by getting a key! |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
Now add: |
if ((this.hitTest(_root.door)) and (Key.isDown(Key.SPACE)) and (_root.keys>=1)) { _root.door.gotoAndStop(2); doorOpened = true; _root.keys -= 1; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
if ((this.hitTest(_root.door)) and (Key.isDown(Key.SPACE)) and (_root.keys>=1)) { Checks if this is touching the door, the key SPACE is down and if the value of keys is more than or equal to 1. If so... _root.door.gotoAndStop(2); Stops on frame 2 of the door movieclip |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
Now we need to make it so when we touch the key it dissapears and keys is increased by 1. Lets continue! |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
Next type this: |
if (this.hitTest(_root.key)) { _root.keys += 1; unloadMovie(_root.key); } if (_root.keys<0) { _root.keys = 0; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
if (this.hitTest(_root.key)) { If the player touches the key... _root.keys += 1; keys is increased by 1 unloadMovie(_root.key); It unloads key from the movie(makes it dissapear) } Ends the if statement. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
Now, to finish off, to make sure keys doesnt go to minus 1, add this: |
if (_root.keys<0) { _root.keys = 0; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
if (_root.keys<0) { If the value of keys is below 0... _root.keys = 0; keys becomes 0! } Ends the if statement. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
Thats doors done! Onto walls, which is extremely simple if you've been reading the explanations! Just add: |
if (this.hitTest(_root.wall)) { this._x -= speed; } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Doors And Walls</font></p> |
if (this.hitTest(_root.wall)) { If the player touches the wall... this._x -= speed; The player's _x is taken away by the value of speed. } Ends the if statement. } Ends the onClipEvent function. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
All done! Now onto a bit more advanced stuff: Enemy AI! Sadly, I'm not very strong in AI, so this will only be simple ai, but works and does work well. It's where it shoots when you come into distance of it. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
By the end of this part, you should end up with this: |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
Lets start then. Make an enemy. Make him a movieclip. Then, give him an instance name of 'enemy'(no quotes). Now, on the 1st frame, have a standing animation, and on the 2nd a shooting animation. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
Now onto the code. Begin with this: |
onClipEvent (load) { var egrav:Number = 0; var scale:Number = this._xscale; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
onClipEvent (load) { Inside this fuction, all this happens when the frame is loaded. var egrav:Number = 0; We create a variable 'egrav' with a value of 0 var scale:Number = this._xscale; We create a variable 'scale' with a value of the enemy's _xscale } Ends the onClipEvent function. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
Now that we've defined our variables, lets get onto the REAL code :D. Begin with: |
onClipEvent(enterFrame) { |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
Now, add: |
var distance:Number = 150; var tx:Number = this._x; var ty:Number = this._y; var sx:Number = _root.hero._x; var sy:Number = _root.hero._y; |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
var distance:Number = 150; Makes a variable 'distance' with a value of 150 var tx:Number = this._x; Makes a variable'tx' with a value of enemy's_x var ty:Number = this._y; Makes a variable'ty' with a value of enemy's_y var sx:Number = _root.hero._x; Makes a variable'sx' with a value of player's_x var sy:Number = _root.hero._y; Makes a variable'sy' with a value of player's_y |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
Now (take a good breath, this is complicated) add this: |
if (Math.sqrt((sx-tx)*(sx-tx)+(sy-ty)*(sy-ty))<distance) { if (tx<sx) { this.gotoAndStop(2); this._xscale = +scale; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
if (Math.sqrt((sx-tx)*(sx-tx)+(sy-ty)*(sy-ty))<distance) { Ok. Math sqrt gets the square root of the number. And then(in a shorter , slightly easier version: (player_s-enemy_x)*(player_x-enemy_x)+(player_y- enemy_y)*(player_y-enemy_y))<value of distance) if (tx<sx) { if enemy_x is smaller than player_x... this.gotoAndStop(2); Goes to and stops on frame 2 of the enemy. this._xscale = +scale; The enemy's _xscale is added to the enemy's _xscale } Ends the if (tx<sx) |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
Wow. Now, more. Add this: |
if (tx>sx) { this.gotoAndStop(2); this._xscale = -scale; } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
if (tx>sx) { If enemy's_x is smaller than player_x... this.gotoAndStop(2); Goes to and stops on frame 2 of the enemy this._xscale = -scale; } Ends the if tx>sx } Ends Math.sqrt |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
Alright. Now, if you test, when you go out of distance, he doesn't stop attacking! Lets fix it. Add this: |
if (Math.sqrt((sx-tx)*(sx-tx)+(sy-ty)*(sy-ty))>distance) { _root.enemy.gotoAndStop(1); } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
if (Math.sqrt((sx-tx)*(sx-tx)+(sy-ty)*(sy- ty))>distance) { Ok. Math sqrt gets the square root of the number. And then(in a shorter , slightly easier version: if (player_s-enemy_x)*(player_x- enemy_x)+(player_y-enemy_y)*(player_y- enemy_y))<ISNT value of distance)... this.gotoAndStop(1); Goes to and stops on frame 1 of the enemy. } Ends Math.sqrt |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
Now for health(which I will cover after this Enemy AI section). Add this: |
if((_currentframe==2)and(this.hitTest(_root.hero))) { _root.hp.health-- } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
if((_currentframe==2)and(this.hitTest(_root.hero))) { If the enemy's current frame is 2 and it's touching the hero... _root.hp.health-- The movieclip with the instance of hp's variable 'health' is decreased by 1 continuously. } Ends the if statement. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
Now, the enemy needs gravity of course. So lets add: |
if (_root.ground.hitTest(_x,_y,true)) { egrav = 0; } else { egrav++; _y += egrav; } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
if (_root.ground.hitTest(_x,_y,true)) { if the ground touches the enemy's _x, _y and this is true... egrav = 0; The variable'egrav' is given a value of 0 } else { If not, then... egrav++; egrav keeps increasing by 1 |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Enemy AI</font></p> |
_y += egrav; The enemy's _y is increased by the value of egrav(moves down) } Ends the if statement. } Ends the onClipEvent function. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Health And Score</font></p> |
Thats it! Now lets get onto health and score. By the end of this section, you should end up with this: |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Health And Score</font></p> |
Now, this is extremely simple(simplest part of tutorial). First, make a movieClip with a width of 100 and an instance name of hp, with a registration point to the left. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Health And Score</font></p> |
Now just draw a border around it so the player knows the limits of the health. Now, make a coin or something, turn it into a movieclip and add it to the stage as many times as you want. Finally, create a dynamic text box with a var name of 'score'. Now lets get started on the coding. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Health And Score</font></p> |
First, select the frame, and add: |
_root.score = 0 |
Makes the text with the var 'score' have a value of 0. Now, select the 'hp' movieclip. Add these actions to it: |
onClipEvent (load) { var health:Number = 100; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Health And Score</font></p> |
Explanation: |
onClipEvent (load) { Everything inbetween the curly brackets happen when the frame loads. var health:Number = 100; Makes a variable 'health' with a value of 100. } Ends the onClipEvent function. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Health And Score</font></p> |
Now, to make it work. Add: |
onClipEvent (enterFrame) { _width = health; if (_root.health<=0) { nextFrame(); } updateAfterEvent(); } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Health And Score</font></p> |
Explanation |
onClipEvent (enterFrame) { Everything after this is exectuted as many times as what the framerate is every second. _width = health; Makes the width of this movieclip the value of health. if (_root.health<=0) { Checks if health is equal to or below 0. If so... nextFrame(); Goes to and stops on the next frame. } Ends the if statement updateAfterEvent(); Keeps updating after each event. } Ends the onClipEvent function. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Health And Score</font></p> |
Now, test your movie and has the enemy hits you, you should lose health! Onto score. Select the coin movieclip(s) and add: |
onClipEvent(enterFrame) { if(this.hitTest(_root.hero)) { _root.score++ this.unloadMovie() } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Health And Score</font></p> |
onClipEvent(enterFrame) { Everything after this is exectuted as many times as what the framerate is every second. if(this.hitTest(_root.hero)) { If this touches the hero... _root.score++ score is increased by 1 this.unloadMovie() Unloads this(the coin) from the movie } Ends the if statement } Ends the onClipEvent function. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Health And Score</font></p> |
All done! Just make a new keyframe(F6) and make a you lose screen! Now, onto the last part :D. Attacks! |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Attacks</font></p> |
By the end of this part, you should end up with the below. |
a to attack |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Attacks</font></p> |
Now, this section is simple if you read the instructions CAREFULLY!! Now, on the player, make a fourth frame with an attacking animation. On the last frame of it, put this on the frame: |
_root.hero.attacked = false; _root.hero.gotoAndStop(1); |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Attacks</font></p> |
_root.hero.attacked = false; Makes the var on the hero's actions 'attacked' false. _root.hero.gotoAndStop(1); Stops on frame 1 of the hero. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Attacks</font></p> |
Now, add this to your variables list: |
var attacked:Boolean = false; |
Now, make sure you get the next bits in the right place. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Attacks</font></p> |
Before if (Key.isDown(Key.LEFT)), put. |
if (!attacked) { |
Then add an extra at the end of the if(Key.isDown(Key.SHIFT)) |
} |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Attacks</font></p> |
Finally, at the bottom of the code: |
onClipEvent (enterFrame) { if (Key.isDown(65)){ attacked = true; this.gotoAndStop(4); if(this.hitTest(_root.enemy)) { _root.enemy.unloadMovie(); } } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Attacks</font></p> |
if (Key.isDown(65)){ If Key a is down |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Attacks</font></p> |
Wheres the rest of the explanation? Use your own knowledge to figure it out ;). On the next frame are the key codes for the buttons on the keyboard: |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Attacks</font></p> |
65=A 66=B 67=C 68=D 69=E 70=F 71=G 72=H |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Attacks</font></p> |
73=I 74=J 75=K 76=L 77=M 78=N 79=O 80=P |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Attacks</font></p> |
81=Q 82=R 83=S 84=T 85=U 86=V 87=W 88=X 89=Y 90=Z |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Done!</font></p> |
Now, in case you got parts wrong, here's the codes: |
Player: |
onClipEvent (load) { var speed:Number = 0; var walk:Number = 3; var run:Number = 6; var grav:Number = 0; var falling:Number = 0; var jumped:Boolean = false; var jumpHeight:Number = 15; var touchingGround:Boolean = false; var scale:Number = _xscale; var doorOpened:Boolean = false; var attacked:Boolean = false; } onClipEvent (enterFrame) { if (!touchingGround) { grav++; this._y += grav; } else { grav = 0; } if (_root.ground.hitTest(_x, _y, true)) { touchingGround = true; } else { touchingGround = false; } if (!attacked) { if (Key.isDown(Key.LEFT)) { _x -= speed; this.gotoAndStop(2); _xscale = -scale; } if (Key.isDown(Key.RIGHT)) { _x += speed; this.gotoAndStop(2); _xscale = +scale; } if (Key.isDown(Key.SHIFT)) { speed = run; } else { speed = walk; } } } onClipEvent (enterFrame) { if (!attacked) { if (jumped) { falling += 0.5; _y += falling; if (touchingGround) { jumped = false; } } else { if (Key.isDown(Key.UP)) { jumped = true; falling = -jumpHeight; this.gotoAndStop(3); } } } if ((Key.isDown(Key.UP)) and (Key.isDown(Key.LEFT))) { this.gotoAndStop(3); } if ((Key.isDown(Key.UP)) and (Key.isDown(Key.RIGHT))) { this.gotoAndStop(3); } if ((!Key.isDown(Key.UP)) and (!touchingGround)) { this.gotoAndStop(3); } else if ((Key.isDown(Key.UP)) and (!touchingGround)) { this.gotoAndStop(3); } if ((_currentframe == 3) and (touchingGround)) { gotoAndStop(1); } } onClipEvent (keyUp) { if (!attacked) { gotoAndStop(1); } } onClipEvent (enterFrame) { if ((this.hitTest(_root.door)) and (!doorOpened)) { this._x -= speed; } if ((this.hitTest(_root.door)) and (Key.isDown(Key.SPACE)) and (_root.keys>=1)) { _root.door.gotoAndStop(2); doorOpened = true; _root.keys -= 1; } if (this.hitTest(_root.wall)) { this._x -= speed; } if (this.hitTest(_root.key)) { _root.keys += 1; unloadMovie(_root.key); } if (_root.keys<0) { _root.keys = 0; } } onClipEvent (enterFrame) { if (Key.isDown(65)){ attacked = true; this.gotoAndStop(4); if(this.hitTest(_root.enemy)) { _root.enemy.unloadMovie(); } } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Done!</font></p> |
Enemy: |
onClipEvent (load) { var egrav:Number = 0; var scale:Number = this._xscale; } onClipEvent (enterFrame) { var distance:Number = 150; var tx:Number = this._x; var ty:Number = this._y; var sx:Number = _root.hero._x; var sy:Number = _root.hero._y; if (Math.sqrt((sx-tx)*(sx-tx)+(sy-ty)*(sy-ty))<distance) { if (tx<sx) { this.gotoAndStop(3); this._xscale = +scale; } if (tx>sx) { this.gotoAndStop(3); this._xscale = -scale; } } if (Math.sqrt((sx-tx)*(sx-tx)+(sy-ty)*(sy-ty))>distance) { _root.enemy.gotoAndStop(1); } if((_currentframe==3)and(this.hitTest(_root.hero))) { _root.hp.health-- } if (_root.ground.hitTest(_x,_y,true)) { egrav = 0; } else { egrav++; _y += egrav; } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Done!</font></p> |
Hp: |
onClipEvent (load) { var health:Number = 100; } onClipEvent (enterFrame) { _width = health; if (_root.health<=0) { _root.gotoAndStop("lose"); } updateAfterEvent(); } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Done!</font></p> |
Coin: |
onClipEvent(enterFrame) { if(this.hitTest(_root.hero)) { _root.score++ this.unloadMovie() } } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Bonus!</font></p> |
I really congratulate you for reading this far. For that, here are some little extra additions that could enhance your platformer! |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">vCam</font></p> |
Vcam. A really awesome addition to your platformer. It basically works as the camera. So, make a box the size of your stage. Make it a movieclip, and on the frame INSIDE it, put: |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">vCam</font></p> |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">vCam</font></p> |
/*Copyright (c) 2006-2007 Sockpuppet Pty Ltd. All Rights Reserved.*/ import flash.geom.Matrix; import flash.geom.Transform; import flash.geom.ColorTransform; var copyrightNotice = "Copyright (c) 2006-2007 Sockpuppet Pty Ltd. All Rights Reserved. http://www.reanimator.net"; var reanimator = new Transform(this); var camera = new Transform(this._parent); var w:Number = Stage.width; var h:Number = Stage.height; this._visible = false; this.onEnterFrame = function () { this._parent.filters = this.filters; var stageMatrix:Matrix = reanimator.matrix; camera.colorTransform = reanimator.colorTransform; stageMatrix.invert(); stageMatrix.translate(w*.5, h*.5); camera.matrix = stageMatrix; } |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">vCam</font></p> |
Now, go outside the movieclip, select it and add: |
onClipEvent (enterFrame) { _x += (_root.player._x-_x)/4; } |
Basically follows the player sideways. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Added floors</font></p> |
Using the code, you can go inside the ground movieclip and add mulitple floors. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">Multiple attacks</font></p> |
You can have more than 1 attack, just change the code around, which shouldn't be too hard if you've been reading the explanations. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">AS2 Refrence</font></p> |
Here is a reference to simple commands that you should remember: |
stop(); Stops on the frame. play(); Plays from the frame. |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">AS2 Refrence</font></p> |
_alpha The alpha of the movieclip _currentframe the currentframe of the movieclip. _xmouse Your mouse's _x _ymouse Your mouse's _y _name The instance name of the movieclip var Used to make variables |
<p align="center"><font face="Karma Future" size="43" color="#cc0000" letterSpacing="0.000000" kerning="0">AS2 Refrence</font></p> |
You can also refer to the other codes I used in this tutorial. I'm not going to cover much, because really i didn't have to show you these anyway :P. Thanks for reading, this tutorial has come to an end :O. Now go make a great platformer! |
Song: Rave Heaven Everything by: Chunkycheese12 |
Menu? |
ActionScript [AS1/AS2]
Frame 1var bgm = new Sound(this); bgm.attachSound("bgm"); bgm.setVolume(100); bgm.start(0, 999999999999); NewgroundsAPI.connectMovie(4265); function itemHandler2(obj, item) { _quality = "HIGH"; myMenu.customItems[2].enabled = false; myMenu.customItems[3].enabled = true; myMenu.customItems[4].enabled = true; } function itemHandler3(obj, item) { _quality = "MEDIUM"; myMenu.customItems[2].enabled = true; myMenu.customItems[3].enabled = false; myMenu.customItems[4].enabled = true; } function itemHandler4(obj, item) { _quality = "LOW"; myMenu.customItems[2].enabled = true; myMenu.customItems[3].enabled = true; myMenu.customItems[4].enabled = false; } function itemHandler0(obj, item) { bgm.start(0, 999999999999); myMenu.customItems[0].enabled = false; myMenu.customItems[1].enabled = true; } function itemHandler1(obj, item) { bgm.stop(); myMenu.customItems[0].enabled = true; myMenu.customItems[1].enabled = false; } var myMenu = new ContextMenu(); myMenu.hideBuiltInItems(); myMenu.customItems.push(new ContextMenuItem("Music On", itemHandler0)); myMenu.customItems.push(new ContextMenuItem("Music Off", itemHandler1)); myMenu.customItems.push(new ContextMenuItem("High Quality", itemHandler2)); myMenu.customItems.push(new ContextMenuItem("Medium Quality", itemHandler3)); myMenu.customItems.push(new ContextMenuItem("Low Quality", itemHandler4)); myMenu.customItems[2].separatorBefore = true; myMenu.customItems[0].enabled = false; myMenu.customItems[2].enabled = false; _root.menu = myMenu;Frame 62stop(); start_mc.onPress = function () { play(); };Frame 121stop();Instance of Symbol 83 MovieClip in Frame 122onClipEvent (load) { var speed = 0; var walk = 3; var run = 6; var grav = 0; var falling = 0; var jumped = false; var jumpHeight = 15; var touchingGround = false; var scale = _xscale; } onClipEvent (enterFrame) { if (!touchingGround) { grav++; this._y = this._y + grav; } else { grav = 0; } if (this.hitTest(_root.ground)) { touchingGround = true; } else { touchingGround = false; } if (Key.isDown(37)) { _x = (_x - speed); this.gotoAndStop(2); _xscale = (-scale); } if (Key.isDown(39)) { _x = (_x + speed); this.gotoAndStop(2); _xscale = scale; } if (Key.isDown(16)) { speed = run; } else { speed = walk; } } onClipEvent (enterFrame) { if (jumped) { falling = falling + 0.5; _y = (_y + falling); if (touchingGround) { jumped = false; } } else if (Key.isDown(38)) { jumped = true; falling = -jumpHeight; this.gotoAndStop(3); } if (Key.isDown(38) and Key.isDown(37)) { this.gotoAndStop(3); } if (Key.isDown(38) and Key.isDown(39)) { this.gotoAndStop(3); } if ((!Key.isDown(38)) and (!touchingGround)) { this.gotoAndStop(3); } else if (Key.isDown(38) and (!touchingGround)) { this.gotoAndStop(3); } if ((_currentframe == 3) and touchingGround) { gotoAndStop (1); } } onClipEvent (keyUp) { gotoAndStop (1); }Frame 163stop(); _root.keys = 0;Instance of Symbol 83 MovieClip in Frame 163onClipEvent (load) { var speed = 0; var walk = 3; var run = 6; var grav = 0; var falling = 0; var jumped = false; var jumpHeight = 15; var touchingGround = false; var scale = _xscale; var doorOpened = false; } onClipEvent (enterFrame) { if (!touchingGround) { grav++; this._y = this._y + grav; } else { grav = 0; } if (this.hitTest(_root.ground)) { touchingGround = true; } else { touchingGround = false; } if (Key.isDown(37)) { _x = (_x - speed); this.gotoAndStop(2); _xscale = (-scale); } if (Key.isDown(39)) { _x = (_x + speed); this.gotoAndStop(2); _xscale = scale; } if (Key.isDown(16)) { speed = run; } else { speed = walk; } } onClipEvent (enterFrame) { if (jumped) { falling = falling + 0.5; _y = (_y + falling); if (touchingGround) { jumped = false; } } else if (Key.isDown(38)) { jumped = true; falling = -jumpHeight; this.gotoAndStop(3); } if (Key.isDown(38) and Key.isDown(37)) { this.gotoAndStop(3); } if (Key.isDown(38) and Key.isDown(39)) { this.gotoAndStop(3); } if ((!Key.isDown(38)) and (!touchingGround)) { this.gotoAndStop(3); } else if (Key.isDown(38) and (!touchingGround)) { this.gotoAndStop(3); } if ((_currentframe == 3) and touchingGround) { gotoAndStop (1); } } onClipEvent (keyUp) { gotoAndStop (1); } onClipEvent (enterFrame) { if (this.hitTest(_root.door) and (!doorOpened)) { this._x = this._x - speed; } if ((this.hitTest(_root.door) and Key.isDown(32)) and (_root.keys >= 1)) { _root.door.gotoAndStop(2); doorOpened = true; _root.keys = _root.keys - 1; } if (this.hitTest(_root.wall)) { this._x = this._x - speed; } if (this.hitTest(_root.key)) { _root.keys = _root.keys + 1; unloadMovie (_root.key); } if (_root.keys < 0) { _root.keys = 0; } }Frame 182stop();Instance of Symbol 83 MovieClip "hero" in Frame 182onClipEvent (load) { var speed = 0; var walk = 3; var run = 6; var grav = 0; var falling = 0; var jumped = false; var jumpHeight = 15; var touchingGround = false; var scale = _xscale; var doorOpened = false; } onClipEvent (enterFrame) { if (!touchingGround) { grav++; this._y = this._y + grav; } else { grav = 0; } if (_root.ground.hitTest(_x, _y, true)) { touchingGround = true; } else { touchingGround = false; } if (Key.isDown(37)) { _x = (_x - speed); this.gotoAndStop(2); _xscale = (-scale); } if (Key.isDown(39)) { _x = (_x + speed); this.gotoAndStop(2); _xscale = scale; } if (Key.isDown(16)) { speed = run; } else { speed = walk; } } onClipEvent (enterFrame) { if (jumped) { falling = falling + 0.5; _y = (_y + falling); if (touchingGround) { jumped = false; } } else if (Key.isDown(38)) { jumped = true; falling = -jumpHeight; this.gotoAndStop(3); } if (Key.isDown(38) and Key.isDown(37)) { this.gotoAndStop(3); } if (Key.isDown(38) and Key.isDown(39)) { this.gotoAndStop(3); } if ((!Key.isDown(38)) and (!touchingGround)) { this.gotoAndStop(3); } else if (Key.isDown(38) and (!touchingGround)) { this.gotoAndStop(3); } if ((_currentframe == 3) and touchingGround) { gotoAndStop (1); } } onClipEvent (keyUp) { gotoAndStop (1); } onClipEvent (enterFrame) { if (this.hitTest(_root.door) and (!doorOpened)) { this._x = this._x - speed; } if ((this.hitTest(_root.door) and Key.isDown(32)) and (_root.keys >= 1)) { _root.door.gotoAndStop(2); doorOpened = true; _root.keys = _root.keys - 1; } if (this.hitTest(_root.wall)) { this._x = this._x - speed; } if (this.hitTest(_root.key)) { _root.keys = _root.keys + 1; unloadMovie (_root.key); } if (_root.keys < 0) { _root.keys = 0; } }Instance of Symbol 269 MovieClip "enemy" in Frame 182onClipEvent (load) { var egrav = 0; var scale = this._xscale; } onClipEvent (enterFrame) { var distance = 150; var tx = this._x; var ty = this._y; var sx = _root.hero._x; var sy = _root.hero._y; if (Math.sqrt(((sx - tx) * (sx - tx)) + ((sy - ty) * (sy - ty))) < distance) { if (tx < sx) { this.gotoAndStop(3); this._xscale = scale; } if (tx > sx) { this.gotoAndStop(3); this._xscale = -scale; } } if (Math.sqrt(((sx - tx) * (sx - tx)) + ((sy - ty) * (sy - ty))) > distance) { _root.enemy.gotoAndStop(1); } if ((_currentframe == 3) and this.hitTest(_root.player)) { _root.health--; } if (_root.ground.hitTest(_x, _y, true)) { egrav = 0; } else { egrav++; _y = (_y + egrav); } }Frame 200stop(); score = 0; keys = 0;Instance of Symbol 83 MovieClip "hero" in Frame 200onClipEvent (load) { var speed = 0; var walk = 3; var run = 6; var grav = 0; var falling = 0; var jumped = false; var jumpHeight = 15; var touchingGround = false; var scale = _xscale; var doorOpened = false; } onClipEvent (enterFrame) { if (!touchingGround) { grav++; this._y = this._y + grav; } else { grav = 0; } if (_root.ground.hitTest(_x, _y, true)) { touchingGround = true; } else { touchingGround = false; } if (Key.isDown(37)) { _x = (_x - speed); this.gotoAndStop(2); _xscale = (-scale); } if (Key.isDown(39)) { _x = (_x + speed); this.gotoAndStop(2); _xscale = scale; } if (Key.isDown(16)) { speed = run; } else { speed = walk; } } onClipEvent (enterFrame) { if (jumped) { falling = falling + 0.5; _y = (_y + falling); if (touchingGround) { jumped = false; } } else if (Key.isDown(38)) { jumped = true; falling = -jumpHeight; this.gotoAndStop(3); } if (Key.isDown(38) and Key.isDown(37)) { this.gotoAndStop(3); } if (Key.isDown(38) and Key.isDown(39)) { this.gotoAndStop(3); } if ((!Key.isDown(38)) and (!touchingGround)) { this.gotoAndStop(3); } else if (Key.isDown(38) and (!touchingGround)) { this.gotoAndStop(3); } if ((_currentframe == 3) and touchingGround) { gotoAndStop (1); } } onClipEvent (keyUp) { gotoAndStop (1); } onClipEvent (enterFrame) { if (this.hitTest(_root.door) and (!doorOpened)) { this._x = this._x - speed; } if ((this.hitTest(_root.door) and Key.isDown(32)) and (_root.keys >= 1)) { _root.door.gotoAndStop(2); doorOpened = true; _root.keys = _root.keys - 1; } if (this.hitTest(_root.wall)) { this._x = this._x - speed; } if (this.hitTest(_root.key)) { _root.keys = _root.keys + 1; unloadMovie (_root.key); } if (_root.keys < 0) { _root.keys = 0; } }Instance of Symbol 316 MovieClip "hp" in Frame 200onClipEvent (load) { var health = 100; } onClipEvent (enterFrame) { _width = health; if (_root.health <= 0) { _root.gotoAndStop("lose"); } updateAfterEvent(); }Instance of Symbol 320 MovieClip in Frame 200onClipEvent (enterFrame) { if (this.hitTest(_root.hero)) { _root.score++; this.unloadMovie(); } }Instance of Symbol 269 MovieClip "enemy" in Frame 200onClipEvent (load) { var egrav = 0; var scale = this._xscale; } onClipEvent (enterFrame) { var distance = 150; var tx = this._x; var ty = this._y; var sx = _root.hero._x; var sy = _root.hero._y; if (Math.sqrt(((sx - tx) * (sx - tx)) + ((sy - ty) * (sy - ty))) < distance) { if (tx < sx) { this.gotoAndStop(3); this._xscale = scale; } if (tx > sx) { this.gotoAndStop(3); this._xscale = -scale; } } if (Math.sqrt(((sx - tx) * (sx - tx)) + ((sy - ty) * (sy - ty))) > distance) { _root.enemy.gotoAndStop(1); } if ((_currentframe == 3) and this.hitTest(_root.hero)) { _root.hp.health--; } if (_root.ground.hitTest(_x, _y, true)) { egrav = 0; } else { egrav++; _y = (_y + egrav); } }Frame 210stop(); score = 0; keys = 0;Instance of Symbol 83 MovieClip "hero" in Frame 210onClipEvent (load) { var speed = 0; var walk = 3; var run = 6; var grav = 0; var falling = 0; var jumped = false; var jumpHeight = 15; var touchingGround = false; var scale = _xscale; var doorOpened = false; var attacked = false; } onClipEvent (enterFrame) { if (!touchingGround) { grav++; this._y = this._y + grav; } else { grav = 0; } if (_root.ground.hitTest(_x, _y, true)) { touchingGround = true; } else { touchingGround = false; } if (!attacked) { if (Key.isDown(37)) { _x = (_x - speed); this.gotoAndStop(2); _xscale = (-scale); } if (Key.isDown(39)) { _x = (_x + speed); this.gotoAndStop(2); _xscale = scale; } if (Key.isDown(16)) { speed = run; } else { speed = walk; } } } onClipEvent (enterFrame) { if (!attacked) { if (jumped) { falling = falling + 0.5; _y = (_y + falling); if (touchingGround) { jumped = false; } } else if (Key.isDown(38)) { jumped = true; falling = -jumpHeight; this.gotoAndStop(3); } } if (Key.isDown(38) and Key.isDown(37)) { this.gotoAndStop(3); } if (Key.isDown(38) and Key.isDown(39)) { this.gotoAndStop(3); } if ((!Key.isDown(38)) and (!touchingGround)) { this.gotoAndStop(3); } else if (Key.isDown(38) and (!touchingGround)) { this.gotoAndStop(3); } if ((_currentframe == 3) and touchingGround) { gotoAndStop (1); } } onClipEvent (keyUp) { if (!attacked) { gotoAndStop (1); } } onClipEvent (enterFrame) { if (this.hitTest(_root.door) and (!doorOpened)) { this._x = this._x - speed; } if ((this.hitTest(_root.door) and Key.isDown(32)) and (_root.keys >= 1)) { _root.door.gotoAndStop(2); doorOpened = true; _root.keys = _root.keys - 1; } if (this.hitTest(_root.wall)) { this._x = this._x - speed; } if (this.hitTest(_root.key)) { _root.keys = _root.keys + 1; unloadMovie (_root.key); } if (_root.keys < 0) { _root.keys = 0; } } onClipEvent (enterFrame) { if (Key.isDown(65)) { attacked = true; this.gotoAndStop(4); if (this.hitTest(_root.enemy)) { _root.enemy.unloadMovie(); } } }Instance of Symbol 316 MovieClip "hp" in Frame 210onClipEvent (load) { var health = 100; } onClipEvent (enterFrame) { _width = health; if (_root.health <= 0) { _root.gotoAndStop("lose"); } updateAfterEvent(); }Instance of Symbol 320 MovieClip in Frame 210onClipEvent (enterFrame) { if (this.hitTest(_root.hero)) { _root.score++; this.unloadMovie(); } }Instance of Symbol 269 MovieClip "enemy" in Frame 210onClipEvent (load) { var egrav = 0; var scale = this._xscale; } onClipEvent (enterFrame) { var distance = 150; var tx = this._x; var ty = this._y; var sx = _root.hero._x; var sy = _root.hero._y; if (Math.sqrt(((sx - tx) * (sx - tx)) + ((sy - ty) * (sy - ty))) < distance) { if (tx < sx) { this.gotoAndStop(3); this._xscale = scale; } if (tx > sx) { this.gotoAndStop(3); this._xscale = -scale; } } if (Math.sqrt(((sx - tx) * (sx - tx)) + ((sy - ty) * (sy - ty))) > distance) { _root.enemy.gotoAndStop(1); } if ((_currentframe == 3) and this.hitTest(_root.hero)) { _root.hp.health--; } if (_root.ground.hitTest(_x, _y, true)) { egrav = 0; } else { egrav++; _y = (_y + egrav); } }Frame 221stop();Symbol 21 MovieClip Frame 40stop();Symbol 35 Buttonon (press) { tellTarget (_root) { nextFrame(); }; }Symbol 36 Buttonon (press) { gotoAndStop ("end"); _root.play(); }Instance of Symbol 11 MovieClip in Symbol 37 MovieClip Frame 1onClipEvent (load) { _root.stop(); PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100); if (PercentLoaded != 100) { _parent.gotoAndStop(PercentLoaded); } else { _parent.gotoAndStop("lastframe"); } } onClipEvent (enterFrame) { PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100); if (PercentLoaded != 100) { _parent.gotoAndStop(PercentLoaded); } else { _parent.gotoAndPlay("loaded"); } }Symbol 37 MovieClip Frame 101play();Symbol 37 MovieClip Frame 165stop();Symbol 43 Buttonon (release) { NewgroundsAPI.loadNewgrounds(); }Symbol 49 Buttonon (release) { NewgroundsAPI.loadNewgrounds(); }Symbol 51 MovieClip Frame 1function startAd(ngad_url) { trace("opening " + ngad_url); System.security.allowDomain("70.87.128.99"); System.security.allowInsecureDomain("70.87.128.99"); System.security.allowDomain("ads.shizmoo.com"); System.security.allowInsecureDomain("ads.shizmoo.com"); System.security.allowDomain("www.cpmstar.com"); System.security.allowInsecureDomain("www.cpmstar.com"); System.security.allowDomain("server.cpmstar.com"); System.security.allowInsecureDomain("server.cpmstar.com"); var ngads_redirect = new XML(); ngads_redirect.ignoreWhite = true; ngads_redirect.onLoad = function (success) { trace("[NEWGROUNDS FLASH ADS] :: You may get a 'Security Sandbox Violation' ... this is normal, do not freak out!"); if (success) { ng_ad.loadMovie(ngads_redirect.toString(), "GET"); } }; ngads_redirect.load(ngad_url); } if (NewgroundsAPI.getAdURL()) { startAd(NewgroundsAPI.getAdURL()); } NewgroundsAPI.onAdsApproved = function (ad_url) { startAd(ad_url); }; stop();Symbol 422 MovieClip [__Packages.NewgroundsAPI] Frame 0class NewgroundsAPI { static var tracker_id, host, version, debug, error_format, header_format, normal_format, link_format; function NewgroundsAPI () { } static function connectMovie(id) { if (!id) { SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)"); } else if (!tracker_id) { SendMessage("Connecting to API gateway..."); tracker_id = id; host = _url.split("/")[2].toLowerCase(); if (host.length < 1) { host = "localhost"; } var _local2 = new Object(); SendEvent(MOVIE_VIEWS); } } static function setMovieVersion(movie_version) { if (!movie_version) { SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)"); } else { version = movie_version; } } static function debugMode() { debug = true; } static function addCustomEvent(stat_id, stat_name) { if (!stat_id) { SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)"); } else if (!stat_name) { SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)"); } else { custom_events[stat_name] = CUSTOM_STATS + stat_id; SendMessage("Created custom event: " + stat_name); } } static function addCustomLink(stat_id, stat_name) { if (!stat_id) { SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)"); } else if (!stat_name) { SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)"); } else { custom_links[stat_name] = CUSTOM_STATS + stat_id; SendMessage((("Created custom link " + stat_id) + ": ") + stat_name); } } static function loadMySite() { SendLink(AUTHOR_SITE); } static function loadNewgrounds(special) { if (special) { var _local1 = {page:special}; } SendLink(NEWGROUNDS, _local1); } static function logCustomEvent(event_name) { if (!event_name) { SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)"); } else if (!custom_events[event_name]) { SendError("Attempted to log undefined custom event: " + event_name); } else { SendEvent(custom_events[event_name]); } } static function loadCustomLink(link_name) { if (!link_name) { SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)"); } else if (!custom_links[link_name]) { SendError("Attempted to open undefined custom link: " + link_name); } else { SendLink(custom_links[link_name]); } } static function getAdURL() { return(movie_options.ad_url); } static function getMovieURL() { if (movie_options.movie_url) { return(movie_options.movie_url); } return("Newgrounds.com"); } static function getNewVersionURL() { return((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + NEW_VERSION); } static function SendEvent(id) { SendStat(id, false); } static function SendLink(id, extra) { SendStat(id, true, extra); } static function ReadGatewayData(params) { for (var _local2 in params) { params[_local2] = unescape(params[_local2]); movie_options[_local2] = params[_local2]; } if (params.settings_loaded) { SendMessage("You have successfully connected to the Newgrounds API gateway!"); SendMessage(("Movie Identified as '" + movie_options.movie_name) + "'"); if (movie_options.message) { SendMessage(movie_options.message); } if (movie_options.ad_url) { SendMessage("Your movie has been approved to run Flash Ads"); onAdsApproved(movie_options.ad_url); } if (movie_options.movie_version and (movie_options.movie_version.toString() != version.toString())) { SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!"); onNewVersionAvailable(movie_options.movie_version, getMovieURL(), getNewVersionURL()); } if (movie_options.deny_host) { SendMessage("You have blocked 'localHost' in your API settings."); SendMessage("If you wish to test your movie you will need to remove this block."); onDenyHost(host, getMovieURL(), getNewVersionURL()); } if (movie_options.request_portal_url == 1) { var _local4 = (((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url); var _local3 = new XML(); _local3.ignoreWhite = true; _local3.load(_local4); } } else if (!movie_options.settings_loaded) { SendError("Could not establish connection to the API gateway."); } } static function SendStat(stat_id, open_in_browser, extra) { if (!tracker_id) { SendError("API calls cannot be made without a valid movie id."); SendError("Did you remember to add the \"NewgroundsAPI.connectMovie()\" code?"); } else { var _local7 = (((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id; for (var _local9 in extra) { _local7 = _local7 + ((("&" + escape(_local9)) + "=") + escape(extra[_local9])); } trace(_local7); if (debug) { _local7 = _local7 + "&debug=1"; } if (open_in_browser) { getURL (_local7, "_blank"); } else { var _local10 = new XML(); _local10.ignoreWhite = true; _local10.onLoad = function (success) { var _local6 = new Object(); var _local3 = 0; while (_local3 < this.firstChild.childNodes.length) { var _local4 = this.firstChild.childNodes[_local3]; var _local5 = _local4.nodeName; var _local2 = _local4.attributes.value; if (_local2 == Number(_local2)) { _local2 = Number(_local2); } _local6[_local5] = _local2; _local3++; } NewgroundsAPI.ReadGatewayData(_local6); }; _local10.load(_local7); } } } static function SendError(msg) { trace("[NEWGROUNDS API ERROR] :: " + msg); } static function SendMessage(msg) { trace("[NEWGROUNDS API] :: " + msg); } static function InitTextFormats() { if (!error_format) { error_format = new TextFormat(); error_format.font = "Arial Black"; error_format.size = 48; error_format.color = 16711680 /* 0xFF0000 */; } if (!header_format) { header_format = new TextFormat(); header_format.font = "Arial Black"; header_format.size = 24; header_format.color = 16777215 /* 0xFFFFFF */; } if (!normal_format) { normal_format = new TextFormat(); normal_format.font = "Arial"; normal_format.bold = true; normal_format.size = 12; normal_format.color = 16777215 /* 0xFFFFFF */; } if (!link_format) { link_format = new TextFormat(); link_format.color = 16776960 /* 0xFFFF00 */; link_format.underline = true; } } static function onNewVersionAvailable(version, movie_url, redirect_url) { InitTextFormats(); var _local2 = new Object(); _local2.x = Stage.width / 2; _local2.y = Stage.height / 2; _root.createEmptyMovieClip("NGAPI_new_version_overlay", _root.getNextHighestDepth()); _root.NGAPI_new_version_overlay.lineStyle(1, 0, 100); _root.NGAPI_new_version_overlay.beginFill(0, 70); _root.NGAPI_new_version_overlay.moveTo(-10, -10); _root.NGAPI_new_version_overlay.lineTo(-10, 1000); _root.NGAPI_new_version_overlay.lineTo(1000, 1000); _root.NGAPI_new_version_overlay.lineTo(1000, -10); _root.NGAPI_new_version_overlay.lineTo(-10, -10); _root.NGAPI_new_version_overlay.endFill(); _root.NGAPI_new_version_overlay.lineStyle(10, 0, 100); _root.NGAPI_new_version_overlay.beginFill(51); _root.NGAPI_new_version_overlay.moveTo(_local2.x - 240, _local2.y - 120); _root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120); _root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80); _root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80); _root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y - 120); _root.NGAPI_new_version_overlay.endFill(); _root.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000); _root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100); _root.NGAPI_new_version_overlay.exit.beginFill(0, 50); _root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 210, _local2.y - 110); _root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110); _root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90); _root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90); _root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110); _root.NGAPI_new_version_overlay.exit.endFill(); _root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106); _root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94); _root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106); _root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.y - 94); _root.NGAPI_new_version_overlay.exit.onMouseUp = function () { if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) { _root.NGAPI_new_version_overlay.removeMovieClip(); } }; var _local3 = (("Version " + version) + " is now available at:") + newline; var _local5 = _local3.length; _local3 = _local3 + movie_url; var _local4 = _local3.length; _root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000); _root.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80); _root.NGAPI_new_version_overlay.newversion.text = "New Version Available!"; _root.NGAPI_new_version_overlay.newversion.setTextFormat(header_format); _root.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40); _root.NGAPI_new_version_overlay.message.text = _local3; _root.NGAPI_new_version_overlay.message.multiline = true; _root.NGAPI_new_version_overlay.message.wordWrap = true; _root.NGAPI_new_version_overlay.message.html = true; _root.NGAPI_new_version_overlay.message.setTextFormat(normal_format); link_format.url = redirect_url; _root.NGAPI_new_version_overlay.message.setTextFormat(_local5, _local4, link_format); } static function onDenyHost(hostname, movie_url, redirect_url) { InitTextFormats(); _root.createEmptyMovieClip("NGAPI_deny_host_overlay", _root.getNextHighestDepth()); _root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100); _root.NGAPI_deny_host_overlay.beginFill(6684672); _root.NGAPI_deny_host_overlay.moveTo(0, 0); _root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0); _root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height); _root.NGAPI_deny_host_overlay.lineTo(0, Stage.height); _root.NGAPI_deny_host_overlay.lineTo(0, 0); _root.NGAPI_deny_host_overlay.endFill(); var _local2 = ("This movie has not been approved for use on " + hostname) + "."; _local2 = _local2 + "\r\rFor an aproved copy, please visit:\r"; var _local4 = _local2.length; _local2 = _local2 + movie_url; var _local3 = _local2.length; _root.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height); _root.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200); _root.NGAPI_deny_host_overlay.error.text = "ERROR!"; _root.NGAPI_deny_host_overlay.error.setTextFormat(error_format); _root.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200); _root.NGAPI_deny_host_overlay.message.text = _local2; _root.NGAPI_deny_host_overlay.message.multiline = true; _root.NGAPI_deny_host_overlay.message.wordWrap = true; _root.NGAPI_deny_host_overlay.message.html = true; _root.NGAPI_deny_host_overlay.message.setTextFormat(normal_format); link_format.url = redirect_url; _root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format); } static function isInstalled() { return(true); } static function onAdsApproved(ad_url) { } static var movie_options = new Object(); static var custom_events = new Object(); static var custom_links = new Object(); static var MOVIE_VIEWS = 1; static var AUTHOR_SITE = 2; static var NEWGROUNDS = 3; static var NEW_VERSION = 4; static var CUSTOM_STATS = 50; static var GATEWAY_URL = "http://www.ngads.com/gateway.php"; }Symbol 59 Buttonon (press) { nextFrame(); }Symbol 60 Buttonon (press) { prevFrame(); }Symbol 82 MovieClip Frame 17_root.hero.attacked = false; _root.hero.gotoAndStop(1);Symbol 83 MovieClip Frame 1stop();Symbol 209 MovieClip Frame 1stop();Symbol 269 MovieClip Frame 1stop();Symbol 421 Buttonon (press) { _root.gotoAndPlay(2); }
Library Items
Symbol 1 Sound [bgm] | ||
Symbol 2 Graphic | Used by:3 | |
Symbol 3 MovieClip | Uses:2 | Used by:Timeline |
Symbol 4 Graphic | Used by:54 Timeline | |
Symbol 5 Graphic | Used by:7 | |
Symbol 6 Graphic | Used by:7 | |
Symbol 7 MovieClip | Uses:5 6 | Used by:37 |
Symbol 8 Graphic | Used by:37 | |
Symbol 9 Graphic | Used by:37 | |
Symbol 10 Graphic | Used by:37 | |
Symbol 11 MovieClip | Used by:37 | |
Symbol 12 Graphic | Used by:37 | |
Symbol 13 Graphic | Used by:21 | |
Symbol 14 Graphic | Used by:21 | |
Symbol 15 Graphic | Used by:21 | |
Symbol 16 Graphic | Used by:21 | |
Symbol 17 Graphic | Used by:21 | |
Symbol 18 Graphic | Used by:21 | |
Symbol 19 Graphic | Used by:21 | |
Symbol 20 Graphic | Used by:21 | |
Symbol 21 MovieClip | Uses:13 14 15 16 17 18 19 20 | Used by:37 |
Symbol 22 ShapeTweening | Used by:37 | |
Symbol 23 ShapeTweening | Used by:37 | |
Symbol 24 Graphic | Used by:37 | |
Symbol 25 Graphic | Used by:37 | |
Symbol 26 Graphic | Used by:37 | |
Symbol 27 Graphic | Used by:35 36 | |
Symbol 28 Graphic | Used by:35 36 37 | |
Symbol 29 Graphic | Used by:35 36 | |
Symbol 30 Graphic | Used by:35 36 37 | |
Symbol 31 Graphic | Used by:35 36 37 | |
Symbol 32 Graphic | Used by:34 35 36 | |
Symbol 33 Graphic | Used by:34 | |
Symbol 34 MovieClip | Uses:32 33 | Used by:35 36 37 |
Symbol 35 Button | Uses:27 28 29 30 31 34 32 | Used by:37 |
Symbol 36 Button | Uses:27 28 29 30 31 34 32 | Used by:37 |
Symbol 37 MovieClip | Uses:7 8 9 10 11 12 21 22 23 24 25 26 35 36 31 28 34 30 | Used by:51 |
Symbol 38 Graphic | Used by:51 | |
Symbol 39 Graphic | Used by:43 | |
Symbol 40 Graphic | Used by:43 | |
Symbol 41 Graphic | Used by:43 | |
Symbol 42 Graphic | Used by:43 | |
Symbol 43 Button | Uses:39 40 41 42 | Used by:51 |
Symbol 44 Graphic | Used by:51 | |
Symbol 45 Graphic | Used by:51 | |
Symbol 46 Graphic | Used by:50 87 213 | |
Symbol 47 Graphic | Used by:49 | |
Symbol 48 Graphic | Used by:49 | |
Symbol 49 Button | Uses:47 48 | Used by:50 |
Symbol 50 MovieClip | Uses:46 49 | Used by:51 |
Symbol 51 MovieClip | Uses:37 38 43 44 45 50 | Used by:Timeline |
Symbol 422 MovieClip [__Packages.NewgroundsAPI] | ||
Symbol 52 Graphic | Used by:53 | |
Symbol 53 MovieClip | Uses:52 | Used by:54 Timeline |
Symbol 54 MovieClip | Uses:4 53 | Used by:Timeline |
Symbol 55 Font | Used by:56 57 84 85 86 88 89 90 91 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 206 212 214 215 216 217 218 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 321 322 323 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 387 388 390 391 393 394 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 | |
Symbol 56 EditableText | Uses:55 | Used by:Timeline |
Symbol 57 EditableText | Uses:55 | Used by:Timeline |
Symbol 58 Graphic | Used by:59 60 | |
Symbol 59 Button | Uses:58 | Used by:Timeline |
Symbol 60 Button | Uses:58 | Used by:Timeline |
Symbol 61 Graphic | Used by:64 | |
Symbol 62 Graphic | Used by:64 | |
Symbol 63 Graphic | Used by:64 | |
Symbol 64 MovieClip | Uses:61 62 63 | Used by:83 269 |
Symbol 65 Graphic | Used by:75 | |
Symbol 66 Graphic | Used by:75 | |
Symbol 67 Graphic | Used by:75 | |
Symbol 68 Graphic | Used by:75 | |
Symbol 69 Graphic | Used by:75 | |
Symbol 70 Graphic | Used by:75 | |
Symbol 71 Graphic | Used by:75 | |
Symbol 72 Graphic | Used by:75 | |
Symbol 73 Graphic | Used by:75 | |
Symbol 74 Graphic | Used by:75 | |
Symbol 75 MovieClip | Uses:65 66 67 68 69 70 71 72 73 74 | Used by:76 |
Symbol 76 MovieClip | Uses:75 | Used by:83 269 |
Symbol 77 Graphic | Used by:78 | |
Symbol 78 MovieClip | Uses:77 | Used by:83 |
Symbol 79 Graphic | Used by:82 268 | |
Symbol 80 Graphic | Used by:82 | |
Symbol 81 Graphic | Used by:82 | |
Symbol 82 MovieClip | Uses:79 80 81 | Used by:83 |
Symbol 83 MovieClip | Uses:64 76 78 82 | Used by:Timeline |
Symbol 84 EditableText | Uses:55 | Used by:Timeline |
Symbol 85 EditableText | Uses:55 | Used by:Timeline |
Symbol 86 EditableText | Uses:55 | Used by:Timeline |
Symbol 87 MovieClip | Uses:46 | Used by:Timeline |
Symbol 88 EditableText | Uses:55 | Used by:Timeline |
Symbol 89 EditableText | Uses:55 | Used by:Timeline |
Symbol 90 EditableText | Uses:55 | Used by:Timeline |
Symbol 91 EditableText | Uses:55 | Used by:Timeline |
Symbol 92 Bitmap | Used by:93 | |
Symbol 93 Graphic | Uses:92 | Used by:Timeline |
Symbol 94 EditableText | Uses:55 | Used by:Timeline |
Symbol 95 EditableText | Uses:55 | Used by:Timeline |
Symbol 96 EditableText | Uses:55 | Used by:Timeline |
Symbol 97 EditableText | Uses:55 | Used by:Timeline |
Symbol 98 EditableText | Uses:55 | Used by:Timeline |
Symbol 99 EditableText | Uses:55 | Used by:Timeline |
Symbol 100 EditableText | Uses:55 | Used by:Timeline |
Symbol 101 EditableText | Uses:55 | Used by:Timeline |
Symbol 102 EditableText | Uses:55 | Used by:Timeline |
Symbol 103 EditableText | Uses:55 | Used by:Timeline |
Symbol 104 EditableText | Uses:55 | Used by:Timeline |
Symbol 105 EditableText | Uses:55 | Used by:Timeline |
Symbol 106 EditableText | Uses:55 | Used by:Timeline |
Symbol 107 EditableText | Uses:55 | Used by:Timeline |
Symbol 108 EditableText | Uses:55 | Used by:Timeline |
Symbol 109 EditableText | Uses:55 | Used by:Timeline |
Symbol 110 EditableText | Uses:55 | Used by:Timeline |
Symbol 111 EditableText | Uses:55 | Used by:Timeline |
Symbol 112 EditableText | Uses:55 | Used by:Timeline |
Symbol 113 EditableText | Uses:55 | Used by:Timeline |
Symbol 114 EditableText | Uses:55 | Used by:Timeline |
Symbol 115 EditableText | Uses:55 | Used by:Timeline |
Symbol 116 EditableText | Uses:55 | Used by:Timeline |
Symbol 117 EditableText | Uses:55 | Used by:Timeline |
Symbol 118 EditableText | Uses:55 | Used by:Timeline |
Symbol 119 EditableText | Uses:55 | Used by:Timeline |
Symbol 120 EditableText | Uses:55 | Used by:Timeline |
Symbol 121 EditableText | Uses:55 | Used by:Timeline |
Symbol 122 EditableText | Uses:55 | Used by:Timeline |
Symbol 123 EditableText | Uses:55 | Used by:Timeline |
Symbol 124 EditableText | Uses:55 | Used by:Timeline |
Symbol 125 EditableText | Uses:55 | Used by:Timeline |
Symbol 126 EditableText | Uses:55 | Used by:Timeline |
Symbol 127 EditableText | Uses:55 | Used by:Timeline |
Symbol 128 EditableText | Uses:55 | Used by:Timeline |
Symbol 129 EditableText | Uses:55 | Used by:Timeline |
Symbol 130 EditableText | Uses:55 | Used by:Timeline |
Symbol 131 EditableText | Uses:55 | Used by:Timeline |
Symbol 132 EditableText | Uses:55 | Used by:Timeline |
Symbol 133 EditableText | Uses:55 | Used by:Timeline |
Symbol 134 EditableText | Uses:55 | Used by:Timeline |
Symbol 135 EditableText | Uses:55 | Used by:Timeline |
Symbol 136 EditableText | Uses:55 | Used by:Timeline |
Symbol 137 EditableText | Uses:55 | Used by:Timeline |
Symbol 138 EditableText | Uses:55 | Used by:Timeline |
Symbol 139 EditableText | Uses:55 | Used by:Timeline |
Symbol 140 EditableText | Uses:55 | Used by:Timeline |
Symbol 141 EditableText | Uses:55 | Used by:Timeline |
Symbol 142 EditableText | Uses:55 | Used by:Timeline |
Symbol 143 EditableText | Uses:55 | Used by:Timeline |
Symbol 144 EditableText | Uses:55 | Used by:Timeline |
Symbol 145 EditableText | Uses:55 | Used by:Timeline |
Symbol 146 EditableText | Uses:55 | Used by:Timeline |
Symbol 147 EditableText | Uses:55 | Used by:Timeline |
Symbol 148 EditableText | Uses:55 | Used by:Timeline |
Symbol 149 EditableText | Uses:55 | Used by:Timeline |
Symbol 150 EditableText | Uses:55 | Used by:Timeline |
Symbol 151 EditableText | Uses:55 | Used by:Timeline |
Symbol 152 EditableText | Uses:55 | Used by:Timeline |
Symbol 153 EditableText | Uses:55 | Used by:Timeline |
Symbol 154 EditableText | Uses:55 | Used by:Timeline |
Symbol 155 EditableText | Uses:55 | Used by:Timeline |
Symbol 156 EditableText | Uses:55 | Used by:Timeline |
Symbol 157 EditableText | Uses:55 | Used by:Timeline |
Symbol 158 Text | Uses:55 | Used by:Timeline |
Symbol 159 Text | Uses:55 | Used by:Timeline |
Symbol 160 EditableText | Uses:55 | Used by:Timeline |
Symbol 161 Text | Uses:55 | Used by:Timeline |
Symbol 162 EditableText | Uses:55 | Used by:Timeline |
Symbol 163 Text | Uses:55 | Used by:Timeline |
Symbol 164 EditableText | Uses:55 | Used by:Timeline |
Symbol 165 Text | Uses:55 | Used by:Timeline |
Symbol 166 EditableText | Uses:55 | Used by:Timeline |
Symbol 167 EditableText | Uses:55 | Used by:Timeline |
Symbol 168 EditableText | Uses:55 | Used by:Timeline |
Symbol 169 EditableText | Uses:55 | Used by:Timeline |
Symbol 170 Text | Uses:55 | Used by:Timeline |
Symbol 171 EditableText | Uses:55 | Used by:Timeline |
Symbol 172 Text | Uses:55 | Used by:Timeline |
Symbol 173 Text | Uses:55 | Used by:Timeline |
Symbol 174 EditableText | Uses:55 | Used by:Timeline |
Symbol 175 Text | Uses:55 | Used by:Timeline |
Symbol 176 EditableText | Uses:55 | Used by:Timeline |
Symbol 177 Text | Uses:55 | Used by:Timeline |
Symbol 178 EditableText | Uses:55 | Used by:Timeline |
Symbol 179 Text | Uses:55 | Used by:Timeline |
Symbol 180 EditableText | Uses:55 | Used by:Timeline |
Symbol 181 Text | Uses:55 | Used by:Timeline |
Symbol 182 EditableText | Uses:55 | Used by:Timeline |
Symbol 183 Text | Uses:55 | Used by:Timeline |
Symbol 184 EditableText | Uses:55 | Used by:Timeline |
Symbol 185 EditableText | Uses:55 | Used by:Timeline |
Symbol 186 Text | Uses:55 | Used by:Timeline |
Symbol 187 EditableText | Uses:55 | Used by:Timeline |
Symbol 188 Text | Uses:55 | Used by:Timeline |
Symbol 189 EditableText | Uses:55 | Used by:Timeline |
Symbol 190 EditableText | Uses:55 | Used by:Timeline |
Symbol 191 Text | Uses:55 | Used by:Timeline |
Symbol 192 EditableText | Uses:55 | Used by:Timeline |
Symbol 193 EditableText | Uses:55 | Used by:Timeline |
Symbol 194 Text | Uses:55 | Used by:Timeline |
Symbol 195 Text | Uses:55 | Used by:Timeline |
Symbol 196 EditableText | Uses:55 | Used by:Timeline |
Symbol 197 Text | Uses:55 | Used by:Timeline |
Symbol 198 EditableText | Uses:55 | Used by:Timeline |
Symbol 199 Text | Uses:55 | Used by:Timeline |
Symbol 200 EditableText | Uses:55 | Used by:Timeline |
Symbol 201 Text | Uses:55 | Used by:Timeline |
Symbol 202 EditableText | Uses:55 | Used by:Timeline |
Symbol 203 EditableText | Uses:55 | Used by:Timeline |
Symbol 204 Text | Uses:55 | Used by:Timeline |
Symbol 205 Graphic | Used by:Timeline | |
Symbol 206 EditableText | Uses:55 | Used by:Timeline |
Symbol 207 Graphic | Used by:209 | |
Symbol 208 Graphic | Used by:209 | |
Symbol 209 MovieClip | Uses:207 208 | Used by:Timeline |
Symbol 210 Graphic | Used by:211 | |
Symbol 211 MovieClip | Uses:210 | Used by:Timeline |
Symbol 212 Text | Uses:55 | Used by:Timeline |
Symbol 213 MovieClip | Uses:46 | Used by:Timeline |
Symbol 214 EditableText | Uses:55 | Used by:Timeline |
Symbol 215 EditableText | Uses:55 | Used by:Timeline |
Symbol 216 Text | Uses:55 | Used by:Timeline |
Symbol 217 EditableText | Uses:55 | Used by:Timeline |
Symbol 218 Text | Uses:55 | Used by:Timeline |
Symbol 219 Bitmap | Used by:220 | |
Symbol 220 Graphic | Uses:219 | Used by:Timeline |
Symbol 221 EditableText | Uses:55 | Used by:Timeline |
Symbol 222 Text | Uses:55 | Used by:Timeline |
Symbol 223 EditableText | Uses:55 | Used by:Timeline |
Symbol 224 EditableText | Uses:55 | Used by:Timeline |
Symbol 225 Text | Uses:55 | Used by:Timeline |
Symbol 226 EditableText | Uses:55 | Used by:Timeline |
Symbol 227 EditableText | Uses:55 | Used by:Timeline |
Symbol 228 Text | Uses:55 | Used by:Timeline |
Symbol 229 EditableText | Uses:55 | Used by:Timeline |
Symbol 230 EditableText | Uses:55 | Used by:Timeline |
Symbol 231 Text | Uses:55 | Used by:Timeline |
Symbol 232 Text | Uses:55 | Used by:Timeline |
Symbol 233 EditableText | Uses:55 | Used by:Timeline |
Symbol 234 Text | Uses:55 | Used by:Timeline |
Symbol 235 EditableText | Uses:55 | Used by:Timeline |
Symbol 236 EditableText | Uses:55 | Used by:Timeline |
Symbol 237 Text | Uses:55 | Used by:Timeline |
Symbol 238 EditableText | Uses:55 | Used by:Timeline |
Symbol 239 Text | Uses:55 | Used by:Timeline |
Symbol 240 EditableText | Uses:55 | Used by:Timeline |
Symbol 241 Text | Uses:55 | Used by:Timeline |
Symbol 242 EditableText | Uses:55 | Used by:Timeline |
Symbol 243 EditableText | Uses:55 | Used by:Timeline |
Symbol 244 Text | Uses:55 | Used by:Timeline |
Symbol 245 EditableText | Uses:55 | Used by:Timeline |
Symbol 246 Text | Uses:55 | Used by:Timeline |
Symbol 247 EditableText | Uses:55 | Used by:Timeline |
Symbol 248 Text | Uses:55 | Used by:Timeline |
Symbol 249 EditableText | Uses:55 | Used by:Timeline |
Symbol 250 EditableText | Uses:55 | Used by:Timeline |
Symbol 251 Text | Uses:55 | Used by:Timeline |
Symbol 252 EditableText | Uses:55 | Used by:Timeline |
Symbol 253 Text | Uses:55 | Used by:Timeline |
Symbol 254 EditableText | Uses:55 | Used by:Timeline |
Symbol 255 EditableText | Uses:55 | Used by:Timeline |
Symbol 256 Text | Uses:55 | Used by:Timeline |
Symbol 257 EditableText | Uses:55 | Used by:Timeline |
Symbol 258 Text | Uses:55 | Used by:Timeline |
Symbol 259 EditableText | Uses:55 | Used by:Timeline |
Symbol 260 EditableText | Uses:55 | Used by:Timeline |
Symbol 261 Text | Uses:55 | Used by:Timeline |
Symbol 262 EditableText | Uses:55 | Used by:Timeline |
Symbol 263 Text | Uses:55 | Used by:Timeline |
Symbol 264 EditableText | Uses:55 | Used by:Timeline |
Symbol 265 Text | Uses:55 | Used by:Timeline |
Symbol 266 EditableText | Uses:55 | Used by:Timeline |
Symbol 267 Graphic | Used by:268 | |
Symbol 268 MovieClip | Uses:79 267 | Used by:269 |
Symbol 269 MovieClip | Uses:64 76 268 | Used by:Timeline |
Symbol 270 EditableText | Uses:55 | Used by:Timeline |
Symbol 271 Text | Uses:55 | Used by:Timeline |
Symbol 272 EditableText | Uses:55 | Used by:Timeline |
Symbol 273 Text | Uses:55 | Used by:Timeline |
Symbol 274 EditableText | Uses:55 | Used by:Timeline |
Symbol 275 EditableText | Uses:55 | Used by:Timeline |
Symbol 276 Text | Uses:55 | Used by:Timeline |
Symbol 277 EditableText | Uses:55 | Used by:Timeline |
Symbol 278 Text | Uses:55 | Used by:Timeline |
Symbol 279 EditableText | Uses:55 | Used by:Timeline |
Symbol 280 EditableText | Uses:55 | Used by:Timeline |
Symbol 281 Text | Uses:55 | Used by:Timeline |
Symbol 282 EditableText | Uses:55 | Used by:Timeline |
Symbol 283 EditableText | Uses:55 | Used by:Timeline |
Symbol 284 Text | Uses:55 | Used by:Timeline |
Symbol 285 EditableText | Uses:55 | Used by:Timeline |
Symbol 286 Text | Uses:55 | Used by:Timeline |
Symbol 287 EditableText | Uses:55 | Used by:Timeline |
Symbol 288 EditableText | Uses:55 | Used by:Timeline |
Symbol 289 Text | Uses:55 | Used by:Timeline |
Symbol 290 EditableText | Uses:55 | Used by:Timeline |
Symbol 291 Text | Uses:55 | Used by:Timeline |
Symbol 292 EditableText | Uses:55 | Used by:Timeline |
Symbol 293 EditableText | Uses:55 | Used by:Timeline |
Symbol 294 Text | Uses:55 | Used by:Timeline |
Symbol 295 EditableText | Uses:55 | Used by:Timeline |
Symbol 296 Text | Uses:55 | Used by:Timeline |
Symbol 297 EditableText | Uses:55 | Used by:Timeline |
Symbol 298 EditableText | Uses:55 | Used by:Timeline |
Symbol 299 Text | Uses:55 | Used by:Timeline |
Symbol 300 EditableText | Uses:55 | Used by:Timeline |
Symbol 301 Text | Uses:55 | Used by:Timeline |
Symbol 302 EditableText | Uses:55 | Used by:Timeline |
Symbol 303 EditableText | Uses:55 | Used by:Timeline |
Symbol 304 Text | Uses:55 | Used by:Timeline |
Symbol 305 EditableText | Uses:55 | Used by:Timeline |
Symbol 306 Text | Uses:55 | Used by:Timeline |
Symbol 307 EditableText | Uses:55 | Used by:Timeline |
Symbol 308 EditableText | Uses:55 | Used by:Timeline |
Symbol 309 Text | Uses:55 | Used by:Timeline |
Symbol 310 EditableText | Uses:55 | Used by:Timeline |
Symbol 311 Text | Uses:55 | Used by:Timeline |
Symbol 312 EditableText | Uses:55 | Used by:Timeline |
Symbol 313 Text | Uses:55 | Used by:Timeline |
Symbol 314 EditableText | Uses:55 | Used by:Timeline |
Symbol 315 Graphic | Used by:316 | |
Symbol 316 MovieClip | Uses:315 | Used by:Timeline |
Symbol 317 Graphic | Used by:318 | |
Symbol 318 MovieClip | Uses:317 | Used by:Timeline |
Symbol 319 Graphic | Used by:320 | |
Symbol 320 MovieClip | Uses:319 | Used by:Timeline |
Symbol 321 EditableText | Uses:55 | Used by:Timeline |
Symbol 322 EditableText | Uses:55 | Used by:Timeline |
Symbol 323 Text | Uses:55 | Used by:Timeline |
Symbol 324 Bitmap | Used by:326 | |
Symbol 325 Bitmap | Used by:326 | |
Symbol 326 Graphic | Uses:324 325 | Used by:Timeline |
Symbol 327 EditableText | Uses:55 | Used by:Timeline |
Symbol 328 Text | Uses:55 | Used by:Timeline |
Symbol 329 EditableText | Uses:55 | Used by:Timeline |
Symbol 330 Text | Uses:55 | Used by:Timeline |
Symbol 331 EditableText | Uses:55 | Used by:Timeline |
Symbol 332 Text | Uses:55 | Used by:Timeline |
Symbol 333 EditableText | Uses:55 | Used by:Timeline |
Symbol 334 EditableText | Uses:55 | Used by:Timeline |
Symbol 335 Text | Uses:55 | Used by:Timeline |
Symbol 336 Text | Uses:55 | Used by:Timeline |
Symbol 337 EditableText | Uses:55 | Used by:Timeline |
Symbol 338 Text | Uses:55 | Used by:Timeline |
Symbol 339 EditableText | Uses:55 | Used by:Timeline |
Symbol 340 EditableText | Uses:55 | Used by:Timeline |
Symbol 341 Text | Uses:55 | Used by:Timeline |
Symbol 342 Text | Uses:55 | Used by:Timeline |
Symbol 343 EditableText | Uses:55 | Used by:Timeline |
Symbol 344 Text | Uses:55 | Used by:Timeline |
Symbol 345 EditableText | Uses:55 | Used by:Timeline |
Symbol 346 EditableText | Uses:55 | Used by:Timeline |
Symbol 347 Text | Uses:55 | Used by:Timeline |
Symbol 348 EditableText | Uses:55 | Used by:Timeline |
Symbol 349 Text | Uses:55 | Used by:Timeline |
Symbol 350 Graphic | Used by:Timeline | |
Symbol 351 EditableText | Uses:55 | Used by:Timeline |
Symbol 352 Text | Uses:55 | Used by:Timeline |
Symbol 353 EditableText | Uses:55 | Used by:Timeline |
Symbol 354 EditableText | Uses:55 | Used by:Timeline |
Symbol 355 Text | Uses:55 | Used by:Timeline |
Symbol 356 EditableText | Uses:55 | Used by:Timeline |
Symbol 357 Text | Uses:55 | Used by:Timeline |
Symbol 358 EditableText | Uses:55 | Used by:Timeline |
Symbol 359 EditableText | Uses:55 | Used by:Timeline |
Symbol 360 Text | Uses:55 | Used by:Timeline |
Symbol 361 EditableText | Uses:55 | Used by:Timeline |
Symbol 362 Text | Uses:55 | Used by:Timeline |
Symbol 363 EditableText | Uses:55 | Used by:Timeline |
Symbol 364 Text | Uses:55 | Used by:Timeline |
Symbol 365 EditableText | Uses:55 | Used by:Timeline |
Symbol 366 Text | Uses:55 | Used by:Timeline |
Symbol 367 EditableText | Uses:55 | Used by:Timeline |
Symbol 368 Text | Uses:55 | Used by:Timeline |
Symbol 369 EditableText | Uses:55 | Used by:Timeline |
Symbol 370 EditableText | Uses:55 | Used by:Timeline |
Symbol 371 Text | Uses:55 | Used by:Timeline |
Symbol 372 EditableText | Uses:55 | Used by:Timeline |
Symbol 373 EditableText | Uses:55 | Used by:Timeline |
Symbol 374 Text | Uses:55 | Used by:Timeline |
Symbol 375 EditableText | Uses:55 | Used by:Timeline |
Symbol 376 Text | Uses:55 | Used by:Timeline |
Symbol 377 EditableText | Uses:55 | Used by:Timeline |
Symbol 378 Text | Uses:55 | Used by:Timeline |
Symbol 379 EditableText | Uses:55 | Used by:Timeline |
Symbol 380 Text | Uses:55 | Used by:Timeline |
Symbol 381 EditableText | Uses:55 | Used by:Timeline |
Symbol 382 Text | Uses:55 | Used by:Timeline |
Symbol 383 EditableText | Uses:55 | Used by:Timeline |
Symbol 384 Text | Uses:55 | Used by:Timeline |
Symbol 385 Font | Used by:386 389 392 395 | |
Symbol 386 Text | Uses:385 | Used by:Timeline |
Symbol 387 EditableText | Uses:55 | Used by:Timeline |
Symbol 388 EditableText | Uses:55 | Used by:Timeline |
Symbol 389 Text | Uses:385 | Used by:Timeline |
Symbol 390 EditableText | Uses:55 | Used by:Timeline |
Symbol 391 EditableText | Uses:55 | Used by:Timeline |
Symbol 392 Text | Uses:385 | Used by:Timeline |
Symbol 393 EditableText | Uses:55 | Used by:Timeline |
Symbol 394 EditableText | Uses:55 | Used by:Timeline |
Symbol 395 Text | Uses:385 | Used by:Timeline |
Symbol 396 EditableText | Uses:55 | Used by:Timeline |
Symbol 397 EditableText | Uses:55 | Used by:Timeline |
Symbol 398 Text | Uses:55 | Used by:Timeline |
Symbol 399 EditableText | Uses:55 | Used by:Timeline |
Symbol 400 Text | Uses:55 | Used by:Timeline |
Symbol 401 EditableText | Uses:55 | Used by:Timeline |
Symbol 402 EditableText | Uses:55 | Used by:Timeline |
Symbol 403 EditableText | Uses:55 | Used by:Timeline |
Symbol 404 EditableText | Uses:55 | Used by:Timeline |
Symbol 405 Text | Uses:55 | Used by:Timeline |
Symbol 406 EditableText | Uses:55 | Used by:Timeline |
Symbol 407 Text | Uses:55 | Used by:Timeline |
Symbol 408 EditableText | Uses:55 | Used by:Timeline |
Symbol 409 Text | Uses:55 | Used by:Timeline |
Symbol 410 EditableText | Uses:55 | Used by:Timeline |
Symbol 411 Text | Uses:55 | Used by:Timeline |
Symbol 412 EditableText | Uses:55 | Used by:Timeline |
Symbol 413 Text | Uses:55 | Used by:Timeline |
Symbol 414 Text | Uses:55 | Used by:Timeline |
Symbol 415 EditableText | Uses:55 | Used by:Timeline |
Symbol 416 Text | Uses:55 | Used by:Timeline |
Symbol 417 EditableText | Uses:55 | Used by:Timeline |
Symbol 418 Text | Uses:55 | Used by:Timeline |
Symbol 419 Text | Uses:55 | Used by:Timeline |
Symbol 420 Text | Uses:55 | Used by:421 |
Symbol 421 Button | Uses:420 | Used by:Timeline |
Instance Names
"start_mc" | Frame 62 | Symbol 53 MovieClip |
"ground" | Frame 122 | Symbol 87 MovieClip |
"ground" | Frame 163 | Symbol 87 MovieClip |
"door" | Frame 163 | Symbol 209 MovieClip |
"key" | Frame 163 | Symbol 211 MovieClip |
"wall" | Frame 163 | Symbol 213 MovieClip |
"ground" | Frame 182 | Symbol 87 MovieClip |
"door" | Frame 182 | Symbol 209 MovieClip |
"key" | Frame 182 | Symbol 211 MovieClip |
"hero" | Frame 182 | Symbol 83 MovieClip |
"wall" | Frame 182 | Symbol 213 MovieClip |
"enemy" | Frame 182 | Symbol 269 MovieClip |
"ground" | Frame 200 | Symbol 87 MovieClip |
"door" | Frame 200 | Symbol 209 MovieClip |
"key" | Frame 200 | Symbol 211 MovieClip |
"hero" | Frame 200 | Symbol 83 MovieClip |
"wall" | Frame 200 | Symbol 213 MovieClip |
"hp" | Frame 200 | Symbol 316 MovieClip |
"enemy" | Frame 200 | Symbol 269 MovieClip |
"ground" | Frame 210 | Symbol 87 MovieClip |
"door" | Frame 210 | Symbol 209 MovieClip |
"key" | Frame 210 | Symbol 211 MovieClip |
"hero" | Frame 210 | Symbol 83 MovieClip |
"wall" | Frame 210 | Symbol 213 MovieClip |
"hp" | Frame 210 | Symbol 316 MovieClip |
"enemy" | Frame 210 | Symbol 269 MovieClip |
"ng_ad" | Symbol 51 MovieClip Frame 1 | Symbol 50 MovieClip |
"begin_btn" | Symbol 54 MovieClip Frame 1 | Symbol 53 MovieClip |
"run" | Symbol 83 MovieClip Frame 2 | Symbol 76 MovieClip |
"hit" | Symbol 269 MovieClip Frame 3 | Symbol 268 MovieClip |
Special Tags
FileAttributes (69) | Timeline Frame 1 | Access local files only, Metadata not present, AS1/AS2. |
ExportAssets (56) | Timeline Frame 1 | Symbol 1 as "bgm" |
ExportAssets (56) | Timeline Frame 1 | Symbol 422 as "__Packages.NewgroundsAPI" |
Labels
"loading" | Symbol 37 MovieClip Frame 1 |
"loaded" | Symbol 37 MovieClip Frame 101 |
"lastframe" | Symbol 37 MovieClip Frame 165 |
"end" | Symbol 37 MovieClip Frame 166 |
"run" | Symbol 269 MovieClip Frame 2 |
Dynamic Text Variables
keys | Symbol 214 EditableText | "" |
keys | Symbol 266 EditableText | "" |
keys | Symbol 314 EditableText | "" |
score | Symbol 321 EditableText | "" |
keys | Symbol 353 EditableText | "" |
score | Symbol 354 EditableText | "" |
|