Hi im using this cool platform game engine from
http://www.gotoandplay.it/_articles/2003/12/scrolling_upd.php
(fla available there)
but what i want is when you press up to jump ,the sprite wont move at all however the ground will move down
here is my failed attempt
http://www.mn001c7645.pwp.blueyonder.co.uk/game2.html
dude sorry i dun know ur answer but i have a question for u…
wat did u put for the part of the script which says
herow = _root.hero._width/2;
i dun really understand wat that meens… wat u put for it,
hmm i dont think i touched that
here is my modified AS
//
//
// This open source fla was created by leighton at [www.leightfgc.com](http://www.leightfgc.com/)
//
//
// ----------------------------------------------------------------------------------------------------------------- Misc
stagewidth = 350;
// ----------------------------------------------------------------------------------------------------------------- hero
hero = _root.hero;
herow = _root.hero._width/2;
xSpeed = 3;
buffer = 5;
blah = 22;
dir = "right";
// ------------------------------------------------------------------------------------------------------------ Platform
platform = _root.platform;
_root.platform._visible = false;
// ----------------------------------------------------------------------------------------------------------- Jumping
jumpAmount = 21;
velY = 0;
maxVelY = jumpAmount*-1;
jump = false;
// ----------------------------------------------------------------------------------------------------------- Scrolling
function scrolling() {
platform._y = tiles._y;
for (i=1; i<3; i++) {
if (tiles.t1._currentframe == i) {
platform._x = tiles._x-(stageWidth*(i-1));
}
}
}
// -------------------------------------------------------------------------------------------------------------- Reset
function heroReset() {
for (i=0; i<5; i += 0.5) {
if (platform.hitTest(hero._x, hero._y-2, true)) {
hero._y--;
}
}
}
// ----------------------------------------------------------------------------------------------------------- hero Hit
function stopTheHero() {
for (i=0; i<1; i+= 0.5) {
if (Key.isDown(Key.LEFT)) {
if (platform.hitTest(hero._x-(heroW-blah), hero._y-buffer, true)) {
hero._x += xSpeed;
}
if (jump) {
if (platform.hitTest(hero._x-(heroW-blah), hero._y-buffer, true)) {
hero._x += xSpeed;
}
}
}
if (Key.isDown(Key.RIGHT)) {
if (platform.hitTest(hero._x+(heroW-blah), hero._y-buffer, true)) {
hero._x -= xSpeed;
}
if (jump) {
if (platform.hitTest(hero._x-(heroW-blah), hero._y-buffer, true)) {
hero._x -= xSpeed;
}
}
}
}
}
// ------------------------------------------------------------------------------------------------------- EnterFrame
this.onEnterFrame = function() {
// ---------------------------------------------------------------------------------------------------- slope down
if (platform.hitTest(hero._x, hero._y+buffer, true)) {
hero._y++;
}
// -------------------------------------------------------------------------------------------------- hero hitTests
stopTheHero();
// -------------------------------------------------------------------------------------------------------- Jumping
if (platform.hitTest(hero._x-((heroW-blah)-5), hero._y, true) || platform.hitTest(hero._x, hero._y, true) || platform.hitTest(hero._x+((heroW-blah)-5), hero._y, true)) {
jump = false;
velY = 0;
} else {
jump = true;
}
if (!jump) {
if (Key.isDown(Key.UP)) {
jump = true;
velY = jumpAmount;
} else {
jump = false;
}
}
if (jump) {
tiles._y += vely--;
platform._y += vely--;
}
if (velY<=maxVelY) {
tiles._y=tiles._y
platform._y=platform._y
}
// --------------------------------------------------------------------------------------------- hero movement
if (dir == "right") {
if (!jump) {
if (Key.isDown(Key.RIGHT)) {
if (!Key.isDown(Key.LEFT)) {
hero._x += xspeed;
hero.gotoAndStop("walkRight");
}
} else {
hero.gotoAndStop("stillRight");
if (Key.isDown(Key.LEFT)) {
dir = "left";
}
}
} else {
hero.gotoAndStop("jumpRight");
if (jump) {
if (Key.isDown(Key.RIGHT)) {
hero._x += xspeed;
}
}
}
}
if (dir == "left") {
if (!jump) {
if (Key.isDown(Key.LEFT)) {
if (!Key.isDown(Key.RIGHT)) {
hero._x -= xSpeed;
hero.gotoAndStop("walkLeft");
}
} else {
hero.gotoAndStop("stillLeft");
if (Key.isDown(Key.RIGHT)) {
dir = "right";
}
}
} else {
hero.gotoAndStop("jumpLeft");
if (jump) {
if (Key.isDown(Key.LEFT)) {
hero._x -= xspeed;
}
}
}
}
if (hero._x-heroW<0) {
hero._x = heroW;
} else if (hero._x+heroW>stagewidth) {
hero._x = stagewidth-heroW;
}
// -------------------------------------------------------------------------------------------------------- scrolling
if (hero._x>200) {
if (tiles._x != -stageWidth) {
if (platform._x>=-(platform._width-stageWidth-xSpeed)) {
hero._x = 200;
tiles._x -= xSpeed;
scrolling();
if (tiles._x<=-stageWidth) {
if (tiles.t1._currentframe<TILES.T1._TOTALFRAMES) p {<> tiles.t1.nextFrame();
tiles.t2.nextFrame();
tiles._x = 0;
}
}
}
}
}
if (hero._x<150) {
if (tiles._x != 0) {
if (platform._x<=0) {
hero._x = 150;
tiles._x += xSpeed;
scrolling();
if (tiles._x>=0) {
if (tiles.t1._currentframe>1) {
tiles.t1.prevFrame();
tiles.t2.prevFrame();
tiles._x = -stageWidth;
}
}
}
}
}
// ----------------------------------------------------------------------------------------------------- hero reset
heroReset();
};
i think this is all i changed
if (jump) {
tiles._y += vely–;
platform._y += vely–;
}
if (velY<=maxVelY) {
tiles._y=tiles._y
platform._y=platform._y
}
and
jumpAmount = 21;
velY = 0;
maxVelY = jumpAmount*-1;
jump = false;
yo dude with that script u cant like create like things that float in the air eh…
the guy walks right through em
float in the air? what are you tralking about
i want it so when the up key is pressed the floor moves down then eases back up
i have almost done it but it (see my example) doesnt work 100% ,the floor doesnt come up all the way
Why dont u ask leight? He’s over on flashkit.com, he’s a nice guy and im sure he would help u out. Also remember to credit him if u end up finishing the game, its nice to credit people ^.^
ah ok been looking for his emailaddress but it wasnt on any of the sites with his work
cheers
sweet
man i hate flashkit…
im in “queue” for there moderators so i cant even talk to leight… bah
if anyone know her email please tell me
“queue”? :h:
ya i created account… clicked activation… and then it does that
Personally, I didnt like flashkit all that much either. I dunno why, I just didnt.
hmmm i signed up and talked to him/her right away
A queue is a line, same thing.
i would ask him for u but my stupid MSN isnt working. And flashkit is one of the best sites on the web, why wouldnt u like it?
a queue is a line of people
He means, there is no handling for the top of the character hitting the bottom of a wall. You can’t make overhangs or floating platforms that work right with the current script.