Sunday, September 11, 2011

Camera and learning from code

I've been studying some source code from some examples and this had helped me on creating a simple 2D Camera that can either be moved by updating it and feeding it positions or by letting it automatically follow the position of a game object (by using a overloaded Update method that receives a Vector2 as a parameter).
It also has zoom and rotation, but I can't really rotate or zoom in/out on a specific point yet.

The code for it is a static class that I can reuse in my games and keep on improving whenever I get a new idea for it. Very handy.

I've implemented it in the core of the RPG I'm making and it seems to do quite well:

Zoomed in
Overview of the Kingdom Of Red Lines

(That sprite I'm using there is borrowed from RPG Maker VX by the way, and I use it only for prototyping, I still have to draw one if the prototype works.)

I'm thinking about either making a platformer or a tower defense game now to get a little better hopefully. Although this is a step in the right direction for the RPG, I still feel like I don't know enough yet to create everything that is needed for a fun RPG.

EDIT: I've also made a small video too:

No comments:

Post a Comment