Actionscript 2.0 flash game creation tutorial. Woop.

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
6,579
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 27, 2009

This is just some as2.0 basics, regarding how to make a simple game in flash. This is part 1, and it covers basic movement, with explanations as to what each slice of code means.


Buy My T-shirts and other merch at http://www.cafepress.com/hellapengzilla !

------------------------------------------
Here is all the code mentioned in this video. At this point, this is all applied to one MovieClip:

onClipEvent(enterFrame){
if(Key.isDown(Key.LEFT)){
this._x-=10;
}
}
onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT)){
this._x+=10;
}
}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
this._y-=10;
}
}
onClipEvent(enterFrame){
if(Key.isDown(Key.DOWN)){
this._y+=10;
}
}

  • likes, 2 dislikes

Link to this comment:

Share to:

Uploader Comments (roojames)

  • you can write this to:

    onClipEvent(load){

    speed=10;

    }

    onClipEvent(enterFrame){

    if(key.isDown(Key.Right))

    _x+=speed;

    }

  • Just keep in mind that this is the extreme basics here, so I chose not to cover variables right away

  • It says I have an syntax error..

    Heres my code

    onClipEvent(enterFrame){

    if (Key.isDown(Key.LEFT)) {

    this._x -= 10;

    }

    }

  • Try removing the spaces. The one between "if" and the bracket is where I think the problem is.

  • Ok, this is the tried and true working code:

    onClipEvent(enterFrame){

    if(Key.isDown(Key.LEFT)){

    this._x-=10;

    }

    }

see all

All Comments (9)

Sign In or Sign Up now to post a comment!
  • Awesome vid, it would have helped me a lot if I didn't already know it :)

    But seriously, when i was trying to find out how to do this stuff, I scoured the internet for ages without finding anything that actually explained what it all did. And when I did work it out, I used the variables method that dakon11 mentioned, but this ways much easier.

  • Really nice tutorial. Helped me alot. Speaking alot helps understand it more.

    I laughed at "random semi colon here, god knows why"

  • LOL! yOU END UP.... YOU KNOW, CRYING LOL!!!

  • wow your tutorial is awesome

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more