No, Mx ed.
not a bad idea i guess!!
and btw what about scrolling? i’m losing my patience… just kidding!!! i have always wanted to create a game like mario, and with ur help and some free time i maybe will!! goota go now but will be checking for the scrolling tut!!
Sorry about the scrolling! I am very busy… School, Fencing, Piano, Spanish, Flash Projects,… blah.
Now for the scrolling! This is our final step in the art based platform tutorial! Ok, First of all, we need the code to go where? The “Char”, or “mario” in this case. So, we select mario and open his actions panel. Please type the following:
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
if (_root.mario._x>=300 //or whatever you decide to set for his positions//) {
scroll = 5;
//setting his scrolling speed//
xspeed = 0;
//ceasing his movement//
this._x += 5;
_root._x -= scroll;
_root.score._x += scroll;
//notice "this", and "score", have different _x movement than "_root", that is because we dont want to make mario and the score scroll left and right :P//
} else {
xspeed = 5;
}
} else if (Key.isDown(Key.LEFT)) {
if (_root.mario._x<=100 //or whatever you decide to set for his positions//) {
scroll = 5;
xspeed = 0;
this._x -= 5;
_root._x += scroll;
_root.score._x -= scroll;
} else {
xspeed = 5;
}
}
}
This is the code that I recently came up with, and I hope that it help you :). If you have any questions, remember, I’m just a click away! Later!
peace.
I dont get it… how do I add the scrolling script to my mario’s script
onClipEvent (load) {
gravity = 10;
scale = _xscale;
walkSpeed = 6;
maxjump = 6;
}
onClipEvent (enterFrame) {
if (air == true) {
_y += gravity;
state = 6;
}
if (Key.isDown(Key.LEFT) && !_root.leftbound.hitTest(_x, _y, true)) {
_x -= walkSpeed;
_xscale = -scale;
}
if (Key.isDown(Key.RIGHT) && !_root.rightbound.hitTest(_x, _y, true)) {
_x += walkSpeed;
_xscale = scale;
}
if (_root.platforms.hitTest(_x, _y, true)) {
air = false;
} else {
air = true;
}
if (Key.isDown(Key.SPACE) && jump == true) {
_y -= jumpSpeed;
}
if (air == false) {
jump = true;
jumpcount = 0;
jumpSpeed = 19;
}
if (Key.isDown(Key.SPACE)) {
jumpcount += 1;
}
if (jumpcount> maxjump && jumpSpeed> -2) {
jumpSpeed -= 2;
}
if (air == false && !Key.isDown(Key.LEFT) && !Key.isDown(65) && _currentframe <4 or air == false && !Key.isDown(Key.RIGHT) && !Key.isDown(65) && _currentframe <4) {
state = 1;
}
if (Key.isDown(Key.LEFT) && air == false && !Key.isDown(65) && _currentframe <4 or Key.isDown(Key.RIGHT) && air == false && !Key.isDown(65) && _currentframe <4) {
state = 2;
}
if (!Key.isDown(65)) {
gotoAndStop(state);
}
_root.statetxt = state;
}
onClipEvent (keyUp) {
if (Key.getCode() == 83) {
jump = false;
}
}
Well, you add the code right after the:
onClipEvent (keyUp) {
if (Key.getCode() == 83) {
jump = false;
}
}
i wont work it just stats looping jump
Hmm, that’s iteresting… could you show me how you are using the code please?
As to the previous question…
If any of you remember “Faxanadu” for the NES, I’m making a flash clone called “NeoFax”, It’s hard stuff… The game is tilebased and a sidescroller so i thought we could learn a few things.
I dont know the first thing about tile based.
How far along r u in making the neofax game? or haven’t u started yet?
It’s essentially conceptual, I ran into too many problems tring to construct a working version of Neofax
It’s essentially conceptual, I ran into too many problems tring to construct a working version of Neofax
but u at least started it? and u want to make it a side scroller with a tile base, ok does this game jump cause that immediately means i can’t tell u how to do it.
I’m thinking that i should make a basic tile based side scroller like mario, and just hand people the source for it, then they can sort of see what to do and at least they’ll have a start. but i’ll have to do it probably when my exams are finished, and thats about a month away.
PS sorry for stealing jomans mario tute
Sorry to revive this thread (even though it is good), but i remembered someone asking about a side scrolling mario with tiles, and i had a spare 10 mins so here it is, just taken different bits of code from all tonypas and hold shift to make him faster
thanx … for the tile scroll