00:00
00:00
Newgrounds Background Image Theme

aniMATING just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Platform Tutorial AS2

Share Collapse

Author Comments

Note: This tutorial is written for AS2!

First off, I'd like to inform reviewers that Newgrounds categorizes tutorials and games as the same; if you were expecting this to be a game, you're wrong!

This is a rather detailed tutorial on my new platform engine. It involves acceleration, deceleration, sliding, jumping, gravity, walls, and two different attack types! There are a few glitches, but provided you don't change the variables too much, you should be fine. I explain every ActionScript word once, and fully explain all of the phrases and lines. RECOMMEND FOR TUTORIAL COLLECTION PLEASE!

- EDIT: Daily 3rd?! Woohoo!!!
- EDIT: I get a common question asking how to add enemies. My old and shitty Real-Time Battles tutorial covers it, so go check it out!
- EDIT: I've also gotten requests on how to make a V-Cam. This is also fairly easy; just paste this inside the first frame of a Movie Clip (make the Movie Clip the size of the screen):
onEnterFrame=function(){
_parent._x=Stage.width/2-
_x;
_parent._y=Stage.height/2 -_y;
}
onUnload=function(){
_parent._x=0;
_parent._y=0;
}

Log in / sign up to vote & review!

Cool

I'm using AS2, I'm experiencing a lot of problems in this tutorial. I'm making a very advance platform game.

Problem 1#: I can't understand this line: "On the frames where these appear, put". Also if you mean we have to put it in the kick on the ground and in the air kick FRAMES, then there already is a "stop();" on the frame.

Problem 2#: I put the
if(!Key.isDown(65)){
_root.attack=false;
}
if(Key.isDown(65)){
play();
}
, then it says in the output panel:

**Error** Symbol=Symbol 8, layer=Layer 1, frame=5:Line 1: Statement must appear within on/onClipEvent handler
if(!Key.isDown(65)){

**Error** Symbol=Symbol 8, layer=Layer 1, frame=5:Line 4: Statement must appear within on/onClipEvent handler
if(Key.isDown(65)){

Total ActionScript Errors: 2 Reported Errors: 2.

Help! I love the tutorial, but i gave 2.5 stars cause of these problems.

Kwing responds:

You're putting the code in the wrong spot. If you knew a little about ActionScript, you'd know you have to put the code on certain frames instead of on the Movie Clip itself. The code explains itself, so you should know what frame to put it at (since everyone is going to animate differently).

Great tutorial, it is a bit advanced but explains everything quite well.
The only problem is that when i press any buttons, my character gets stretched out and flattened.
Help Please?

Kwing responds:

That's because you've resized the player with the free transform tool. My suggestion is this:

1. Add this in an onClipEvent(load){ tag
baseScale=_xscale;

2. Hit CTRL + F and find every instance of _xscale. Every time you have a line of code that says:
_xscale = 100;
or
_xscale = -100;
replace "100" with "baseScale".

That should make the size changes carry over even if you change the player's size with free transform. Otherwise just resize the player inside of their Movie Clip rather than outside.

Ahhh AS2 how i love you, i am dipping my toes into AS3 and that is a whole new world, the idea of never using actionscript on movie clips themselves is terrifying, instead using listeners. Anyway the script was solid, i still dislike when games have gravity like we're on Mars(Spaceman Craig Keee-Kuuu-Keee-Kuuu) the more static gravity like QUICK UP AND DOWN is more my style. But i simply loved the explanation but the color's are not good for the eyes to read ( and no i have 19 inch acer LCD ) no low contrast, it's better to use white on dark green :D.. But i give you top score because the information is there... Question

You say you put the actions for the wall, ceiling on themselves.. Can't you just as well put that in the character if the character's instance name hitTarget instance of the movieclips wall ceiling, yadayad and keep it all inside the main character.. (Only problem being that if you do create enemies, you'd have to copy paste that into their MC instead of just.. ahh never mind your way seams better regarding that issue...

And the A for attack was nice but if you didn't hold down A it just went to frame 1 of the stance, you might consider running an animation and just put _root.hero.gotoAndStop(1);

Anyway just amazing :) full score from me...

Kwing responds:

This engine is almost 3 years old. If I took a whack at making a game where you mash a button instead of holding it down, I could probably come up with something in 10-15 minutes. As it is, I don't see much of a need to rewrite an old tutorial that not too many people look at anymore anyway.

everything's good but I can't get hte target to work. It says I need the /onEnterEvent handler.

Please help :C

Kwing responds:

You might be confusing what goes on a Movie Clip and what goes on a frame inside of a Movie Clip, or even on the timeline itself.

Credits & Info

Views
26,747
Faves:
86
Votes
51
Score
4.56 / 5.00

Uploaded
Oct 18, 2009
2:40 AM EDT
Genre
Tutorial
  • Daily 3rd Place October 19, 2009