Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am new to game development and i want to use silverlight for it. First of all i want to learn the logic of player centered gameplay. Something like this;

Player character moves in large scaled map but player can see only the viewport (centered on player) like on 3000x3000 px map with 400x400 viewport

what do i need to achive this? Is there a code example or any bookthat contains this? Do i need to use a map generator? (so when player moves it replaces titles according to matrix text file etc)

Thanks.

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

There are several points you should take care of while implementing a game using Silverlight:

  1. Silverlight is not a game engine, nor it is a technology primarily targeting game development (like XNA, for example). You will need to implement more things on your own. the most classical example here is the implementation of the game loop -- it is possible in Silverlight using Dispatcher and Timer, but this can be tricky (due to multi-threading etc). Just google for "Silverlight Game Loop", there are plenty of good tutorials on that topic.

  2. I would generally recommend to read some gamedev tutorial for Silverlight. You will find a plenty of links in this thread. Especially this link to a Silverlight platform tutorial and starter kit (ported from XNA) can be helpful for you.

  3. And now to your question! :) You will probably need to use the ScrollViewer component from Silverlight core components and manipulate the ViewPort properties to reach the scrolling and centering in your application. Just google for "sliding with ScrollViewer" and you'll find many ways how to implement this behaviour.

share|improve this answer
    
These points are fairly obsolete with the releast of Silverlight 5, which has an XNA-like interface and a 3D engine that may work very well for gaming. –  Jeremy Likness Dec 13 '11 at 21:51
    
@JeremyLikness: I don't see what points have become obsolete with SL5. I haven't worked with it yet (it is just released), maybe I missed something? –  Alexander Galkin Dec 13 '11 at 21:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.