Some things I dont want to scroll but to stay on screen

Started by MisterN, August 19, 2011, 04:45:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MisterN

For example, I have a level border system specifically for the player. its 32 pixels past the on screen border (so i have room for the level changers and stuff) and I can get it to appear on screen and work but. when i move (scroll), it doesnt scroll. if i dont have ctype = c_scroll or ctype = c_screen (does that even work, i got the same thing as c_scroll), it wont appear but it will work, it does not "move" with the screen, it stays at its designated on screen spot of 160x120 (so if i go past pixel 320 for example, i die). I want it so it moves with the screen easily. I dont want a mile of code. any ideas?
werg

josebita


tmoney


MisterN

werg

tmoney

correction:

ctype= c_scroll;
x= (scroll[0].x0 + 32)*resolution;

MisterN

does not work, when my player moves right i can still see it just standing there.
when I spawn the player I do this
//Starts the Player
scroll[0].camera=Player(50,193);

when I make the scoller (which is after everything) I have this
start_scroll(0,0,34,37,0,0);
heres the code for the levelborder
PROCESS levelborder();
begin
ctype = c_scroll;
x = (scroll[0].x0 + 32)*resolution;
y = 120;
graph = 39;
loop
frame;
end
end
werg

tmoney

the code needs to be placed inside the loop.  scroll[0].x0 is the left edge of the screen, and that value changes so your levelboarder process needs to check that value every frame. you can leave the ctype=c_scroll; outside of the loop though.

MisterN

doesnt work i put it inside the frame like this
PROCESS levelborder();
begin
ctype = c_scroll;
graph = 39;
loop
x = (scroll[0].x0 + 32)*resolution;
frame;
end
end


my game is set to this
Set_mode(320,240,16);
    Set_fps(20,0);
werg

josebita

#8
If it's not asking for too much, could you post your whole source code (possibly with resources) so that we can have a look at it ourselves?

PS: Otherwise get the real location of the process with get_real_point() and print it with say to make sure the process is currently in the right position onscreen (i.e: inside your set_mode'd resolution).

tmoney

ahhh... the problem is that the resolution is 0.  if you're going to keep your resolution at 0, just get rid of the *resolution part.  i always keep my processes at resolution 100.  also you're going to want to  make sure your levelborder process is running after your player process, other wise it will lag behind every frame.