| Welcome to Brackenwood. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Character Jump; how? | |
|---|---|
| Tweet Topic Started: Feb 27 2006, 03:54 AM (339 Views) | |
| boundless | Feb 27 2006, 03:54 AM Post #1 |
|
stuck in the third dimension
|
I'm working on a game for the ArmorGames comp and I'm using fbf animation. If I wanted to make the character jump, would I animate him jumping and then move him with actionsctipt? I need it for jumping from one ledge to another, jumping over objects, jumping onto other places, etc. My character movie clip is called box_mc and I go to the different animations (walking, crouching, etc.) by jumping to the frame. So the jumping animation would be gotoAndStop(4). I can't figure out gravity or how I would make him fall back if he jumped into a wall. Thanks. By the way, I use Flash MX (not 2004). EDIT: I found some code that helped me assign a MC as the ground and now the character has gravity and the ability to jump. My problem is that he can jump, but I want the power of the jump to depend on how long you hold the UP key. I also need other objects to block the character and have him jump on them. Right now I have a box that stops my character from going further, but if I jump on it, he falls into it and can't move unless you jump back out of it. And I still need better code for the jump... I don't like it the way I have it now. |
![]() |
|
| smoscar_01 | Feb 27 2006, 11:29 PM Post #2 |
|
Mid-Level ActionScripter
|
you really need to have gravity on mind cos not only your character can fall down, also enemies, items or anything, gravity is needed at a scrolling game
now youll need something that stops your movement, lets say you have a movie clip caled ground
that would do the trick :lol: |
![]() |
|
| boundless | Feb 28 2006, 02:45 AM Post #3 |
|
stuck in the third dimension
|
Did you read my post?
I have the gravity and the ground, I just need a way of jumping that depends on the length of time you press the UP key. So if you just tap it you do a small hop and if you hold it for a second, you jump several feet. The other thing is that I need objects to block your path. One of the objects stops the character completely and you cant just jump on it. The other object is there but all you have to do is walk into it to get up it. So if you dont understand that, here's basically what I need:
|
![]() |
|
| Mr. Jiggmin | Feb 28 2006, 04:05 AM Post #4 |
|
made of tulips
|
Did YOU read your post?
I added a couple of lines to smoscar's code that should make them jump higher when you hold down the jump key.
Hope that helps ya.
|
![]() |
|
| boundless | Feb 28 2006, 06:22 AM Post #5 |
|
stuck in the third dimension
|
Uh yeah I said I needed a more advanced jump, not more code for the jump I already have. I'm going to try your code now and edit the post with results... so thanks in advance for helping out. And thanks to smoscar for doing what he could. I should have said thanks anyway cause I guess I was being rude. So thank you both for going out of your way and typing up some code to help me out. EDIT: Hmm well it works, but it moves pretty slow and a little too high. I'll play around with the numbers, but I think I may have an idea for a different method to this whole jump thing. |
![]() |
|
| smoscar_01 | Feb 28 2006, 11:25 AM Post #6 |
|
Mid-Level ActionScripter
|
Sorry if I tried to help you it wont happen again
:angry: ooh and yeah I read it when it wasnt edited |
![]() |
|
| boundless | Mar 1 2006, 02:32 AM Post #7 |
|
stuck in the third dimension
|
I acknowledged the fact I was rude and then I thanked you and Mr. Jiggmin for helping me out. You want me to send you flowers or something? Anyway, I've got a whole different way of doing it now but thanks for the code guys. |
![]() |
|
| smoscar_01 | Mar 1 2006, 05:24 AM Post #8 |
|
Mid-Level ActionScripter
|
yeah the flowers would be nice <_< lol :lol: |
![]() |
|
| Mr. Jiggmin | Mar 1 2006, 11:03 AM Post #9 |
|
made of tulips
|
Out of curiosity, how are you doing it now? |
![]() |
|
| boundless | Mar 1 2006, 11:32 AM Post #10 |
|
stuck in the third dimension
|
I'm getting the jump button to start an animation for the jump and if you hold down the key all the way through, he jumps further than if you let go early. I'm working on it and I still have a lot of problems with multiple keys. I wish I could get Left + Down to make the character do a low walk and other stuff. EDIT: I got the jump working!! It's more realistic and works well for the game I'm doing. Woo I feel good cause I can spend more time on other aspects of the game now
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Actionscript · Next Topic » |






Sorry if I tried to help you it wont happen again
:angry:
5:11 AM Jul 12