erm, that code is wrong for the horizontal thingie I gave you.
use this for verticle of a moving range of 0 to 255, and a variable range from 0 to 255:
- Code: Select all
xscreen = what-you-want-it-to-be;
if(yscreen < 25)yscreen = 25;
if(yscreen > 280)yscreen = 280;
kruva.r = yscreen - 25;
use this for a verticle moving range of 0 to 100, and a variable range from 0 to 255:
- Code: Select all
xscreen = what-you-want-it-to-be;
if(yscreen < 25)yscreen = 25;
if(yscreen > 280)yscreen = 280;
kruva.r = (yscreen*2.5) - 25;
I hope that helps,
here is a version of it where you can change one variable on the create actor event to a different number to change location without modifying your code, first you must make a variable called MIN_YSCREEN and one called XSCR_POS, then use this here,
draw actor event:
- Code: Select all
xscreen = XSCR_POS;
if(yscreen < MIN_YSCREEN)yscreen = MIN_YSCREEN;
if(yscreen > MIN_YSCREEN + 100)yscreen = MIN_YSCREEN + 100;
kruva.r = (yscreen*2.5) - MIN_YSCREEN;
and here is for create actor event:
- Code: Select all
XSCR_POS = what-you-want-it-to-be;
MIN_YSCREEN = what-you-want-the-minimum-yscreen-limit-to-be;
I hope that helps.
EDIT: you said max left and max right
and you also said verticle...?
so I just gave you the verticle code,
you can change it around to make it horizontal.