[Tutorial] How to create a basic maplestory flash game

Talk about flash games that you've played or need help with.
Locked
User avatar
lachie967
Blue ribbon pig
Posts:14
Joined:Sun Apr 26, 2009 9:27 am
Re: [Tutorial] How to create a basic maplestory flash game

Post by lachie967 » Sat May 23, 2009 12:54 pm

what does that mean i have to do though!

User avatar
Montycarlo
Zombie Mushmom
Posts:473
Joined:Sat Jan 10, 2009 12:30 am
Location:Melbourne, Australia.
Contact:

Re: [Tutorial] How to create a basic maplestory flash game

Post by Montycarlo » Sat May 23, 2009 12:55 pm

lachie967 wrote:what does that mean i have to do though!
I did it for you. You had to cut the images from the main Timeline to the inside of the Movie Clip.

User avatar
lachie967
Blue ribbon pig
Posts:14
Joined:Sun Apr 26, 2009 9:27 am

Re: [Tutorial] How to create a basic maplestory flash game

Post by lachie967 » Sat May 23, 2009 1:03 pm

when i try open it it says unexpected file format (F7)
i figured out what you meant! i got it working again (F2) ty

User avatar
lachie967
Blue ribbon pig
Posts:14
Joined:Sun Apr 26, 2009 9:27 am

Re: [Tutorial] How to create a basic maplestory flash game

Post by lachie967 » Sat May 23, 2009 2:03 pm

now im stuck on day 5 step the vcam one i cant download it, can someone tell me whats in it that im meant to add?

User avatar
AutoAsh123
Blue Mushmom
Posts:285
Joined:Sat Jan 10, 2009 2:09 am
Location:New York, Queens
Contact:

Re: [Tutorial] How to create a basic maplestory flash game

Post by AutoAsh123 » Sat May 23, 2009 10:48 pm

i know this is a dumb question but... how do u open Adobe Flash CS4??


Edit: NeverMind i downloaded Adobe Flash PLAYER xDDDDD (F3)

User avatar
lachie967
Blue ribbon pig
Posts:14
Joined:Sun Apr 26, 2009 9:27 am

Re: [Tutorial] How to create a basic maplestory flash game

Post by lachie967 » Sun May 24, 2009 1:25 am

While i was waiting for a helpful response... i found out how to go down!

1. Go to 'Library' scroll to 'Character' and double click it
2. Go to keyframe 3, and press f7 to create a new frame
3. Drag from the library 'Prone_0_40'
4. Line the base of the body on the cross-hairs' 'X axis'
5. Line where the shoes end on the cross-hairs' 'Y axis'

........Diagram........&%%%=()
&=head.......................X
%%%=body
==legs
()=feet
X=cross-hair

6. Save, Click 'scene 1'. You should now be back at your main screen with tiles.
7. Click on the character once and click 'actions'
8: Paste in the following code:

Code: Select all

   if(Key.isDown(Key.DOWN)){
     jumping = true
      gotoAndStop(4);
      }

9. Save, and your done!
NOTE: There is one glitch, if you hold down and left or right, you glide across the floor! (F2)

User avatar
AutoAsh123
Blue Mushmom
Posts:285
Joined:Sat Jan 10, 2009 2:09 am
Location:New York, Queens
Contact:

Re: [Tutorial] How to create a basic maplestory flash game

Post by AutoAsh123 » Sun May 24, 2009 2:03 am

I have a problem now xDDD i cant download Adobe Flash CS4 (eek) Do you guys have any other links??? please tell me if u do i want to make a new flash game for this awesome website ^_^ (exellent)

--

I already Complete day 1 already so................... YAY MEEEH xDDD -still hides in newbie hole-

Edit: Im slime so.... -climbs out of newbie hole- :)
Last edited by AutoAsh123 on Sun May 24, 2009 4:17 pm, edited 2 times in total.

User avatar
lachie967
Blue ribbon pig
Posts:14
Joined:Sun Apr 26, 2009 9:27 am

Re: [Tutorial] How to create a basic maplestory flash game

Post by lachie967 » Sun May 24, 2009 2:52 am

I will need to make the vcam file myself. How do you make it? My flash wont open it.

---


Could you please explain steps 33 to 36 a bit clearer? on day 6**
Last edited by Montycarlo on Sun May 24, 2009 3:35 am, edited 1 time in total.
Reason: Please edit your previous post rather then posting twice.

User avatar
Montycarlo
Zombie Mushmom
Posts:473
Joined:Sat Jan 10, 2009 12:30 am
Location:Melbourne, Australia.
Contact:

Re: [Tutorial] How to create a basic maplestory flash game

Post by Montycarlo » Sun May 24, 2009 3:53 am

AutoAsh123 wrote:I have a problem now xDDD i cant download Adobe Flash CS4 (eek) Do you guys have any other links??? please tell me if u do i want to make a new flash game for this awesome website ^_^

--

I already Complete day 1 already so................... YAY MEEEH xDDD -still hides in newbie hole-
I couldn't find any mirrors of Adobe Flash, but I'll supply you with the direct links:

Download this one first,
Then this one,
And the open/execute download 2.

lachie967 wrote:I will need to make the vcam file myself. How do you make it? My flash wont open it.
I'm guessing you have a flash version under CS3 :P
1. You need to draw a square with the same width and height as your stage.
2. Make it a MovieClip.
3. 'Enter' the MovieClip by double-clicking it.
4. Click the first frame.
5. Paste this code in the actions window:

Code: Select all

/**
 * VCam AS2 v1.0
 *
 * VCam based on original code by Sham Bhangal and Dave Dixon
 *
 * Dynamic Registration AS2 work by Darron Schall (www.darronschall.com)
 * and AS1 work by Robert Penner (www.robertpenner.com)
 *
 * Special Thanks to Josh Steele and Jeff Brenner
 *
 * @author Bryan Heisey
 * @version 1.0
 * @created 1-April-2008
 *
  * Requirements: Flash 8+ & Actionscript 2
 */

import flash.display.BitmapData;

_visible = false;

addProperty("_x2",get_x2,set_x2);
addProperty("_y2",get_y2,set_y2);
addProperty("_xscale2",get_xscale2,set_xscale2);
addProperty("_yscale2",get_yscale2,set_yscale2);
addProperty("_rotation2",get_rotation2,set_rotation2);

////////////////////////////////////////////////////////////////////////////
// Get stage width and height //////////////////////////////////////////////

var oldScaleMode:String = stage.scaleMode;
stage.scaleMode = "exactFit";

var sW:Number = Stage.width;
var sH:Number = Stage.height;

stage.scaleMode = oldScaleMode;

////////////////////////////////////////////////////////////////////////////
// Get Vcam width and height ///////////////////////////////////////////////

var bounds_obj:Object = this.getBounds(this);

var camH:Number = Math.abs(bounds_obj.yMax-bounds_obj.yMin);
var camW:Number = Math.abs(bounds_obj.xMax-bounds_obj.xMin);

////////////////////////////////////////////////////////////////////////////
// Creat Point for dynamic registration point //////////////////////////////

var rp = {x:this._x, y:this._y};

onEnterFrame = function ():Void {
   camControl();
};

////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////

function camControl():Void {

   ////////////////////////////////////////////////////////////////////////////
   // Move the registration point to the vCams current position ///////////////

   rp.x = _x;
   rp.y = _y;

   ////////////////////////////////////////////////////////////////////////////
   // Gets the current scale of the vCam //////////////////////////////////////

   var h:Number = camH*(_yscale*.01);
   var w:Number = camW*(_xscale*.01);

   ////////////////////////////////////////////////////////////////////////////
   // Gets the stage to vCam scale ratio //////////////////////////////////////

   var _scaleY:Number = sH/h;
   var _scaleX:Number = sW/w;

   ////////////////////////////////////////////////////////////////////////////
   // Positions the parent ////////////////////////////////////////////////////

   _x2 = (w/2)*_scaleX;
   _y2 = (h/2)*_scaleY;

   _xscale2 = _scaleX*100;
   _yscale2 = _scaleY*100;

   _rotation2 = -_rotation;

   ////////////////////////////////////////////////////////////////////////////
   // Apply vCam filters to bitmap ////////////////////////////////////////////

   _parent.filters = this.filters;
   _parent.transform.colorTransform = this.transform.colorTransform;

}

this.onUnload = reset;

function reset():Void {

   ////////////////////////////////////////////////////////////////////////////
   // Resets parent properties ////////////////////////////////////////////////

   _parent._xscale = 100;
   _parent._yscale = 100;
   _parent._x = 0;
   _parent._y = 0;
   _parent._rotation = 0;
   _parent._visible = true;

}

function set_x2(value:Number):Void {
   var a = {x:rp.x, y:rp.y};
   _parent.localToGlobal(a);
   _parent._x += value-a.x;
}
function get_x2():Number {
   var a = {x:rp.x, y:rp.y};
   _parent.localToGlobal(a);
   return a.x;
}

function set_y2(value:Number):Void {
   var a = {x:rp.x, y:rp.y};
   _parent.localToGlobal(a);
   _parent._y += value-a.y;
}
function get_y2():Number {
   var a = {x:rp.x, y:rp.y};
   _parent.localToGlobal(a);
   return a.y;
}

function get_xscale2():Number {
   return _parent._xscale;
}
function set_xscale2(value:Number):Void {
   setProperty2("_xscale",value);
}

function get_yscale2():Number {
   return _parent._yscale;
}

function set_yscale2(value:Number):Void {
   setProperty2("_yscale",value);
}

function get_rotation2():Number {
   return parent.rotation;
}
function set_rotation2(value:Number):Void {
   setProperty2("_rotation",value);
}

function setProperty2(prop:String, n:Number):Void {
   var a = {x:rp.x, y:rp.y};
   _parent.localToGlobal(a);

   _parent[prop] = n;

   var b = {x:rp.x, y:rp.y};
   _parent.localToGlobal(b);

   _parent._x -= b.x-a.x;
   _parent._y -= b.y-a.y;
}
Keep in mind that you will have to go back a couple of steps in the tutorial to make it follow your character.
lachie967 wrote:Could you please explain steps 33 to 36 a bit clearer? on day 6**
Day 6 - Tweaking and the first skill
33 - 1. Enter your character MovieClip on the Main Timeline
2. Go to the first frame that shows the character attacking.
3. Double click the MovieClip.
4. Go to the last frame.
5. Press F6
6. Copy

Code: Select all

_parent.doingAction = false
To the newly created frame.
7. Repeat steps 1~6 for each other frame that shows the character attacking in your character MovieClip.
34 - 1. Open your main character MovieClip. It should be on your main timeline.
2. Click the first frame.
3. Open the Actionscript panel
4. Paste in this code:

Code: Select all

function stopAttacking(Void):Void{
   doingAction = false;
   if(jumping && !_root.ground.hitTest(_x, _y+1, true)) {
      jumping = true;
      gotoAndStop(3);
   }else jumping = false;
}

35 - 1. Go to the Main timeline.
2. Click on your character once.
3. Open the Actionscript panel.
4. Press 'Ctrl + F'
5. Search for:

Code: Select all

if(Key.isDown(Key.UP) && jumping == false && touchedGround){
Replace with:

Code: Select all

if(Key.isDown(Key.UP) && !jumping && touchedGround && !doingAction){

36 - 1. Search for

Code: Select all

if(Key.isDown(Key.LEFT)){
Add a line between the line before it and that line.
2. Copy

Code: Select all

if(Key.isDown(65) && !doingAction){
      doingAction = true;
      gotoAndStop(Math.round(Math.random()*6)+4);
   }

3. Paste it in the blank line.

User avatar
lachie967
Blue ribbon pig
Posts:14
Joined:Sun Apr 26, 2009 9:27 am

Re: [Tutorial] How to create a basic maplestory flash game

Post by lachie967 » Sun May 24, 2009 5:51 am

day 6 - step 9~11b. My screen is shaking and i don't understand how to fix it.
*edit* also after completing step 32 to 38 of day 6, my character can not jump or attack
http://www.mediafire.com/download.php?zntmzz0z1ym

User avatar
Montycarlo
Zombie Mushmom
Posts:473
Joined:Sat Jan 10, 2009 12:30 am
Location:Melbourne, Australia.
Contact:

Re: [Tutorial] How to create a basic maplestory flash game

Post by Montycarlo » Sun May 24, 2009 6:24 am

lachie967 wrote:day 6 - step 9~11b. My screen is shaking and i don't understand how to fix it.
*edit* also after completing step 32 to 38 of day 6, my character can not jump or attack
http://www.mediafire.com/download.php?zntmzz0z1ym
Montycarlo wrote:Please keep in mind that I did a fair bit of fine-tuning to the code to get rid of some glitches and annoyances. They probably still occur in yours (Such as the 'vibrating' glitch). It's up to you to fix them.
Ah I see. In step 33, use

Code: Select all

_parent.stopAttacking()
instead of

Code: Select all

_parent.doingAction = false
and then in step 34 you should have placed the required function in the first frame of the character.

User avatar
lachie967
Blue ribbon pig
Posts:14
Joined:Sun Apr 26, 2009 9:27 am

Re: [Tutorial] How to create a basic maplestory flash game

Post by lachie967 » Sun May 24, 2009 7:39 am

I think i did what you said, but I still can't: Jump or Attack (F4)
http://www.mediafire.com/download.php?rmzym2oerft

User avatar
Montycarlo
Zombie Mushmom
Posts:473
Joined:Sat Jan 10, 2009 12:30 am
Location:Melbourne, Australia.
Contact:

Re: [Tutorial] How to create a basic maplestory flash game

Post by Montycarlo » Sun May 24, 2009 9:07 am

lachie967 wrote:I think i did what you said, but I still can't: Jump or Attack (F4)
*Facepalm* You didn't change anything. You placed the stopAttack() function INSIDE of the checkGround() function, which makes it unavailable. You need to cut that function out and place it AFTER the ending parenthesis bracket '}'. Also you did not change the ending attack frame action, it should be

Code: Select all

_parent.stopAttacking()
and not

Code: Select all

_parent.doingAction = false

User avatar
lachie967
Blue ribbon pig
Posts:14
Joined:Sun Apr 26, 2009 9:27 am

Re: [Tutorial] How to create a basic maplestory flash game

Post by lachie967 » Sun May 24, 2009 9:10 am

oh maybe it was the wrong file on my mediafire account
there are 2 named the same: http://www.mediafire.com/?sharekey=7525 ... f6e8ebb871

Code: Select all

function checkGround():Void{
   if(_root.ground.hitTest(_x, _y+1, true) && yVel >= 0) {
      yVel = -gravity*2;
      jumping = false
      touchedGround = true
   }
   while(_root.ground.hitTest(_x, _y-1, true)){
      _y -= 0.1;
   }
   function stopAttacking(Void):Void{
   doingAction = false;
   if(jumping && !_root.ground.hitTest(_x, _y+1, true)) {
      jumping = true;
      gotoAndStop(3);
   }else jumping = false;
}
}
how am i meant to place this part?

User avatar
Montycarlo
Zombie Mushmom
Posts:473
Joined:Sat Jan 10, 2009 12:30 am
Location:Melbourne, Australia.
Contact:

Re: [Tutorial] How to create a basic maplestory flash game

Post by Montycarlo » Sun May 24, 2009 9:34 am

lachie967 wrote:oh maybe it was the wrong file on my mediafire account
there are 2 named the same: http://www.mediafire.com/?sharekey=7525 ... f6e8ebb871
Replace the code in the first frame of your character to:

Code: Select all

function checkGround():Void{
   if(_root.ground.hitTest(_x, _y+1, true) && yVel >= 0) {
      yVel = -gravity*2;
      jumping = false
      touchedGround = true
   }
   while(_root.ground.hitTest(_x, _y-1, true)){
      _y -= 0.1;
   }
}
function stopAttacking(Void):Void{
   doingAction = false;
   if(jumping && !_root.ground.hitTest(_x, _y+1, true)) {
      jumping = true;
      gotoAndStop(3);
   }else jumping = false;
}
Add this to your onClipEvent(load){ function on your character:

Code: Select all

doingAction = false
Now you will notice that if you attack whilst on the ground and press the left or right keys, your character gets 'stuck'. I'm not going to tell you how to fix it; you need to improve on my code before you can call it your own.

User avatar
lachie967
Blue ribbon pig
Posts:14
Joined:Sun Apr 26, 2009 9:27 am

Re: [Tutorial] How to create a basic maplestory flash game

Post by lachie967 » Sun May 24, 2009 9:55 am

http://www.mediafire.com/download.php?x4znkqw0wmj
ok, i can't attack once no matter what i do. if i press 'a' once, i cannot jump again.

User avatar
Montycarlo
Zombie Mushmom
Posts:473
Joined:Sat Jan 10, 2009 12:30 am
Location:Melbourne, Australia.
Contact:

Re: [Tutorial] How to create a basic maplestory flash game

Post by Montycarlo » Sun May 24, 2009 10:02 am

Code: Select all

onClipEvent(load){
   _parent.stopAttacking()
   doingAction = false
   mostLeft = -730;
mostRight = 730;
   speed = 4;
   stop();
   xscale = _xscale;
   yVel = 0;
   gravity = 0.3;
   jumping = false;
   jumpPower = 7;
   _quality = "LOW";
}
onClipEvent(enterFrame){
   if(_x < mostLeft + _root.ground._x) _x = mostLeft + _root.ground._x; else if(_x > mostRight + _root.ground._x) _x = mostRight + _root.ground._x;
   touchedGround = false
   checkGround()
   yVel += gravity;
   _y += yVel;
   if(jumping) checkGround();
   if(Key.isDown(65) && !doingAction){
      doingAction = true;
      gotoAndStop(Math.round(Math.random()*3)+4);
   }
   if(Key.isDown(Key.LEFT)){
      _x -= speed;
      _xscale = xscale;
      if(jumping == false){
         gotoAndStop(2);
      }
   }else if(Key.isDown(Key.RIGHT)){
      _x += speed;
      _xscale = -xscale;
      if(jumping == false){
         gotoAndStop(2);
      }
   }else if(jumping == false && !doingAction){
      gotoAndStop(1);
      checkGround();
   }
   if(Key.isDown(Key.UP) && !jumping && touchedGround && !doingAction){
      yVel = -jumpPower;
      jumping = true
      _y -= jumpPower/2;
      gotoAndStop(3);
   }
      if(Key.isDown(Key.DOWN)){
     jumping = true
      gotoAndStop(4);
      }
}

User avatar
lachie967
Blue ribbon pig
Posts:14
Joined:Sun Apr 26, 2009 9:27 am

Re: [Tutorial] How to create a basic maplestory flash game

Post by lachie967 » Sun May 24, 2009 10:15 am

i found out how to use the attack Correctly without stuffing it up AT ALL! (F2) monty, if i PM you, will you tell me if i have correctly coded it?

User avatar
Montycarlo
Zombie Mushmom
Posts:473
Joined:Sat Jan 10, 2009 12:30 am
Location:Melbourne, Australia.
Contact:

Re: [Tutorial] How to create a basic maplestory flash game

Post by Montycarlo » Sun May 24, 2009 10:18 am

Of course, however there are multiple ways to do any one procedure.

User avatar
poke1024
Papulatus
Posts:1161
Joined:Sat Jan 10, 2009 5:55 pm
Location:United States
Contact:

Re: [Tutorial] How to create a basic maplestory flash game

Post by poke1024 » Wed May 27, 2009 12:32 am

hey monty, how do you make your sig?
can u teach me?
my flash trial expired, so i cant work on my game

Locked