Posted 24 January 2011 - 09:44 PM
So, this being my first game, it's pretty simple. Press right to move right, release to stop, repeat. The end. I have created a view that should follow the "player", as I don't want the player to be able to see the whole map, only what's right in front of him.
Now that's the problem. The player can't move left, so what's to the left of the main object is not important, and therefore I want it outside of the view.
The view is 300 pixels wide. I want the character to be located about 80 pixels in from the left border and stay in the same position as the object and the view travel right across the room. I tried using the Hbor thing in the Views tab, but it does not work the way I need it to.
I want it to look something like this:
I'd be unbelievably grateful if some kind spirit in here would guide me towards how to accomplish this.
Thanks in advance;
Posted 24 January 2011 - 09:50 PM
x = Player.x + 10 //change Player to the player's object name and 10 to whatever you wantwhat this does is actually very simple, it keeps the object a set distance away from the player, making it look as if the player is more left in the room.
When using d&d you can put the execute code action in there and put that code there
Posted 24 January 2011 - 09:51 PM
x = obj_player.x + (view_wview/2 - 80) // this will place the object so it is in the middle of the view with the player 80 pixels from the leftThen just set the view to follow this object and set the borders to half the views width and height.
The latter would take a minute for me to type out on my phone, so try the first one and if it doesn't work for you, ill help with this solution.
Edit: accidently put +80 when it should be -80
Edited by Canite, 24 January 2011 - 09:53 PM.
Posted 24 January 2011 - 10:01 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users