Ok so the issue I’m having is that I can’t get the gravity working for this sprite. I tried attaching the script I have but I’ll post it here too,
package
{
import flash.display.MovieClip
import flash.events.Event
import flash.events.KeyboardEvent
public class DocumentMain extends MovieClip
{
public var _startMarker:StartMarker;
public var _player:Player;
public var _platform:Platform;
private var _vx:Number;
private var _vy:Number;
public function DocumentMain() :void
{
// assign default values
_startMarker.visible = false;
_vx = 0;
_vy = 0;
// set focus for keyboard input
stage.focus = stage;
// add event listeners
this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
private function enterFrameHandler(e:Event):void
{
// gravitate the player
_vy += 2;
// move the player
_player.x += _vx;
_player.y += _vy;
// process collisions
processCollisions();
// scroll the stage
scrollStage();
}
private function keyDownHandler(e:KeyboardEvent):void
{
}
private function keyUpHandler(e:KeyboardEvent):void
{
}
private function processCollisions():void
{
}
private function scrollStage():void
{
}
}
}
Thanks!