I am having an issue getting my Flash game (made using the Flixel library) to display when I use Zoom = 1 in the call to Super() in the game's constructor.
I have made a map using Dame which is 640x1280 pixels. In the constructor for the game's main class, I set the stage for the SWF to and the size of the screen that Flixel draws onto to both be 640X480:
package
{
import flash.display.Sprite;
import org.flixel.*;
[SWF(width="640",height="480",backgroundColor="#000000")]
public class Ascent extends FlxGame
{
public function Ascent()
{
/*set the size of the screen on which flixel will draw*/
super(640,480,PlayState,50,50);
forceDebugger = true;
}
}
}
Then, in the constructor for PlayState.as, I set the camera bounds to the size of the map, and set the camera to follow the player:
/*Set data for player*/
TheClimber = new BalloonHero()
TheClimber.x = FlxG.width/2-5,
TheClimber.y = 1210;
/*add player to the game*/
add(TheClimber);
/*Add camera and set it to follow The Climber*/
//This will automatically set the boundaries of the world.
FlxG.camera.setBounds(0,0,640,1280,true);
FlxG.camera.follow(TheClimber,FlxCamera.STYLE_PLATFORMER);
However, this only results in a black screen. Yet, when I change the Zoom to 2 using either:
super(640,480,PlayState, 2 ,50,50);
or
super(320,240,PlayState,2, 50,50);
Then the map and player appear, drawn on screen, and function how I would like. I understand why the two alternatives shown above work, but I do not understand why the first attempt, in which Zoom = 1 only results in a black screen. Thank you for your help,