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

(29,515 views • 373 replies)

This topic is 13 pages long. [ 135 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 ]

<< < > >>
Angry

Rystic

Reply To Post Reply & Quote

Posted at: 3/6/05 06:49 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

At 3/3/05 11:25 PM, pcchipbrain wrote: hey rystic you got that actionscript from the flash tuturial but anywase good idea of posting it here.

WHAT?! . I didn't take this code from anywhere! I wrote it line for line. I even have the original files to prove it.

TELL ME WHERE YOU THINK I STOLE IT FROM. I'LL PROVE YOU WRONG.

I'm no thief.


None

iameatingjam

Reply To Post Reply & Quote

Posted at: 4/13/05 11:38 PM

iameatingjam NEUTRAL LEVEL 11

Sign-Up: 01/02/05

Posts: 287

could some1 help me? when my guy animates he falls half way through the flatform :(


None

The-Mercenary

Reply To Post Reply & Quote

Posted at: 4/14/05 12:58 AM

The-Mercenary EVIL LEVEL 17

Sign-Up: 01/22/03

Posts: 2,620

At 3/6/05 06:44 PM, Rystic wrote:
At 3/3/05 11:26 PM, The_Mercenary wrote:
god damn its that much of a pain in the ass just use my engine, sorry to sound like an asshole there but come on, its simple and there is no shit like that happening, if you dont want to then its fine. BTW, for the 45 degree angle thing
just take the code I posted for the slant and put it after "if(......_y, true) put it here )"
"and !this._rotation<-45"
Geez, Mercenary. It's not that big a problem. All you have to do is center the clip.

Yea I know, sorry dude, I was getting carried away there. Now I'll actually post the script to my platform engine here.

Make a bunch of platforms, and make all of them into one big movieclip and give it the instance of "ground" and then put this code in it:
onClipEvent (load) {
_root.falltime = 0;
groundspeed = 10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE) && !jumping) {
vel_y = 38;
jumping = true;
_root.character.gotoAndStop("jumpframe#");
}
if (jumping == true) {
vel_y -= 2;
if (vel_y<=-15) {
vel_y = -15;
}
if (vel_y<15) {
_root.character.gotoAndStop("fallingframe#");
_root.falltime2++;
}
this._y += vel_y;
}
if (this.hitTest(_root.character._x, _root.character._y+18, true)) {
vel_y = 0;
_root.character.gotoAndStop(1);
_root.falling = false;
_root.falltime = 0;
jumping = false;
} else {
this._y -= 20;
_root.falltime++;
if (jumping == false and _root.falltime>=5) {
_root.character.gotoAndStop(3);
_root.falling = true;
}
}
}
onClipEvent (enterFrame) {
if (_root.scrollleft == true and _root.stopscroll == false) {
this._x -= groundspeed;
} else if (_root.scrollright == true and _root.stopscroll2 == false) {
this._x += groundspeed;
}
if (this.hitTest(_root.character._x, _root.character._y, true)) {
_root.ground._y += 5;
}
}

then make a character and give it the instance of "character" and put this code in it:

onClipEvent (load) {
speed2 = 8;
_root.scrollright = false;
_root.scrollleft = false;
_root.stopscroll2 = false;
_root.stopscroll = false;
boundry = _x=100;
boundry2 = _x=325;
}
onClipEvent (enterFrame) {
if (_root.ground.hitTest(this._x+30, this._y-25, true)) {
_root.stopscroll = true;
} else {
_root.stopscroll = false;
}
if (_root.ground.hitTest(this._x-30, this._y-25, true)) {
_root.stopscroll2 = true;
} else {
_root.stopscroll2 = false;
}
if (Key.isDown(Key.RIGHT) && !_root.ground.hitTest(this._x+15, this._y-25, true)) {
_xscale = 100;
if (this._x<boundry2) {
this._x += speed2;
} else {
_root.scrollleft = true;
}
} else if (Key.isDown(Key.LEFT) && !_root.ground.hitTest(this._x-15, this._y-25, true)) {
_xscale = -100;
if (this._x>boundry) {
this._x -= speed2;
} else {
_root.scrollright = true;
}
}
}
onClipEvent (keyUp) {
if (Key.getCode() == Key.RIGHT) {
_root.scrollleft = false;
} else if (Key.getCode() == Key.LEFT) {
_root.scrollright = false;
}
}

There thats all, now you have a game. Just dont use this code and submit it as a game, make something cool out of it. And make your characters "+" be at where his feet are so that he lands on the platforms right.

This engine isnt exactly the most perfect for pixel perfect platforming, but this is more like a ready-to-go thing, this can be use for alot of types of games, any sidescroller basically. And Rystic, you can try to mod if you want.


None

Rystic

Reply To Post Reply & Quote

Posted at: 4/14/05 05:34 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

I'll play with the code when I have the time. Unfortunately, I've got an english essay due tommorow. :(


None

The-Mercenary

Reply To Post Reply & Quote

Posted at: 4/15/05 12:48 AM

The-Mercenary EVIL LEVEL 17

Sign-Up: 01/22/03

Posts: 2,620

At 4/14/05 05:34 PM, Rystic wrote: I'll play with the code when I have the time. Unfortunately, I've got an english essay due tommorow. :(

lol, I had a essay do today, well the rough draft anyway


None

ScumOfTheEarth

Reply To Post Reply & Quote

Posted at: 4/16/05 09:36 PM

ScumOfTheEarth EVIL LEVEL 06

Sign-Up: 03/23/05

Posts: 84

Hey i was tryin out your engine but my character cant jump heres what happens...

Im makin a simple game where you jump over some spikes and into the portal to next level...

When my guy gets to the spikes i press up and nothing happens and he dies cause he fell threw the spikes.


None

The-Mercenary

Reply To Post Reply & Quote

Posted at: 4/17/05 12:07 AM

The-Mercenary EVIL LEVEL 17

Sign-Up: 01/22/03

Posts: 2,620

who's engine? if its mine then jump is space


None

Gaaz

Reply To Post Reply & Quote

Posted at: 4/30/05 03:59 PM

Gaaz LIGHT LEVEL 21

Sign-Up: 02/28/04

Posts: 2,204

For some reason my character get's stuck in the block. It can't jump out of it either.

I HAD BIGBADRON'S LAST EVER LOCK
PM if you like or dislike my sig.
Liked (12) Disliked (3)

BBS Signature

None

Darkblazez

Reply To Post Reply & Quote

Posted at: 5/2/05 02:15 PM

Darkblazez NEUTRAL LEVEL 02

Sign-Up: 04/20/04

Posts: 2

Rystic: I was trying out your engine but every time my character lands on the "Ground" he falls halfway through before he stops. Also when I press jump he sticks in the air until I stop holding space. Could you please help me fix this?

Also is there any chance you could tell me how to make the character able to turn around? Or make the objects move like a side scroller?

Thanks!


None

KainX7

Reply To Post Reply & Quote

Posted at: 5/11/05 01:58 AM

KainX7 NEUTRAL LEVEL 07

Sign-Up: 09/27/03

Posts: 27

At 4/30/05 03:59 PM, Shadow_of_sonic wrote: For some reason my character get's stuck in the block. It can't jump out of it either.

Same thing happens to me... How do I fix that?


None

Pheoniks

Reply To Post Reply & Quote

Posted at: 5/11/05 03:11 AM

Pheoniks EVIL LEVEL 06

Sign-Up: 04/27/05

Posts: 20

This was also happening to me, but i fixed it by adjusting the little x on the character/hero MC.


Happy

falon-harrison

Reply To Post Reply & Quote

Posted at: 5/11/05 10:52 AM

falon-harrison NEUTRAL LEVEL 05

Sign-Up: 01/21/05

Posts: 3

ok yall i dont know wut program to use is it flash mx 2004 pro? if it is i got it and how do i script it i am new as u can tell rofl


None

KainX7

Reply To Post Reply & Quote

Posted at: 5/12/05 04:07 AM

KainX7 NEUTRAL LEVEL 07

Sign-Up: 09/27/03

Posts: 27

What do you mean little x?


None

Siggy0501

Reply To Post Reply & Quote

Posted at: 5/12/05 07:34 AM

Siggy0501 LIGHT LEVEL 23

Sign-Up: 01/08/05

Posts: 1,563

At 4/13/05 11:38 PM, iameatingjam wrote: could some1 help me? when my guy animates he falls half way through the flatform :(

a lot of people seem to be having problems with this. i'll explain.
when you create the character's mc (movie clip), go to the symbol pop-up. inside that window, go to the part that says "registration." you are probably registering the middle, or top right corner. that is default i think. if you do not click the center bottom square, the movie clip will land on the block somewhere else. remember. the computer has to be told what part of the movie clip to land on the block, or it will not know!

+ + +

+ + + <---------(registration)

+ + +

^
|
|
This points to the registration circle you have to click.


None

Rystic

Reply To Post Reply & Quote

Posted at: 5/12/05 04:59 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

Everyone, listen to Insignificance. That's how you stop the character from falling through.


None

Jdid112

Reply To Post Reply & Quote

Posted at: 5/12/05 06:11 PM

Jdid112 DARK LEVEL 12

Sign-Up: 07/24/04

Posts: 1,289

Everything is good, but the character stands like inside the block, and that makes it bad.

Say what you mean, then shut up.

BBS Signature

None

Glaiel-Gamer

Reply To Post Reply & Quote

Posted at: 5/12/05 06:14 PM

Glaiel-Gamer NEUTRAL LEVEL 27

Sign-Up: 12/28/04

Posts: 8,030

Eh, I make my own engines, but I would like to see an art-based engine that rotates your character to match the ground.


None

The-Mercenary

Reply To Post Reply & Quote

Posted at: 5/12/05 08:34 PM

The-Mercenary EVIL LEVEL 17

Sign-Up: 01/22/03

Posts: 2,620

At 5/12/05 06:14 PM, Glaiel_Gamer wrote: Eh, I make my own engines, but I would like to see an art-based engine that rotates your character to match the ground.

thats not too hard, if you mean what I think you mean


None

macdough

Reply To Post Reply & Quote

Posted at: 5/12/05 10:05 PM

macdough NEUTRAL LEVEL 08

Sign-Up: 02/20/05

Posts: 107

Rystic: Your script is superb. I love it: no instance names. It feels quite liberating.


Questioning

Mr-Dark

Reply To Post Reply & Quote

Posted at: 5/13/05 01:47 PM

Mr-Dark LIGHT LEVEL 06

Sign-Up: 12/07/04

Posts: 108

PLZ HELP! I've made some Mario game. You can jump, he stops at teh jumping sprite. But when you press the left/right buttons, he will PLAY THE WALKING SPRITE IN MID-AIR! Who can fix my script? Mario's instance name is "mario".

His script is:

onClipEvent (load) {
fall = false;
_name = "mario";
jump = 0;
speed = 4;
jumpheight = 12;
maxfall = -54;
}
onClipEvent (enterFrame) {
xmin = getBounds(_root).xMin;
xmax = getBounds(_root).xMax;
ymin = getBounds(_root).yMin;
ymax = getBounds(_root).yMax;
if (Key.isDown(Key.SPACE) && fall == false && jump == undefined) {
fall = true;
jump = jumpheight;
}
if (jump<>undefined) {
if (jump>maxfall) {
jump--;
}
_y -= jump;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
this.gotoAndStop(2);
_x -= speed;
this._xscale = -110;
}
else if (Key.isDown(Key.RIGHT)) {
this.gotoAndStop(2);
_x += speed;
this._xscale = 110;
}
else if (jump <> undefined){
this.gotoAndStop(4);
}
else if(Key.isDown(Key.SHIFT)){
this.gotoAndStop(3);
}
else if(this.hitTest(_root.enemy)){
_root.health.nextFrame();
}
else if(fall == true){
this.gotoAndStop(4);
}
else
this.gotoAndStop(1);
}

The ground's script is:

onClipEvent (load) {
activated = false;
down = false;
}
onClipEvent (enterFrame) {
_root.report.text = Math.round(_root.mario.yMax)+" "+Math.round(yMin);
xmin = getBounds(_root).xMin;
xmax = getBounds(_root).xMax;
ymin = getBounds(_root).yMin;
ymax = getBounds(_root).yMax;
if (_root.mario.xMax>xMin && _root.mario.xMin<xMax && _root.mario.yMax<yMin) {
if (_root.mario.yMax-_root.mario.jump*2>yMin) {
_root.mario._y = ymin-_root.mario._height/2;
_root.mario.jump = undefined;
_root.mario.fall = false;
activated = true;
}
}
if (Math.round(_root.mario.yMax)>Math.round(yMin)) {
if (hitTest(_root.mario) && _root.mario.xmax<xmin) {
_root.mario._x -= _root.mario.speed;
}
if (hitTest(_root.mario) && _root.mario.xmin>xmax) {
_root.mario._x += _root.mario.speed;
}
if (hitTest(_root.mario) && _root.mario.ymin>ymax && _root.mario.jump>-1) {
_root.mario.jump = -1*(_root.mario.jump);
}
}
if (activated == true && not hitTest(_root.mario) && _root.mario.jump == undefined) {
_root.mario.jump = 0;
activated = false;
}
if (hitTest(_root.mario) && _root.mario.ymax>ymin && _root.mario.jump<>undefined && _root.mario._y<_y) {
_root.mario._y = ymin-_root.mario._height/2;
_root.mario.jump = undefined;
_root.mario.fall = false;
activated = true;
}
if (_root.mario.ymax-_root.mario.jump>ymin && _root.mario.xMin<xMax && _root.mario.xMax>xMin && _root.mario.jump<>undefined && _root.mario._y<_y) {
_root.mario._y = ymin-_root.mario._height/2;
_root.mario.jump = undefined;
_root.mario.fall = false;
activated = true;
}
}

Help please.

I AM USING FLASH MX, not FLASH MX 2004. Thanks in advance.

I'm one of the people who doesn't have text in his signature.


None

Glaiel-Gamer

Reply To Post Reply & Quote

Posted at: 5/13/05 02:35 PM

Glaiel-Gamer NEUTRAL LEVEL 27

Sign-Up: 12/28/04

Posts: 8,030

Like in the original sonic games, sonic rotates to the ground, only that is tile based. I'd like to see an art based engine that does that.


None

The-Mercenary

Reply To Post Reply & Quote

Posted at: 5/13/05 03:47 PM

The-Mercenary EVIL LEVEL 17

Sign-Up: 01/22/03

Posts: 2,620

At 5/13/05 02:35 PM, Glaiel_Gamer wrote: Like in the original sonic games, sonic rotates to the ground, only that is tile based. I'd like to see an art based engine that does that.

art based engines are hard to make, what you have to do is put plain tiles and cover it up with an actual background, thats how I make my platformers. That what my engine is all about, well and there is another step to it, thats making everything off-screen disappear so the game doesnt lag as much as it would. Though, if the game has a fairly large level with decent graphics its probably gonna lag on high.


None

Pengu-X

Reply To Post Reply & Quote

Posted at: 5/13/05 05:00 PM

Pengu-X EVIL LEVEL 04

Sign-Up: 04/13/04

Posts: 90

Whenever my character lands on the block he is half eaten by it and cannot jump, he just sort of moves upwards a little. help please.


None

ZeroResistance

Reply To Post Reply & Quote

Posted at: 5/20/05 12:52 AM

ZeroResistance EVIL LEVEL 08

Sign-Up: 02/13/05

Posts: 162

Double click the character and move it so that the cross is below it. but not too down, or it'l fall away.


None

Visual-Basics-God

Reply To Post Reply & Quote

Posted at: 6/6/05 04:39 PM

Visual-Basics-God FAB LEVEL 02

Sign-Up: 05/21/05

Posts: 212

This is Amazing! that you so much!


None

KillingBee

Reply To Post Reply & Quote

Posted at: 6/12/05 12:26 PM

KillingBee NEUTRAL LEVEL 01

Sign-Up: 06/11/05

Posts: 2

I Started an platform game with Rystic engine i modified a bit (But im a newb to actionscript)
and i want an other MC for when it jumps how do u think i can do that?


Shouting

Simple-Logistics

Reply To Post Reply & Quote

Posted at: 6/12/05 02:35 PM

Simple-Logistics EVIL LEVEL 09

Sign-Up: 05/10/05

Posts: 468

one thing, if u fall from to high you will fall thrue a block!
Nice actionscripting!


None

cosmicrandom

Reply To Post Reply & Quote

Posted at: 6/28/05 09:00 PM

cosmicrandom FAB LEVEL 06

Sign-Up: 11/15/04

Posts: 598

I tried this and when I jump sometimes on it my ball goes through the platforms! :(

black dick

BBS Signature

None

Rystic

Reply To Post Reply & Quote

Posted at: 7/2/05 01:24 PM

Rystic LIGHT LEVEL 50

Sign-Up: 03/09/02

Posts: 956

At 6/6/05 04:39 PM, etchandsketchdesigns wrote: This is Amazing! that you so much!

You're a fucking thief. Don't post here, n00b.


None

Toast

Reply To Post Reply & Quote

Posted at: 7/2/05 01:27 PM

Toast DARK LEVEL 09

Sign-Up: 04/02/05

Posts: 8,907

At 7/2/05 01:24 PM, Rystic wrote:
At 6/6/05 04:39 PM, etchandsketchdesigns wrote: This is Amazing! that you so much!
You're a fucking thief. Don't post here, n00b.

Agreed!

The portal is flood with games that have no actionscript but this code.
Noobs think they can make a game without typing a single line of AS!


All times are Eastern Standard Time (GMT -5) | Current Time: 09:52 AM

<< Back

This topic is 13 pages long. [ 135 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 ]

<< < > >>
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!