Scrolling problem

Started by McTroopers, Sun 11/05/2008 18:51:52

Previous topic - Next topic

McTroopers

Hi everybody
I have a problem with scrolling screens.. I want the player to stay near the bottom of the screen, but I'm not able to...I used the setviewport function in the repeatedly_execute section of the room screen,

setviewport(player.x-160,player.y-180);

this way the character is where I want, but it flickers a lot everytime he moves...Do you know a best way in order to prevent the character from flickering?
Thank you

RetroJay

Hi McTroopers.

I assume that your character is only able to walk along the bottom part of the screen?
If so have you created a walkable area along the bottom of the game room (where he can walk) and in the "Character tab" placed him/her at
X and Y cords so as your character is within this walkable area?

When your character then walks left or right the screen should just scroll without any probs.
Hope this helps.
Jay.

Khris

In General settings, under Character movement, turn off Anti-glide mode.

RetroJay

Yeah.... You could do what Khris said. That will probably sort the problem. ;)

Damn!!
I thought I was actually going to be able to help someone for a change.
Alas this however is not the case. ;D

McTroopers

Thanks a lot...I turned the anti-glide off and everything was ok...
But at the end I've found an alternative way without having to change the anti-glide setting, it counts the number of frames after every frame change, in order to scroll in the same cycle when the new frame is drawn...I post it in the case somebody can find it useful

int counter=0;
int oldframe=0;
//In the repeatedly_execute function
{
if (oldframe!=player.frame) counter=0;
counter++;
if (counter==X/*the number of cycles necessary to change the displayed frame*/)
  setviewport(player.x-160,player.y-180);
oldframe=player.frame
}

SMF spam blocked by CleanTalk