

x ) ) - >str ( ) ĬameraPosY = static_cast ( & (ostringstream ( ) GetPosition ( ). If (DEBUG ) //Display the camera and mouse co-ordinates in the bottom left corner of the screenĬameraPosX = static_cast ( & (ostringstream ( ) GetPosition ( ).

Tile - >Draw ( (x * tileSize ) - camOffsetX, (y * tileSize ) - camOffsetY, window ) we've drawn (x and y), and which tile on the map we're drawing (tileXįor ( int y = 0, tileY = bounds. We're keeping track of two variables in each loop. loadFromFile ( "background.png" ) īackgroundSprite. Draw the background so the map edges don't glitchīackgroundTexture. x ĬamOffsetY = camera - >GetTileOffset (tileSize ). Figure out how much to offset each tileĬamOffsetX = camera - >GetTileOffset (tileSize ). Sf :: IntRect bounds = camera - >GetTileBounds (tileSize ) y ) ĬurrentLevel - >LoadLevel ( "shipList.xml", imageManager ) y, - 1 ) Ĭamera - >MoveCenter (player - >playerPos. Sf :: Listener :: setPosition (player - >playerPos. LoadPlayer ( "player.png" ) ) ĬollisionSound = new SoundEffect ( "knock.wav" ) Player = new Player ( 4 * tileSize, 1 * tileSize, imageManager. Set up the player object, position the camera and listener and create any sound effects needed.

Throw "Could not create camera position text!" y, 1 ) ĬameraPos = new TextOutput ( "swansea.ttf", 30 ) Set up the camera and associated debug output.Ĭamera = new Camera (videoSize. Throw "Could not create mouse position text!" MousePos = new TextOutput ( "swansea.ttf", 30 ) Window = new sf :: RenderWindow (sf :: VideoMode (videoSize. Set up the main window and associated debug output. Memory leak detection with Visual Leak DetectorĮngine :: Engine ( int w, int h, int tileSize )
