Tag Info

New answers tagged

0

The trick is I think you misunderstood my original answer to your previous question. The camera's position should only be taken into account when drawing (using blit). You're offsetting all drawn objects in the screen by the camera's position. So two specific problems with the code you have shown: The blit that does use the camera position should subtract ...


0

This may, or may not, be the correct answer for you, BUT In your code, when you draw the platforms images to the screen, you add the camera's position to their x/y positions. This would not be necessary because you would then have problems with colliding, because your adding the cameras scroll to it so you wouldn't see them in their colliding positions. ...


0

Maybe i dont understand what you are trying to do, but the standard way to do this is to have a spot light as your flash light. In your case you would disable all lighting sources in the scene and set global ambient lighting to 0. This will make the scene pitch black where only the spot light attached to the player visible. For 2d you will need to add ...



Top 50 recent answers are included