Nathan Laing
Member
Greetings all!
Currently (successfully) scrolling two tile-repeated starfield backgrounds (#0 far, #1 closer) only as and when the view moves (is panned by the player). However, a 3rd 'entity' -- a planet -- and this is not a background but a sprite, is located at fixed coordinates within the room.
I am stumped as to how I could achieve the effect of this planet scrolling with the view, at a "slower rate" than the screen scrolls---when the screen is being scrolling/panned by the player.
// Background #0 - furthest away
// Background #1 - closer
// Entity #3 -- Planet handling - stumped!
Currently (successfully) scrolling two tile-repeated starfield backgrounds (#0 far, #1 closer) only as and when the view moves (is panned by the player). However, a 3rd 'entity' -- a planet -- and this is not a background but a sprite, is located at fixed coordinates within the room.
I am stumped as to how I could achieve the effect of this planet scrolling with the view, at a "slower rate" than the screen scrolls---when the screen is being scrolling/panned by the player.
// Background #0 - furthest away
Code:
background_x[0] = view_xview[0] * 0.92;
background_y[0] = view_yview[0] * 0.92;
Code:
background_x[1] = view_xview[0] * 0.91;
background_y[1] = view_yview[0] * 0.91;
Code:
draw_sprite_ext(spr_planet, 0, 16000 , 9000, 1, 1, 0, c_white, 1);
Last edited: