Monday, April 1, 2013

Camera Set and Input Coding Ahead

As I explained last week, I have been working on the camera set up this week. There were many things to consider when trying to implement the main camera set up. I needed to extract information from the actual level that we are dealing with so I know where the camera has to limit itself.
To do this, I edited the level files and added in invisible actors that were placed accordingly for my scripts to deal with. The positioning of these actors helps me identify the current level's dimensions and the center point of the level. Since I was only dealing with level one, there was going to be no panning of the camera because the entire level was small enough to encompass the entire screen.
So there's my decision logic right there:

if (current level is small enough)
{
      focus the camera on the center point of the level
}
else
{
      offset the camera to focus near the player
      set up panning within current level dimensions
}

Here's the camera set up thus far:

Main Camera in fixed position

Roll Camera following actor position

However, since the panning will be dealt with by the user dragging with his/her finger, then I need to address the input functionality with the device. My camera set up as is works well with the current level given its size, but once I dive into the input coding I should be able to add in the panning functionality to finalize the camera.

So I will be putting the camera coding to the side as I start on the input aspect of the coding. I'll be looking at the UDN documentation guide for mobile input as some of my members mentioned that it has some great information on setting up the input code for mobile devices. 
 

No comments:

Post a Comment