Author Topic: Keeping sprite in view  (Read 1433 times)

Goowolgo

  • Regular
  • **
  • Posts: 21
    • AOL Instant Messenger - CaseyAAdams
    • View Profile
    • Facebook
    • Email
Keeping sprite in view
« on: 2008-01-21, 11:47:06 AM »
How would I keep the sprite relatively in the center of the screen? I think this is pretty much necessary when you make a platform/jumping game. I know the scroll sprite into view, but that still lets the player get to the edge of the window, and I can't see where I want to jump to.

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: Keeping sprite in view
« Reply #1 on: 2008-01-21, 01:36:28 PM »
you just need to set the scrollmargins. these are found at the map properties. you could calculate how much you need, when you divide your display width through 2 and subtract the half of your player width. minus a few more pixels for more space around. or so. you can try some values. if strange picture errors occur, you have to choose lower values.
but this is also mentioned in a tut, i think.