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!
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
@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
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?
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)
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?
@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!
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
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.
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?
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!
@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.
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
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
Try checking if there is a collision to the left and up half the height of the player before you walk left, and if there is a collision to the right and up half the height of the player before you move right.
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?
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.
// 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
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!
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!
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.
Dude thanks! I just needed the code for the ground so the char wont run on the whole symbol
Like for this!
8o8inSquares 1 week ago
Your vid went viral on Ukraine
giftbasketer2 1 month ago
This video is a favorite on Chad
octaviocurti922 1 month ago
@octaviocurti922 on Chad?
PieManTheHero 1 month ago
wow respekt man, voila hehe ;) nice one point for you. ciao
xasan5237 2 months ago
Awesome!
GameBuilder15 2 months ago
where can i get this program?
GPepicness 3 months ago
@GPepicness From Adobe. It's Adobe Flash Professional.
JsKingBoo 2 months ago
You are a bloody LEGEND....
mrugankpatankar 3 months ago
wuiyang 5 months ago
Would this work on 2 bounding box's that act as feet? Could I apply combat to this code without conflicts?
wrongfire 6 months ago
This has been flagged as spam show
game-editor . c o m
username350350 6 months ago
Comment removed
username350350 6 months ago
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!
demonshebaz 6 months ago
@Apolacalypto i can tell you how to make a walking animation. PM if you want to know :)
TehSilverSpriter 6 months ago
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 8 months ago
@yamxa996 is the sprite centered in the movie clip?
NapalmXD 6 months ago
@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
yamxa996 6 months ago
@NapalmXD Yes :)
godwebdk 6 months ago
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 8 months ago
@AJC0MICS I solved my problem but now my ball falls after a few seconds too, but only if i stay still.
yamxa996 7 months ago
@yamxa996 You need to add gravity = 0; to your while statement right before jumping = false;
NapalmXD 6 months ago
This has been flagged as spam show
@AJC0MICS You need to add gravity = 0; to your while statement right before jumping = false;
NapalmXD 6 months ago
my ball sinks into the ground a little bit
gawainsonic 8 months ago
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
alalexandros99 8 months ago
Thanks! It worked! THANKS!
eddi790 8 months ago
oh wait, this is that, My bad lol
lukeeeeee7 8 months ago
Will this work in flash action script 2.00?
lukeeeeee7 8 months ago
@lukeeeeee7 Yes, it worked for me in 2.0!
eddi790 8 months ago
Could you have the code copied down in the description for the ball so it will be easy to use. :) Thanks
MiniGameMan 9 months ago
@MiniGameMan Done ;) Just for you
PieManTheHero 9 months ago 2
thanks buddy
KoiBR 9 months ago
i thought a platformer with hill climbing would have really complicated code, but you showed me how simple it is
pengro7 10 months ago
@pengro7 I used to think that aswell :)
PieManTheHero 9 months ago
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?
jcleonhart12345 10 months ago
and if you start above the ground it is usefull to make jumping start as true at onClipEvent(load){
}
ankzmoviez 11 months ago
Comment removed
ankzmoviez 11 months ago
Comment removed
ankzmoviez 11 months ago
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--
ankzmoviez 11 months ago
My ball just falls throuw the ground
wwwgxtv8mcom 11 months ago
@wwwgxtv8mcom
How your ball falls through the ground? Did you put the code on somewhere or yo
Apapilootoe 11 months ago
This has been flagged as spam show
@wwwgxtv8mcom
How your ball falls through the ground? Did you put the code on somewhere or you just made a square ground?
Apapilootoe 11 months ago
Comment removed
ankzmoviez 11 months ago
there is one problem though if you stand still for too long you will fall trough the floor.
kiremannen 11 months ago
Comment removed
ankzmoviez 11 months ago
ill send you a working code
ankzmoviez 11 months ago
@kiremannen
If your ground is a rectangle, make another ground under it.
Apapilootoe 11 months ago
awesome! Thanks this helps alot. Thumbs up!
kiremannen 11 months ago
Why does my "player" continue to fall even when meeting "ground"?
RobbyRichards 1 year ago
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 year ago
@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.
Apapilootoe 1 year ago
Wait, forget what I said, I had my annotations turned off, sorry ^^'
pokerockmario123 1 year ago
Nice tutorial, but it would be better to explain what you´re programming, still nice work ;)
pokerockmario123 1 year ago
Best tutorial EVER!
Thank dude
PAK30000 1 year ago
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?
kaskenuchiha1 1 year ago
WOW! JOHN JENSEN! I never knew this page was yours! I've been following your stuff for ages!
alexk176 1 year ago
@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 1 year ago
@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!
alexk176 6 months ago
Every time I run the script, I keep needing to abort the script. Oy vey! Please help me.
maretchin 1 year ago
@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.
higuything21 1 year ago
:( 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
LemonWafflezz 1 year ago
ƒlash XD
zcoinz 1 year ago
Basic chinese
maperoad4 1 year ago
Absolutely great tutorial. Simple, quick, easily understandable. Thanks!
BelieveableBS 1 year ago
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!!!
KoolDudeProductions1 1 year ago
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.
dash1dash2 1 year ago
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?
AroeAnimator 1 year ago
Very nice PieMan, i like how good you are in actionscript in typing all that very easily.
FreeGiftEmpire 1 year ago
How would I add an animation to the jump?
Xatoku 1 year ago
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.
Xatoku 1 year ago
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 1 year ago
@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!
HardstyleMatt 1 year ago
dude this is a good video but I got a problem my ball stay on the air!!
what's the problem!!?!?
531JEFFREY 1 year ago
can someone post the code i cant read it on my POS computer ha
ACEofSPADES1212 1 year ago
can someone post the code i cant read it on my pos computer ha
ACEofSPADES1212 1 year ago
i cant let it go of the screen :(
Rute52 1 year ago
realy thx man i watched all the stupid tutorials and noone worked but this did :D thx again!!
Rute52 1 year ago
@Rute52 Wewt for being the only one that worked!
PieManTheHero 1 year ago 2
@Rute52 Check Flash8Game's Tutorial man!
1999lego 1 year ago
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 1 year ago
@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 1 year ago
@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 1 year ago
@Oddimpact: Yeah, I'm having the same problem; this was a nice little thing to create nonetheless.
TheFingledorf 11 months ago
Awesome!
MrSilkable 1 year ago
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 ô.ô
Masterkewl2 1 year ago
Comment removed
Rman159Productions 1 year ago
@ 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 2 years ago
@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");
iMacromediaFlash 1 year ago
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.
iMacromediaFlash 2 years ago
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"
Renkay141 1 year ago
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
AlexJTyra 1 year ago
its not working for me
AwesomeAR 2 years ago
@AwesomeAR someone please post all the script
AwesomeAR 2 years ago
Comment removed
Moldysquirral 2 years ago
Comment removed
Moldysquirral 2 years ago
Comment removed
Moldysquirral 2 years ago
its too long to post PM me and ill send u link to a txt file with it
Moldysquirral 2 years ago
HellsPlumber 2 years ago 2
nice job now only if i can make a way so the player doesn't shoot up walls straight up the y axes
Moldysquirral 2 years ago
This has been flagged as spam show
Try checking if there is a collision to the left and up half the height of the player before you walk left, and if there is a collision to the right and up half the height of the player before you move right.
Rman159Productions 1 year ago
Hey can u update this and make a download file this frikin thing is not standing on top of the line
Renkay141 2 years ago
@Renkay141 Do you want me too?
but btw i could make a video on how to not let him fall =D
run3scapeRetros 2 years ago
im using flash 8 ad the character just fell through
TheMachinimanator 2 years ago
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!!!!!!!
redred1854 2 years ago
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.
Theinvisibleunknown 2 years ago
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
mrkvica1000 2 years ago
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?
KillaKarson 2 years ago
Simple algorithm but effective. Thanks
xsgame 2 years ago
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
JamesHarper3 2 years ago
wow it like pure gold, I only had to add 1 line of code and thats because my pc is buggered up
karrotsrkool 2 years ago
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
asasinsonic 2 years ago
This comment has received too many negative votes show
btw anyone knows where i can get this without wasting time on torrents like when i downloaded UT2K4
DragonWalkthroughs52 2 years ago
i got it with winrar its just an extractor not a torrent
123456mat1 2 years ago
Comment removed
caHarkness 2 years ago
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.
caHarkness 2 years ago
what did u say in the comment u removed :)
DragonWalkthroughs52 2 years ago
Oh I mentioned a problem I was having, but figured it out.
caHarkness 2 years ago
ok =)
DragonWalkthroughs52 2 years ago
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 "!"?????
SwordSkill2 2 years ago
The meaning of the term "!" is to check if it's NOT true and return true.
Like this:
If (!_babygetsabinky) { Babycries;
)
caHarkness 2 years ago
Er, where can you get AS 2.0?
ajholmez 2 years ago
adobe flash
MentalMonkeyStudios 2 years ago
Where do you get adobe flash, then?
ajholmez 2 years ago
from adobe
MentalMonkeyStudios 2 years ago
GOOGLE GOOGLE GOOGLE. Did I mention GOOGLE.
TehMatoking 2 years ago
Is there anyway to make a movie clip can't pass throught another?
SwordSkill2 2 years ago
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.
nikmalev500 2 years ago
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
Qwertacious 2 years ago
Is there a way to make it so that when it touches something, something happens?
lego312 2 years ago
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...
SwordSkill2 2 years ago
I try 8 times to make code just like that.
lolmaker553 2 years ago
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!
MagicMenTech 2 years ago
I like the part wen u wrote r=_height/2
fixed most of my problems yay
Renkay141 2 years ago
I would put registration on the bottum
SuperParody 2 years ago
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!
MisterAlexUk 2 years ago
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?
TahGamer 2 years ago
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.
xflamingpenguinx 2 years ago
found a quick solution and the problem, made a response, just need to post it...
xflamingpenguinx 2 years ago
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?
extreme4723 2 years ago
I've got the same problem
pjongjang 2 years ago
thx man
i used to use vb (visual basic) and this is kind of familar
ballr4lyfe 2 years ago
do you put the AS to the circle or on a separate layer
shulpak 3 years ago
The circle/player. :]
PieManTheHero 3 years ago
its nice :D
5/5 :D
thanks :)
TijmenFlash 3 years ago
You're welcome. ;)!
PieManTheHero 3 years ago
How can I become so good at ActionScript??
I'm only a beginner...but I want to improve!!
studyingflash 3 years ago
Practise. :D!
I was once a beginner like you, and I never thought I'd get this good. :P
PieManTheHero 3 years ago
thnx man! helped a lot
MrPedal94 3 years ago
You're welcome. ;)
PieManTheHero 3 years ago
awesome job on this John! this script really helped me ^^
BraydenFP 3 years ago
You're welcome, mah boi. ;)
PieManTheHero 3 years ago