ok this is the AS i have for my character...
---------
onClipEvent (load) {
gravity = 10;
maxJump = 2;
scale = _xscale;
walkSpeed = 7;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_xscale = -scale;
_x -= walkSpeed;
this.gotoAndStop(2);
}
if (Key.isDown(Key.RIGHT)) {
_xscale = +scale;
_x += walkSpeed;
this.gotoAndStop(2);
}
}
onClipEvent (enterFrame) {
if (air == true) {
this._y += gravity;
}
if (this.hitTest(_root.platforms)) {
air = false;
} else {
air = true;
}
if (air == false) {
jump = false;
}
if (jump == false) {
air = false;
}
if (air == false) {
jump = true;
jumpcount = 0;
jumpSpeed = 22;
}
if (Key.isDown(Key.UP)) {
jumpcount += 1;
}
if (Key.isDown(Key.UP) && jump == true) {
_y -= jumpSpeed;
this.gotoAndStop(3);
}
if (jumpcount>maxJump && jumpSpeed>-2) {
jumpSpeed -= 2;
}
}
onClipEvent (keyUp) {
this.gotoAndStop(1);
}
------this is the code i have for my ground
-----------
onClipEvent(load) {
active = false;
this._visible = false;
this.onEnterFrame = function(){
if (this.hitTest(_root.player)) {
active = true;
} else {
active = false;
}
if (active) {
xmin = getBounds(_root).xMin;
xmax = getBounds(_root).xMax;
ymin = getBounds(_root).yMin;
ymax = getBounds(_root).yMax;
pymax = _root.player.body.getBounds(_root).yMax;
px = _root.player._x;
if (px<xmax and px>xmin and pymax<ymax and pymax>ymin and _root.player.grav<=0) {
_root.player.jumping = false;
_root.player.grav = 0;
} else {
_root.player.jumping = true;
}
}
}
}
--------
when i put the movie clip on the game twice only one works.
when i put to line in the platform movieclip the lines are longer than they show.... they go across the whole screen.
someone please help me with this(preferibly denvish)