08-07-2012, 03:08 PM
I think he shouldn't jumpittyjump when you keep the button pushed.
The first room with white walls was a bit glitchy, I kept jumping against the black part but it would work randomly rather than as expected.
Inmidst room three or four, I was magically thrown back to an intro screen.
I'll just drop my usual preloader code here in case it could help you?
The first room with white walls was a bit glitchy, I kept jumping against the black part but it would work randomly rather than as expected.
Inmidst room three or four, I was magically thrown back to an intro screen.
I'll just drop my usual preloader code here in case it could help you?
Code:
stop(); // important. Prevents the game from startinjg before loading.
addEventListener(Event.ENTER_FRAME, loading); // tell flash that we want to call that function every time
function loading(e:Event):void
{
var total:Number = this.stage.loaderInfo.bytesTotal; // total size of the flash
var loaded:Number = this.stage.loaderInfo.bytesLoaded; // loaded part
if (total <= 0) {
total = 1; // prevents a divide-by-zero INFINITY error
}
// I have a loading bar movieclip that's basically a rectangle which I scale here.
bar_mc.scaleX = loaded/total;
// also some text thingies to display the loaded bytes and percentage
txt_percent.text = Math.floor((loaded/total)*100)+ "%";
txt_bytes.text = Math.floor(loaded / 1000) + "/" + Math.floor(total / 1000) + " KB";
if (total <= loaded){
gotoAndStop(2); // go to next frame (actual game)
// you could also enable a "START" button here instead.
removeEventListener(Event.ENTER_FRAME, loading); // we don't need that any longer!
}
}