Header

Header

Thursday, 30 October 2014

ACSS InfoTech 2014-15 Day: 25

So today, I was able to a way to adjust the camera views in the game. Rather than showing the whole room, this feature focuses and follows the main sprite where ever it goes. I figured this would be a useful tool to implement to our game, especially since it is an RPG. Basically, to get this to work, the settings of the room had to be adjusted by setting the "View In Room" options to 640x480 (rather than the default settings of 1024x768). The next thing I discovered was a very useful tool under the room settings called "Object Following". By the looks of it, I knew this was exactly what I needed in order for this camera view feature to work.

Now since I was able to create a camera view that followed the main sprite where ever it went, I came across another problem in which the mute button is no where to be found. This is because the mute button was actually in a fixed position. Since the camera is always moving, the mute button appears once the object reaches the edge of the room. Upon a bit of researching, I was able to create this script for the mute button:
x = view_xview[0] + view_wview[0] - sprite_width - 15;
y = view_yview[0] + view_hview[0] - sprite_height - 5;

Now where ever the camera follows the mute button will always be accessible. I actually was glad I found this issue early on before I started adding on more rooms, scripts, etc.







No comments:

Post a Comment