Ok I am making a 2d top down space game, where you ship is fixed at the center of the screen, and you fly around the game world.
presently, I have used
where x and y are your ship's x and y. I have done this to keep your ship drawn in the center of the screen so it can move about the game world.
otherwise without that, the ship flies off the edge of the screen.
so what I want to know is, is this the correct way to have enabled flying / being in the gameworld? or will this cause me problems later on and do I need to make some sort of scrolling background engine thing.
i experimented originally with creating a viewport, and as the ship moved, moving the viewport whilst keeping the ship at the centre, so the viewport would basically be = to the current width.height of the screen and there fore your ship would never get clipped for flying off the side, because the viewport like a camera moves over the ship to keep it in view, or to keep drawing the area of the gameworld you are in.
also if setorigin is not supposed to be used in this way, what was it meant for?
was I clear in my explanation or do I need to try again
presently, I have used
setorigin (graphicswidth()/2 - x , graphicsheight()/2 - y )
where x and y are your ship's x and y. I have done this to keep your ship drawn in the center of the screen so it can move about the game world.
otherwise without that, the ship flies off the edge of the screen.
so what I want to know is, is this the correct way to have enabled flying / being in the gameworld? or will this cause me problems later on and do I need to make some sort of scrolling background engine thing.
i experimented originally with creating a viewport, and as the ship moved, moving the viewport whilst keeping the ship at the centre, so the viewport would basically be = to the current width.height of the screen and there fore your ship would never get clipped for flying off the side, because the viewport like a camera moves over the ship to keep it in view, or to keep drawing the area of the gameworld you are in.
also if setorigin is not supposed to be used in this way, what was it meant for?
was I clear in my explanation or do I need to try again