HOME | DD

JohnJensen — HOW TO MAKE A PLATFORMER Pt. 1

Published: 2006-11-01 13:46:41 +0000 UTC; Views: 35670; Favourites: 59; Downloads: 488
Redirect to original
Description Well.. used a hour.. on this... *sleeps*

ENJOY

hope you learn something!
Related content
Comments: 125

hamza62240 [2012-09-16 21:52:53 +0000 UTC]

Help me, When ever i hit the door in my game, It goes to the next level but the stickman is in the same place where he was in level 1!!! Any Help? I really need this XC :C ;c Xc xc :c

👍: 0 ⏩: 1

JohnJensen In reply to hamza62240 [2012-09-17 07:31:47 +0000 UTC]

Do you make a new keyframe in the new frame for the player?

👍: 0 ⏩: 3

hamza62240 In reply to JohnJensen [2012-09-17 11:12:52 +0000 UTC]

srry uh i meant i did make a new key frame for the char layer, if i did not, post a comment on instructions? <

👍: 0 ⏩: 0

hamza62240 In reply to JohnJensen [2012-09-17 11:10:24 +0000 UTC]

I mean sorry i posted the comment wrong i meant [link]

👍: 0 ⏩: 1

JohnJensen In reply to hamza62240 [2012-09-17 14:50:41 +0000 UTC]

Hm. Well not sure how to fix it then. without having to place the x,y coordinates every frame. What I used to do when making platformer games in as2 with this code was to place the start of the level where the previous level ended. It's a easy trick, but probably not what you want.

If you want bigger levels than just one screen, you can also add scrolling to the engine, which I do in this tutorial: [link]

hope it helps

👍: 0 ⏩: 1

hamza62240 In reply to JohnJensen [2012-09-25 19:37:22 +0000 UTC]

You, sorry, I still (Ashamed) of my self but it doesn't work. I can't make multilevel for my game from that tut, not just a long level, enemy, stomp-able enemy, spikes, doors, wait, i have a good idea: make a level end screen like "Level 1 clear!" with a next level button.

👍: 0 ⏩: 0

hamza62240 In reply to JohnJensen [2012-09-17 11:08:06 +0000 UTC]

I did, i made a new keyframe, for the char

👍: 0 ⏩: 0

fighuass [2012-08-12 17:11:29 +0000 UTC]

Is this AS3 or AS2?

👍: 0 ⏩: 1

JohnJensen In reply to fighuass [2012-08-12 19:05:00 +0000 UTC]

as2, this is old

👍: 0 ⏩: 0

SketchistGames [2012-03-10 00:30:31 +0000 UTC]

To fix the dieing thing (im not sure about the code 100%) just make a layer with name it restart box. make a huge invisible box under the level and make it a movieclip but this coding into it!Go into its properties and add _root.wall

onClipEvent (enterFrame) {
if ([character instance name goes here].hitTest(_root.wall)) {
trace("touching");
[character instance name goes here].x=[put the x value of where the character starts at]
[character instance name goes here].y=[put the y value of where the character starts at]
}
}

👍: 0 ⏩: 0

pengawill [2011-10-30 03:20:16 +0000 UTC]

Umm... I uh... Died...

👍: 0 ⏩: 1

Lycuris In reply to pengawill [2011-12-27 05:51:13 +0000 UTC]

haha same. I was a bit like "well... this is awkward"

👍: 0 ⏩: 0

AnimezingArtist [2011-10-26 18:00:59 +0000 UTC]

You know you can replace the tutorial right? i mean having to check in the comments for the right codes is a bit misleading.
You do happen to be the first to come up in a search of "making a 2d platformer in flash" BTW.

👍: 0 ⏩: 1

JohnJensen In reply to AnimezingArtist [2011-10-26 21:15:28 +0000 UTC]

Alright, I'll look into it one of the following days. Thanks for the heads up.

👍: 0 ⏩: 0

LeWalou [2011-07-09 21:17:07 +0000 UTC]

Ok i just went trough the comments and resolved the issue. you should fix the mistake you did.

👍: 0 ⏩: 0

LeWalou [2011-07-09 21:00:42 +0000 UTC]

i get a syntax error at line 1.

i really, dont see what is wrong.

the moving object is called "Mech" and the ground "ground"

👍: 0 ⏩: 1

SamVenom In reply to LeWalou [2011-07-11 20:31:25 +0000 UTC]

it says ClipEvent change that to onClipEvent
EXACTLY LIKE THAT NO EXTRA CAPS EXACTLY LIKE THAT

👍: 0 ⏩: 1

LeWalou In reply to SamVenom [2011-07-11 20:52:15 +0000 UTC]

My comment just up to this one says i fixed it, but thanks for taking your time.

👍: 0 ⏩: 0

Howi3 [2011-05-02 04:09:09 +0000 UTC]

nice tutorial worked for me, but not immediately...for those having problems make sure your using actionscript 2 and when you go to paste the main code make sure it is on the movieclip and not the frame in the timeline

👍: 0 ⏩: 0

SCThornhider [2011-03-12 02:22:18 +0000 UTC]

How do I get my character's walking animation in just the second frame?

👍: 0 ⏩: 1

SamVenom In reply to SCThornhider [2011-07-11 20:32:45 +0000 UTC]

select in and say convert to symbol and then double click it and do the animation and when ur done double click the symbol again

👍: 0 ⏩: 1

SCThornhider In reply to SamVenom [2011-07-12 16:53:06 +0000 UTC]

Okay, Thank you ^^

👍: 0 ⏩: 0

bakagain [2011-01-28 03:20:12 +0000 UTC]

Hidden by Commenter

👍: 0 ⏩: 1

hamza62240 In reply to bakagain [2012-09-16 21:33:18 +0000 UTC]

When you make a movie clip, Double-click the Movie clip. Now you get inside it. Don't think all your frames are removed kid! Now you can give the Movie Clip some / a key-frame(s)! Now to get back to the actual movie scene, Just click "Scene 1" at the top.

👍: 0 ⏩: 1

bakagain In reply to hamza62240 [2012-09-22 04:16:23 +0000 UTC]

Hidden by Commenter

👍: 0 ⏩: 1

hamza62240 In reply to bakagain [2012-09-22 10:38:20 +0000 UTC]

OK, when am i not late?

👍: 0 ⏩: 1

bakagain In reply to hamza62240 [2012-09-23 04:59:39 +0000 UTC]

Hidden by Commenter

👍: 0 ⏩: 1

hamza62240 In reply to bakagain [2012-09-27 11:01:20 +0000 UTC]

Awwh, Naw prahblahm!!

👍: 0 ⏩: 0

bakagain [2011-01-28 03:15:46 +0000 UTC]

Hidden by Commenter

👍: 0 ⏩: 2

hamza62240 In reply to bakagain [2012-09-16 21:33:36 +0000 UTC]

When you make a movie clip, Double-click the Movie clip. Now you get inside it. Don't think all your frames are removed kid! Now you can give the Movie Clip some / a key-frame(s)! Now to get back to the actual movie scene, Just click "Scene 1" at the top.

👍: 0 ⏩: 0

Aerodiety In reply to bakagain [2012-03-24 01:15:49 +0000 UTC]

You double click on the movieclip and it will come up with a timeline inside of it.

👍: 0 ⏩: 0

OtiLoL [2010-12-31 17:10:22 +0000 UTC]

wow aweasome tutorial!

👍: 0 ⏩: 1

JohnJensen In reply to OtiLoL [2011-01-01 23:01:54 +0000 UTC]

Thanks!

👍: 0 ⏩: 1

OtiLoL In reply to JohnJensen [2011-01-02 11:15:59 +0000 UTC]

it's nothing

👍: 0 ⏩: 0

WOLFCAT22 [2010-11-25 18:55:18 +0000 UTC]

I'm pretty new to flash, and I have some questions. First, I have my character sprites and the ground made, yet when I hit play it just cycles through them in a movie. How do I get it to play like a game?

Also, do I need to put in "stop();" in every frame of the running animation?

Thanks. I know I'm a noob. >_<'

👍: 0 ⏩: 1

hamza62240 In reply to WOLFCAT22 [2012-09-17 22:53:44 +0000 UTC]

No, you do need to put stop(); somewhere, but NOT. IN. THE. RUNNING. Animation for god sake. Go to scene 1 and double click the movie clip again to get into it, put "stop();" on every single frame of the animation

👍: 0 ⏩: 0

gojira200 [2010-11-07 23:46:53 +0000 UTC]

um how exactly do we put a walking sequence on 1 frame

👍: 0 ⏩: 2

hamza62240 In reply to gojira200 [2012-09-16 21:41:17 +0000 UTC]

When you get into the Movie Clip, make the char, now then create another frame (Right click where you want to make frame > Insert frame or "F6".)

Now Don't remove everything and start animating, please be patient (Sorry, My English is a bit bad).

*ALSO MAKE SURE YOU HAVE CONVERTED THE CHAR IN THE FIRST FRAME OF THE CLIP A MOVIE CLIP TOO!* Now in frame 2, Select the char and Press Ctrl+B or Right Click > Break Apart.

If you don't, It will replace the standing animation with the walking one.

Now convert the broken apart char into a movie clip again. It's necessary or you cant do it.

Now double-click the movie clip, Now start animating the walking animation. to get back to the clip, Click "char" or "Character" or whatever you have named the character on the top. To get back to the normal movie scene, Click "Scene 1" at the top.

👍: 0 ⏩: 0

JohnJensen In reply to gojira200 [2010-11-09 16:09:05 +0000 UTC]

Make a movie clip with the walking animated, and then add that movie clip on the frame

so it's like this:

Player (movie clip) -> frame 1 contains a movie clip with him walking, so it has multiple frames

👍: 0 ⏩: 0

A-Beatles-Fan [2010-10-21 16:37:37 +0000 UTC]

Hey, I need help creating a Mario world. I was hoping you could help. I'm not too good with Flash, but figured I'd ask for help anyways. I don't know how to get the cross thingy under my movie, and I'm getting a syntax error on the first line on the ClipEvent. If you can, can you email me? it's mwolstein at yahoo dot com.

Thanks,
Mike

👍: 0 ⏩: 1

JohnJensen In reply to A-Beatles-Fan [2010-11-13 15:44:38 +0000 UTC]

Add a "on" before the ClipEvent.

Also, to move the + you need to double click the movie clip and actually move the content inside the movie clip above the +, so you're not actually moving the +, but the squishable stuff inside it! :)

👍: 0 ⏩: 0

Twisted4000 [2010-08-28 22:00:34 +0000 UTC]

ty

👍: 0 ⏩: 0

AndyTheElite [2010-06-03 17:48:36 +0000 UTC]

nice work

i dont do much flash im more into directX tho

👍: 0 ⏩: 1

JohnJensen In reply to AndyTheElite [2010-06-03 19:04:52 +0000 UTC]

That's pretty hardcore, you're a C++'er?

👍: 0 ⏩: 1

AndyTheElite In reply to JohnJensen [2010-06-09 21:48:12 +0000 UTC]

C#'er

👍: 0 ⏩: 1

JohnJensen In reply to AndyTheElite [2010-06-09 23:03:44 +0000 UTC]

Oh right. =o so you're using XNA too?

👍: 0 ⏩: 1

AndyTheElite In reply to JohnJensen [2010-06-18 16:25:34 +0000 UTC]

a bit XNA

👍: 0 ⏩: 0

alexw99 [2010-04-17 09:20:00 +0000 UTC]

when i play it it says **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Syntax error.
ClipEvent (load) {

Total ActionScript Errors: 1 Reported Errors: 1

and the character dosnt move help

👍: 0 ⏩: 2

hamza62240 In reply to alexw99 [2012-09-16 21:43:40 +0000 UTC]

At the top, he wrote "ClipEvent (load) {". add "on" at the first part of the script, Don't do spaces. no capitals.

👍: 0 ⏩: 0

JohnJensen In reply to alexw99 [2010-04-17 10:18:10 +0000 UTC]

Type "on" in the beginning on the code before

ClipEvent (load) {

so it says

onClipEvent (load) {

👍: 0 ⏩: 1


| Next =>