Forum Topic: I've made a jumping engine for all.

(29,511 views • 373 replies)

This topic is 13 pages long. [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 91113 ]

<< < > >>
None

Rystic

Reply To Post Reply & Quote

Posted at: 7/25/04 11:04 AM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

If anyone makes a game using this engine, could you post a link to it here? I wanna see any games that use it.

Sorry, this is one of those "testing it into the ground" things. I wanna make sure it works for everyone else as well.


None

FFKing

Reply To Post Reply & Quote

Posted at: 7/25/04 11:12 AM

FFKing EVIL LEVEL 06

Sign-Up: 12/13/03

Posts: 358

I got a real simple one thats simply a ball bouncing so far, but that sux as its sooooooooo simple, but what I will do is do a demo of a level in my upcoming game (Saddam adventures 1.04) and email u the link.


None

Rystic

Reply To Post Reply & Quote

Posted at: 7/25/04 11:36 AM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

At 7/25/04 11:12 AM, FFKing wrote: I got a real simple one thats simply a ball bouncing so far, but that sux as its sooooooooo simple, but what I will do is do a demo of a level in my upcoming game (Saddam adventures 1.04) and email u the link.

Thanks. And don't worry about there being a simple bouncing ball; that's pretty much what the engine's FLA looks like.


None

FFKing

Reply To Post Reply & Quote

Posted at: 7/25/04 11:53 AM

FFKing EVIL LEVEL 06

Sign-Up: 12/13/03

Posts: 358

It is a kinda blasphemeric game, so beware :D


None

FFKing

Reply To Post Reply & Quote

Posted at: 7/25/04 12:37 PM

FFKing EVIL LEVEL 06

Sign-Up: 12/13/03

Posts: 358

I told u in the Actionscript forum to shut up and die. So do.


None

Rystic

Reply To Post Reply & Quote

Posted at: 7/25/04 02:00 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

At 7/25/04 12:37 PM, FFKing wrote: I told u in the Actionscript forum to shut up and die. So do.

Huh? What on earth are you talking about?


None

schorhr

Reply To Post Reply & Quote

Posted at: 7/25/04 02:05 PM

schorhr NEUTRAL LEVEL 11

Sign-Up: 05/28/02

Posts: 9,029

Someone posted garbage on every post, it has been deleted.


None

sejumaw

Reply To Post Reply & Quote

Posted at: 7/25/04 02:24 PM

sejumaw NEUTRAL LEVEL 07

Sign-Up: 07/19/04

Posts: 66

Wow, thanks, I've been wanting to make a platformer in flash.

Expect one for that little guy in my sig.


None

FFKing

Reply To Post Reply & Quote

Posted at: 7/25/04 02:32 PM

FFKing EVIL LEVEL 06

Sign-Up: 12/13/03

Posts: 358

At 7/25/04 02:00 PM, Rystic wrote: Huh? What on earth are you talking about?

Dont worry, its not u I;'m on about, but some guy whos only 45 psots were like spam!!!111, just copy-pasted like 400 times. Not u. Sorry for the confusion.


None

Rystic

Reply To Post Reply & Quote

Posted at: 7/25/04 02:50 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

At 7/25/04 02:05 PM, schorhr wrote: Someone posted garbage on every post, it has been deleted.

Oh, I see.


None

Diki

Reply To Post Reply & Quote

Posted at: 7/25/04 03:22 PM

Diki NEUTRAL LEVEL 13

Sign-Up: 01/31/04

Posts: 927

I modified the script a little.
My modification allows for the character to jump through the bottom of a platform and land on the top.
I also made a modifcation to alter the "gravity"

Here's the .swf of it:

Here's how to do it: http://www.eternalrpg.net/modification.swf
(Note: You must know how to make buttons/movieclips for this)

Draw a line that has the same width has your platform (line thickness doesn't matter, but I prefer to use "3").
Make it a movieclip, and place it just under the bottom of your platform.
Give it this actionscript:
onClipEvent(enterFrame) {
_alpha=0
if(this.hitTest(_root.circle)) {
_root.jumpgo = "yes"
}
}

Copy and paste that line.
Now, this may get confusing.
Move the line above the platform, and place it just above the height of your character.
(Here's an animation that will explain it better: http://www.eternalrpg.net/explained.swf

Now, delete the actionscript in the top line, and give it this script:
onClipEvent(enterFrame) {
_alpha=0
if(this.hitTest(_root.circle)) {
_root.jumpgo = "no"
}
}

Now, delete all the actionscript in your platform (assuming you have any in it, and have a platform made) and give it this script:
onClipEvent (load) {
activated = false;
down = false;
}
onClipEvent (enterFrame) {
if(_root.jumpgo == "yes") {
} else {
_root.report.text = Math.round(_root.circle.yMax)+" "+Math.round(yMin);
xmin = getBounds(_root).xMin;
xmax = getBounds(_root).xMax;
ymin = getBounds(_root).yMin;
ymax = getBounds(_root).yMax;
if (_root.circle.xMax>xMin && _root.circle.xMin<xMax && _root.circle.yMax<yMin) {
if (_root.circle.yMax-_root.circle.jump*2>yMin) {
_root.circle._y = ymin-_root.circle._height/2;
_root.circle.jump = undefined;
_root.circle.fall = false;
activated = true;
}
}
if (Math.round(_root.circle.yMax)>Math.round(yMin)) {
if (hitTest(_root.circle) && _root.circle.xmax<xmin) {
_root.circle._x -= _root.circle.speed;
}
if (hitTest(_root.circle) && _root.circle.xmin>xmax) {
_root.circle._x += _root.circle.speed;
}
if (hitTest(_root.circle) && _root.circle.ymin>ymax && _root.circle.jump>-1) {
_root.circle.jump = -1*(_root.circle.jump);
}
}
if (activated == true && not hitTest(_root.circle) && _root.circle.jump == undefined) {
_root.circle.jump = 0;
activated = false;
}
if (hitTest(_root.circle) && _root.circle.ymax>ymin && _root.circle.jump<>undefined && _root.circle._y<_y) {
_root.circle._y = ymin-_root.circle._height/2;
_root.circle.jump = undefined;
_root.circle.fall = false;
activated = true;
}
if (_root.circle.ymax-_root.circle.jump>ymin && _root.circle.xMin<xMax && _root.circle.xMax>xMin && _root.circle.jump<>undefined && _root.circle._y<_y) {
_root.circle._y = ymin-_root.circle._height/2;
_root.circle.jump = undefined;
_root.circle.fall = false;
activated = true;
}
}
}

And finally, make 3 buttons, they will be for making the gravity "High", "Normal", and "Low".
After you have them made, give them this actionscript:

The "High" Button:
on(release) {
_root.fallspeed=2;
}

The "Normal" Button:
on(release) {
_root.fallspeed=1;
}

The "Low" Button:
on(release) {
_root.fallspeed=.5;
}

If something doesn't work, or you can't figure something out, just ask for help.


None

schorhr

Reply To Post Reply & Quote

Posted at: 7/25/04 03:29 PM

schorhr NEUTRAL LEVEL 11

Sign-Up: 05/28/02

Posts: 9,029

This is a nice mod. Good job!
Still, i hate flat levels :-) I prefer something like http://www.di-m.de/runner.swf (just a coding test)


None

Rystic

Reply To Post Reply & Quote

Posted at: 7/25/04 03:51 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

At 7/25/04 03:29 PM, schorhr wrote: This is a nice mod. Good job!
Still, i hate flat levels :-) I prefer something like http://www.di-m.de/runner.swf (just a coding test)

This engine doesn't necessary use flat surfaces. All you have to do is make a bunch of small squares in a diagonal line. That'll work. Also, the line seems to be dead.


None

schorhr

Reply To Post Reply & Quote

Posted at: 7/25/04 04:40 PM

schorhr NEUTRAL LEVEL 11

Sign-Up: 05/28/02

Posts: 9,029

Yeah, but using a bunch of plattforms is a bit insuficcient for a shaped ground.
My first platformer is on a different webspace ( http://www.spamihilator.com/shaw/shawcartoon/test/rpg18b.html ), but its very basic.


None

SuperBokey

Reply To Post Reply & Quote

Posted at: 7/25/04 05:05 PM

SuperBokey LIGHT LEVEL 08

Sign-Up: 10/20/02

Posts: 283

Wow that game was pretty cool.. It kinda reminded me of Hobbo Hotel or something like that... Keep up the good work!


None

schorhr

Reply To Post Reply & Quote

Posted at: 7/25/04 05:17 PM

schorhr NEUTRAL LEVEL 11

Sign-Up: 05/28/02

Posts: 9,029

Habbo? That game? My Rogerjump? :-)
I wish I would have invested some more work in the animation & Art, it was intended to be a small how-to-mak-plattformers, but the ideas are just wild :)


None

Rystic

Reply To Post Reply & Quote

Posted at: 7/25/04 06:22 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

At 7/25/04 05:17 PM, schorhr wrote: Habbo? That game? My Rogerjump? :-)
I wish I would have invested some more work in the animation & Art, it was intended to be a small how-to-mak-plattformers, but the ideas are just wild :)

Is it made of diagonal boxes? Kinda feels like it...


None

Rystic

Reply To Post Reply & Quote

Posted at: 7/25/04 06:24 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

At 7/25/04 06:22 PM, Rystic wrote:
Is it made of diagonal boxes? Kinda feels like it...

Nevermind... reading back on the posts, I see it is...

Boy, that was bad of me.


None

Rystic

Reply To Post Reply & Quote

Posted at: 7/25/04 06:30 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

Good news everyone!

Originally when I made this engine, I was going to add a side scrolling feature so a REAL platformer could be made. However, since I didn't want to bother with attachments in the very beginning, I held off doing it. Well now, since the topic is such a success, I'll release the other code! I'm not sure if it works properly yet, so you guys be the beta testers.

First, add this to every block:


onClipEvent (enterFrame) {
if (_global.moveX>0) {
_x -= _root.circle.speed;
}
if (_global.moveX<0) {
_x += _root.circle.speed;
}
}

Then, add this to the character:

onClipEvent (enterFrame) {
if (_global.moveX>0) {
_x -= _root.circle.speed*2;
}
if (_global.moveX<0) {
_x += _root.circle.speed*2;
}
}

Finally, make two big blocks off screen on each side of the drawing board. Put this into the one on the right:


onClipEvent (enterFrame) {
x++;
if (hitTest(_root.circle)) {
_global.moveX = 1;
x=0;
}
if (x==5 && _global.moveX==1) {
_global.moveX=0;
}
}

and this in the one on the left:


onClipEvent (enterFrame) {
x++;
if (hitTest(_root.circle)) {
_global.moveX = -1;
x=0;
}
if (x==5 && _global.moveX==-1) {
_global.moveX=0;
}
}

If it works properly, you should have side-scrolling platforms!

Tell me if it works. I need to know.


None

schorhr

Reply To Post Reply & Quote

Posted at: 7/25/04 06:31 PM

schorhr NEUTRAL LEVEL 11

Sign-Up: 05/28/02

Posts: 9,029

ARGH dang, I posted the wrong game link.

The RPG uses boxes and shapes. But i ment

http://www.spamihilator.com/shaw/shawcartoon/test/rogerjump8.html

.....


None

Diki

Reply To Post Reply & Quote

Posted at: 7/25/04 07:16 PM

Diki NEUTRAL LEVEL 13

Sign-Up: 01/31/04

Posts: 927

At 7/25/04 06:31 PM, schorhr wrote:

:http://www.spamihilator.com/shaw/shawcartoon/test/rogerjump8.html

O_o, weird game.


None

Rystic

Reply To Post Reply & Quote

Posted at: 7/25/04 07:28 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

At 7/25/04 07:16 PM, Rabid_Badger wrote:
At 7/25/04 06:31 PM, schorhr wrote: http://www.spamihilator.com/shaw/shawcartoon/test/rogerjump8.html
O_o, weird game.

A tad blocky.


None

Rystic

Reply To Post Reply & Quote

Posted at: 7/26/04 05:55 AM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

At 7/25/04 07:16 PM, Rabid_Badger wrote:
At 7/25/04 06:31 PM, schorhr wrote: http://www.spamihilator.com/shaw/shawcartoon/test/rogerjump8.html
O_o, weird game.

I still need someone to test my code in MX 2004 to see if it works.


Happy

Masonogy1

Reply To Post Reply & Quote

Posted at: 7/26/04 07:51 AM

Masonogy1 NEUTRAL LEVEL 18

Sign-Up: 01/12/03

Posts: 577

does not work for flash 5????


None

Diki

Reply To Post Reply & Quote

Posted at: 7/26/04 09:49 AM

Diki NEUTRAL LEVEL 13

Sign-Up: 01/31/04

Posts: 927

Rabid_Badger has yet another nice modification!
This one is for moving the character, so he/she has a walking animation, and so he/she can attack.

First off, in your character (the movieclip) make 6 frames, each one with an exact copy of the character.
All of these copies must be movieclips too.

(still inside the movieclip)
In Frame 1
Have your character facing right.

In Frame 2
Have your character walking right.

In Frame 3
Have your character facing left.

In Frame 4
Have your character walking left.

In Frame 5
Have your character attacking, while facing right.

In Frame 6
Have your character attacking, while facing left.

Now, leave the movieclip, and go into your character's actionscript (press F9 whilst you have it selected) and find this:

onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
}
}

One you have, copy and paste this script BELOW it:

onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
if (Key.isDown(17)) {
_root.moving_2="left"
} else {
_root.moving_2=""
}
_root.moving="left"
if(fall == true) {
if(_root.moving_2=="left") {
_root.circle.gotoAndStop(1)
} else {
_root.circle.gotoAndStop(3)
}
} else {
if (Key.isDown(90)) {
if(_root.moving=="right") {
if(_root.moving_2=="left") {
_root.circle.gotoAndStop(5)
} else {
_root.circle.gotoAndStop(6)
}
}
if(_root.moving=="left") {
_root.circle.gotoAndStop(6)
}

}
if(_root.moving_2 == "left") {
_root.circle.gotoAndStop(2)
} else {
_root.circle.gotoAndStop(4)
}
}

} else {
if(_root.moving=="left") {
if (Key.isDown(90)) {
if(_root.moving_2=="left") {
_root.circle.gotoAndStop(5)
} else {
_root.circle.gotoAndStop(6)
}
} else {
if(_root.moving_2=="left") {
_root.circle.gotoAndStop(1)
} else {
_root.circle.gotoAndStop(3)
}
}
}

if (Key.isDown(Key.RIGHT)) {
if (Key.isDown(17)) {
_root.moving_2="right"
} else {
_root.moving_2=""
}
_root.moving="right"
if(fall == true) {
if(_root.moving_2=="right") {
_root.circle.gotoAndStop(3)
} else {
_root.circle.gotoAndStop(1)
}
} else {
if(_root.moving_2=="right") {
_root.circle.gotoAndStop(4)
} else {
_root.circle.gotoAndStop(2)
}
}

} else {
if(_root.moving=="right") {
if (Key.isDown(90)) {
if(_root.moving_2=="right") {
_root.circle.gotoAndStop(6)
} else {
_root.circle.gotoAndStop(5)
}
} else {
if(_root.moving_2=="right") {
_root.circle.gotoAndStop(3)
} else {
_root.circle.gotoAndStop(1)
}
}
}
}

}

}

Hope it works for you.
If something doesn't work, tell me what went wrong, and I'll help you.
(Note: this script also allows for the character to be moving left/right without changing the way he/she is facing, this is done by holding CTRL+Arrowkeys)


None

Diki

Reply To Post Reply & Quote

Posted at: 7/26/04 09:50 AM

Diki NEUTRAL LEVEL 13

Sign-Up: 01/31/04

Posts: 927

Damn.
I forgot to state that it has "Z" set to attack.
(if you want to change this, you can do so by finding the ASCII Key Value of the key you want to have attack, and replace the 90 in: if(Key.isDown(90) with the appropriate key value.


None

Rystic

Reply To Post Reply & Quote

Posted at: 7/26/04 07:42 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

At 7/26/04 07:51 AM, Masonogy1 wrote: does not work for flash 5????

I'm not too sure... Some of the code might be beyond flash 5.


None

Diki

Reply To Post Reply & Quote

Posted at: 7/26/04 10:34 PM

Diki NEUTRAL LEVEL 13

Sign-Up: 01/31/04

Posts: 927

At 7/26/04 07:42 PM, Rystic wrote:
At 7/26/04 07:51 AM, Masonogy1 wrote: does not work for flash 5????
I'm not too sure... Some of the code might be beyond flash 5.

It probably won't work on either Flash 5, or mx2004.


Shouting

PunkerFish

Reply To Post Reply & Quote

Posted at: 8/13/04 03:48 PM

PunkerFish EVIL LEVEL 08

Sign-Up: 03/21/04

Posts: 70

HOLY CRAP! This is the best jumping code ever! My brother and I have been trying to make a good code forever. Thanks Rystic you're the coolest!


Questioning

PunkerFish

Reply To Post Reply & Quote

Posted at: 8/13/04 03:50 PM

PunkerFish EVIL LEVEL 08

Sign-Up: 03/21/04

Posts: 70

Mmm...quick question.

How would I go about scrolling with no instance names?


All times are Eastern Standard Time (GMT -5) | Current Time: 05:33 PM

<< Back

This topic is 13 pages long. [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 91113 ]

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!