A
A. DeVivo
Guest
Hey all!
First time posting! Fairly new to GM2 but learning. In order to create depth on an island level, I'd like the horizon level of the ocean background layer to somewhat follow the player/ be fixed to the camera as the player/camera descend the y axis. I've been toying with lerp to do this, with the code
however, this only makes it track a little bit. When I try to increase the last variable (.3 in the example code), I get a crazy shadowing multiplying effect that ain't great.
So what I'm wondering is how to (a) make the horizon following my player (ideally increasing/decreasing slightly depending on the y value, but generally tracking the player) and (b) how do I then stop the horizon from tracking the player once it is above a certain y axis (because it wouldn't make sense for the ocean to follow the player up to the top of the mountain).
I've provided some pictures to illustrate what I'm looking for. I'm currently toying with using both a tile background and one solid sprite that is smaller than the x/y of the room, so I'm flexible. I could also separate the ocean and sky into two separate sprites if necessary. This may be a bit out of my skillset at the moment, so I'd love some help. Particularly since there isn't a ton of information abt this for GM2. Thank you!!
First time posting! Fairly new to GM2 but learning. In order to create depth on an island level, I'd like the horizon level of the ocean background layer to somewhat follow the player/ be fixed to the camera as the player/camera descend the y axis. I've been toying with lerp to do this, with the code
Code:
var layer_id1 = layer_get_id("Background_0")
layer_y(layer_id1, lerp(0,camera_get_view_y(view_camera[0]),.3));
So what I'm wondering is how to (a) make the horizon following my player (ideally increasing/decreasing slightly depending on the y value, but generally tracking the player) and (b) how do I then stop the horizon from tracking the player once it is above a certain y axis (because it wouldn't make sense for the ocean to follow the player up to the top of the mountain).
I've provided some pictures to illustrate what I'm looking for. I'm currently toying with using both a tile background and one solid sprite that is smaller than the x/y of the room, so I'm flexible. I could also separate the ocean and sky into two separate sprites if necessary. This may be a bit out of my skillset at the moment, so I'd love some help. Particularly since there isn't a ton of information abt this for GM2. Thank you!!
Last edited by a moderator: