Re-position camera starting point


#1

Hi, I am trying to create a vertical space shooter where I have a tile map which is starting from the bottom of the map and scrolling to the top.

When I try to do this I get a error as the map attempts to load from the top of the screen and the player is on the bottom, is there a way to change this and how?


(Thorbjørn Lindeijer) #2

What error would that be? Also, this error is likely not a Tiled error, but an error raised by whatever library or framework you’re using? Which one is it?


#3

vector is out of range, I’m using SDL, but all I’m doing is having the player spawn from the bottom of the level in the tile map, the player draws it origin from the tile map.
When I attempt to run, the game attempts to start from the top/end of the level.


(Thorbjørn Lindeijer) #4

There is no tile map support in SDL. What code are you using to load and render the map?

Also, “vector is out of range” error is too generic to help you with. It is a problem in your game or the library you’re using.


#5

I’m coding in C++ using SDL framework, the code calls the values from tiled to load the map and then renders based on those values.

The map is created via tiled, if the player spawns at the top of the level the game works fine, but the player is spawning at the end of the level.

I need the player to load from the bottom of the level, where it is positioned, but when I place the player there in tiled it breaks the game.


(Thorbjørn Lindeijer) #6

It means you need to fix something in your game. I don’t know how you expect somebody here to help you with that if you don’t show your code.