• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

(Resolved) Room view following an object getting moved

E

Earth Traveler

Guest
So I've run into an issue with the views in the room I've been working on in GM 8.1. The room's current view has the following properties:

- Room Size: 3200 width x 1200 height
- View in Room: X: 0, Y: 300, W: 1600, H: 900
- Port on Screen: same as above
- Following object obj_character @ Hbor: 920, Vbor: 32, Hsp: 64, Vsp: 64

obj_character jumps at a speed of 96 and is subject to a gravity of 8. obj_character is also 256 pixels tall and the room contains a 48 pixel thick floor object.

The problem I've been running into is that whenever obj_character jumps, the whole screen shifts upward about 50 pixels after they land. This upward shifts gets worse, then better, until Vborder is set to a little under 300, at which point the effect stops happening.

I've tried adjusting most of the values - the view in room, port on screen, Hsp, Vsp; the room's height is definitely a factor: when it was 900 instead of 1200, this shift didn't happen. But I have no idea why that changed when the room's dimensions were altered, so any help?
 

Simon Gust

Member
To center the player, hbor and vbor should be exactly half the view size. If you dont want the view to change vertically you have to remove the view object and update the view manually.
 
E

Earth Traveler

Guest
Thank you for your advice! I was able to get roughly the effect I wanted by writing a script for obj_character to set the view.

Thank you for your help.
 

TheouAegis

Member
A vbor of 32 is way too small. It just means if the player is in the top 32, it moves up. So even if the player falls, it won't move down until he's in the lowest 32.
 
E

Earth Traveler

Guest
Yes, I moved it up to 300, and I'll probably move it up above that eventually. Thank you for replying.
 
Top