Skip to main content
gamedev.net
🔒 Locked

Initial camera offsets

Started by MikeKan13 Apr 3, 2011 at 11:31 PM 0 replies 1k views
Original Post
MikeKan13
MikeKan13
[color=#444444][font=verdana, geneva, lucida,]My game is a online rpg with pixel based movement. The world is composed of isometric blocks. ~

I need a formula for finding the clients starting xOffset and yOffset for the camera. For a tile based movement engine the offsets can always start at 0 because you will always be in the center of a tile. For me however the player can be anywhere on that tile. It is probably a simple solution I am just terrible at math logic. Here is some details:

Block width = 88
Block height = 44

The client has a chunk of the world loaded at a time[/font]
[color=#444444][font=verdana, geneva, lucida,]an area is 6600x3300 pixels

offset ranges would be:
xOffset would be from -44 to 43
yOffset would be from -22 to 21[/font]
[font="verdana, geneva, lucida,"][color="#444444"]
[/font]
Tiblanc
Tiblanc
The same formula you use to draw the sprite on the screen can be used to find the camera offset.
Developer for Novus Dawn : a [s]Flash[/s] Unity Isometric Tactical RPG - Forums - Facebook - DevLog

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.