Added: 3 years ago
From: PieManTheHero
Views: 16,177
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (147)

Sign In or Sign Up now to post a comment!
  • Dude thanks! I just needed the code for the ground so the char wont run on the whole symbol

    Like for this!

  • Your vid went viral on Ukraine

  • This video is a favorite on Chad

  • @octaviocurti922 on Chad?

  • wow respekt man, voila hehe ;) nice one point for you. ciao

  • Awesome!

  • where can i get this program?

  • @GPepicness From Adobe. It's Adobe Flash Professional.

  • You are a bloody LEGEND....

  • onClipEvent (load){ speed = 5; gravity = 0; r = _height/2; jumping = false jumpheight = 10; } onClipEvent(enterFrame){ if(Key.isDown(Key.RIGHT)) { _x += speed; } if(Key.isDown(Key.LEFT)) { _x -= speed; } if(Key.isDown(Key.UP) && !jumping){ gravity = -jumpheight; jumping = ture; } if(!_root.ground.hitTest(_x, _y, true)){ gravity++; _y +=Gravity; }else { jumping = false; gravity= 0; } while(_root.ground.hitTest(_x, _y-1+r, true)){ jumping = false; _y--; } }
  • Would this work on 2 bounding box's that act as feet? Could I apply combat to this code without conflicts?

  • Comment removed

  • wow I have been trying so hard to get a jump and gravity, and set hit collision and never was able to figure it out till now. Please make more tutorials!

  • @Apolacalypto i can tell you how to make a walking animation. PM if you want to know :)

  • hey could you help me? i'm trying to do most of the code myself, not all copy paste, and i made a game where you can move and toggle the gravity on/off (with a boolean called grav). then i added the following code for when the character touches the ground:

    if (_root.ground.hitTest(_x, _y, true) && grav == true) {

    gravity = 0;

    isJumping = false;

    }

    the problem is that the character falls through the ground, and then "hits" somewhere below it and it gets all buggy. Moves OK without gravity though

  • @yamxa996 is the sprite centered in the movie clip? 

  • @NapalmXD Thanks for trying to help, i was dumb and i think it was something like that with the sprite... or maybe i had some stuff wrong, i don't even remember anymore. The point is i figured it out myself and its all perfect now, thanks for caring though :P

  • @NapalmXD Yes :)

  • After a few seconds my player falls through the ground!

    And can someone give me a code that lets the player rotate while hitting the ground?

  • @AJC0MICS I solved my problem but now my ball falls after a few seconds too, but only if i stay still.

  • @yamxa996 You need to add gravity = 0; to your while statement right before jumping = false;

  • my ball sinks into the ground a little bit

  • hey i will subscribe, if you make a tutorial , on how to make the character go through a door and go to the next stage ! :D

  • Thanks! It worked! THANKS!

  • oh wait, this is that, My bad lol

  • Will this work in flash action script 2.00?

  • @lukeeeeee7 Yes, it worked for me in 2.0!

  • Could you have the code copied down in the description for the ball so it will be easy to use. :) Thanks

  • @MiniGameMan Done ;) Just for you

  • thanks buddy

  • i thought a platformer with hill climbing would have really complicated code, but you showed me how simple it is

  • @pengro7 I used to think that aswell :)

  • hey mate absolutely amazing tut but i've tried changing all the properties and my char jump disappears after a few second can't see why and slightly floats of the ground any chance u can help?

  • and if you start above the ground it is usefull to make jumping start as true at onClipEvent(load){

    }

  • Comment removed

  • Comment removed

  • i have made a platformer with a fixed code. use this:

    if(!_root.ground.hitTest(_x,_y­,true && gravity < 7)){ //insert what you like

    gravity = gravity +0.9; //insert what you like

    }

    else{ gravity = 7 //insert what you like

    }

    instead of gravity--

  • My ball just falls throuw the ground

  • @wwwgxtv8mcom

    How your ball falls through the ground? Did you put the code on somewhere or yo

  • Comment removed

  • there is one problem though if you stand still for too long you will fall trough the floor.

  • Comment removed

  • ill send you a working code

  • @kiremannen

    If your ground is a rectangle, make another ground under it.

  • awesome! Thanks this helps alot. Thumbs up!

  • Why does my "player" continue to fall even when meeting "ground"?

  • umm... I dont know why but when I try to auto format it (right after the jumpheight is set to 15) it says it cannot because of the errors that are described as followed: Line 12 Statement must appear within on/onClipEvent handler... same thing is said for lines 16, 21, and 31 What does that mean? (I am using CS5 flash, so it autoformats differently)

  • @MrPotatoHead194

    1. It's not the version that you need to look. It's the Actionscript. This one is Actionscript 2.0 .

    2. The errors tell you that you need an onClipEvent stuff.

  • Wait, forget what I said, I had my annotations turned off, sorry ^^'

  • Nice tutorial, but it would be better to explain what you´re programming, still nice work ;)

  • Best tutorial EVER!

    Thank dude

  • im new to making games i am figureing out little by little buy flash cs5 is pissing me off. i have a mac. :) yes! but i dont know how to run my game once i got the game drawn and scripted to test it. it just wont let me any help?

  • WOW! JOHN JENSEN! I never knew this page was yours! I've been following your stuff for ages!

  • @alexk176 Oh yeah... it is. Where do you know me from? Where have you been following my stuff? Are you like a fan? I'm interested... :D

  • @PieManTheHero My other account is alexk175 ;) Sorry it took me so long. I have followed your tutorials and stuff for very long on deviant art and never knew this was you!

  • Every time I run the script, I keep needing to abort the script. Oy vey! Please help me.

  • @maretchin

    This is usually due to loops with while problems and such, try to check your script to make sure its not doing any unnecessary loops over loading itself.

  • :( I need to know how to make my game better, sofar its good, but I need to find out how to make the char die and respawn and how to make more than 1 level, and how to make a score thing with vcam

  • ƒlash XD

  • Basic chinese

  • Absolutely great tutorial. Simple, quick, easily understandable. Thanks!

  • I'm having serious tech. issues:

    It's saying that something in the script is causing my computer to malfunction.

    I have the newest Flash Player. PLEASE HELP!!!

  • coding on movieclips is pretty bad. It's fine for a very static game, but when you're going to add levels, save progress, and pretty much go anywhere beyond a first-frame game, it's going to screw you over.

    Nice tutorial eitherway.

  • I've got a problem. Every time I compile the program, my ball falls onto the ground that I made. But shortly after falls through it a little ways. How can I fix this?

  • Very nice PieMan, i like how good you are in actionscript in typing all that very easily.

  • How would I add an animation to the jump?

  • If it falls through a big for anybody else, just change the height/2 value to something different, I got mine to work at 1.2.

  • Nice tut + High quality is what I love to see.

    Although I have a problem. The ball falls straight through the ground.

    I tried what HellsPlumber said. But It still doesn't work.

    I've looked all over properties and I can't find out anything else to try.

    I'm learning so I don't know much. If someone could help me that would be awesome thanks.

  • @HardstyleMatt  IGNORE!!!!!!!!!

    I've fixed It. Thanks so much!

    Guys who have the fall through problem. Check ALL of your code...

    I missed out a comma in _x,_y,

    Check it all!

  • dude this is a good video but I got a problem my ball stay on the air!!

    what's the problem!!?!?

  • can someone post the code i cant read it on my POS computer ha

  • can someone post the code i cant read it on my pos computer ha

  • i cant let it go of the screen :(

  • realy thx man i watched all the stupid tutorials and noone worked but this did :D thx again!!

  • @Rute52 Wewt for being the only one that worked!

  • @Rute52 Check Flash8Game's Tutorial man!

  • have to say this has lended me a hand. However, in the quick blocks that i made, after about 3 seconds the ball falls traight down to the lower part of the block and continues along it's axis. It's very odd. Thank you anyway. this will do well for the prototype i'm working on.

  • @Oddimpact Good to see that my little video has helped you on the way. :) I know how it is to be clueless about a point in programming. Just keep on going!

  • @PieManTheHero

    Got that problem working, and i've got hit areas set up in arays so that i hit the roof of things :)

    thanks for the reply... i'm still learning though. i've made a few games but mostly from using if statement, variables and goto's. ^^;

  • @Oddimpact: Yeah, I'm having the same problem; this was a nice little thing to create nonetheless.

  • Awesome!

  • very well done, even though I don't get how the player stays exactly in the slope of the ground, I would have expected it to be on the hittest ô.ô

  • Comment removed

  • @ i macromediaflash;

    to make your character run, build a charecter MC with three frames. Then on each frame put another MC of your run jump and idle sequences.

  • @wallross0001 yea see that's not the problem :s. The real problem is i can make it gotoAndStop("run"); but it won't animate it running. The way i have it is on the run frame i have a movie clip of the char walking. But it just stops. Even if i say gotoAndPlay("run");

  • yea so i got the platforming down from another tutorial, but for some reason i can't animate like walking. I tried making a movie clip but it seems like the char is frozen no matter what.

  • you gotta make a symbol, then make another symbol inside it...

    example :

    Make char, Make char symbol(Char walk) THEN u start making him walk, then you code it

    if (Key.isDown(Key.RIGHT)){

    gotoAndStop(2)

    }

    }

    make sure it pops up on your 2nd frame so your "idle shows up"

  • send me ur e mail ill send u an as2 code that allows character movement and allowing it to look like it actually is, plus the principle of gravity is included in the code

  • its not working for me

  • @AwesomeAR someone please post all the script

  • Comment removed

  • Comment removed

  • Comment removed

  • its too long to post PM me and ill send u link to a txt file with it

  • If anyone else has the problem where the circle/character falls through the ground after a while, just change: "while (_root.ground.hitTest(_x, _y-1+r, true)) { jumping = false; _y--; }" to "while (_root.ground.hitTest(_x, _y-1+r, true)) { gravity = 0; jumping = false; _y--; }" Hope this helps =D
  • nice job now only if i can make a way so the player doesn't shoot up walls straight up the y axes

  • Hey can u update this and make a download file this frikin thing is not standing on top of the line

  • @Renkay141 Do you want me too?

    but btw i could make a video on how to not let him fall =D

  • im using flash 8 ad the character just fell through

  • Nothing happened! I'm using CS3 AS 2.0 and it didn't work! Can't you just paste the code right in the description? PLEASE!!! I'M DESPERATE!!!!!!!

  • Wow, this is late, But anyway, flash is case sensitive so if you didn't already know, make sure all your letters are capital where they need to be.

  • lol I type a wrong letter and trying to figured out what I did wrong for half an hour. I hate that. this is good tutorial and it helped me very much so I give you 5 stars

  • It would be cool if someone could get back to em on thisone, but uhh, I did everything, he jumps moves rrarararara, but if he stands still for long enugh he disapears, o.O Anyone know code to fix it?

  • Simple algorithm but effective. Thanks

  • This is the first tutorial that actually works!

    It might be that it's the right flash tutorial because I have flash 8, but I don't know

    This is perfect!

    Thanks

  • wow it like pure gold, I only had to add 1 line of code and thats because my pc is buggered up

  • could you help me with my flash?

    i made a flash game but i need help with some stuff.......i see u know about coding so PM me if u could help and i tell you

  • i got it with winrar its just an extractor not a torrent

  • Comment removed

  • Wow! This is YouTube treasure. All the other tutorials don't show how to apply gravity and the movement as shown.

    5/5 and Fav.

  • what did u say in the comment u removed :)

  • Oh I mentioned a problem I was having, but figured it out.

  • ok =)

  • I have a question:

    what's the purpose of the "!" in "if(!)"

    I saw the Flash help file and it said that it turns the true to false and false to true

    I wanted to test it out and I put this code in a frame action for example:

    i=7;

    e=8;

    if(!i==e){trace("They are not the same")}

    But when I tested it nothing happened

    Shouldn't it be correct cause I said that if i is NOT e then it would be traced cause I put "!" so that should do it...

    What's the true meaning of "!"?????

  • The meaning of the term "!" is to check if it's NOT true and return true.

    Like this:

    If (!_babygetsabinky) { Babycries;

    )

  • Er, where can you get AS 2.0?

  • adobe flash

  • Where do you get adobe flash, then?

  • from adobe

  • GOOGLE GOOGLE GOOGLE. Did I mention GOOGLE.

  • Is there anyway to make a movie clip can't pass throught another?

  • my guess is that you forgot to put an instance name on the ground, i had this problem too, but all you need to do is make the grounds instance name "ground" and copy the exact same code this guy did.

  • yes, by using the hitTest. For example, heres a quick hitTest within an MC. sub the instance name of the MC you want to interact with where the "insert Instance" is.

    if(_root."insert Instance".hitTest(this._x, this._y, true){

    // instert whatever code you want it to do I.E - making it stop

    }

    But this is only for a hitTest for wherever you set the registration of the MC your interacting with. To hitTest on the top, left, etc, simply change the this._x and y till the reg is wher u want it

  • Is there a way to make it so that when it touches something, something happens?

  • Yeah that's easy

    for example:

    if(_root.character.hitTest(_x,­_y,true)){/*Resuilt*/}

    Only remember to put "_root." before the variables you are going to make them change in "resuilt"

    Cause else it won't work..

    The hard part is to make something can't pass through something else.. I've managed to do it somehow, but it doesn't feels right...

  • I try 8 times to make code just like that.

  • i was wondering if you could post the code or tell me what the code is for the first hit test is because i cant really see some of the things that are scripted in. Other than that, this is the thing i have been looking for forever, thanks!

  • I like the part wen u wrote r=_height/2

    fixed most of my problems yay

  • I would put registration on the bottum

  • You would not believe how thankful I am that you uploaded this. I've been searching for months on how to get a movieclip to follow the contours of lines, this is perfect!

    Thank you so much!

  • Here's my problem.Your code works but the player digs into the ground like not on the top.I can jump and move only to the right.How do I fix this?

  • something is wrong with your left code.

    if(Key.isDown(Key.LEFT)){ _x -= speed;

    }

    i also have the fall through the floor problem. I noticed that if you make the ground movieclip smaller vertically you fall through faster and vice versa. Don't know how to fix it yet.

  • found a quick solution and the problem, made a response, just need to post it...

  • thanks man this helped alot, but for some odd reason, after like 10 secs or so my character just falls through the top of the floor. can you help?

  • I've got the same problem

  • thx man

    i used to use vb (visual basic) and this is kind of familar

  • do you put the AS to the circle or on a separate layer

  • The circle/player. :]

  • its nice :D

    5/5 :D

    thanks :)

  • You're welcome. ;)!

  • How can I become so good at ActionScript??

    I'm only a beginner...but I want to improve!!

  • Practise. :D!

    I was once a beginner like you, and I never thought I'd get this good. :P

  • thnx man! helped a lot

  • You're welcome. ;)

  • awesome job on this John! this script really helped me ^^

  • You're welcome, mah boi. ;)

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