• 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!

Legacy GM Object moving slowly with the player but staying in view

B

Bernard Polman

Guest
I created a sun object that moves slowly when the player is moving, in opposite direction. The problem is that I can't see the sun in the view when I run the game. Here is the code.

Code:
Create Event:

image_speed=0.15

Draw Event:

draw_sprite_ext(sprite_index,image_index,view_xview[view_current]/1.15+600,view_yview[view_current]/1.5+60,image_xscale,image_yscale,0,c_white,1)
Room view settings: http://prntscr.com/btch2l
 

jo-thijs

Member
Well, this: view_xview[view_current]/1.15+600
is in range iff: view_xview < view_xview / 1.15 + 600 < view_xview + 640
iff: 0 < view_xview * (-3 / 23) + 600 < 640
iff: -920 / 3 < view_xview < 6900

And this: view_yview[view_current]/1.5+60
is in range iff: view_yview < view_yview / 1.5 + 60 < view_yview + 360
iff: 0 < view_yview * (-1 / 3) + 60 < 360
iff: -900 < view_yview < 180

If those conditions are met, the problem lies somewhere else and you should provide more information.
 
Top