Bloodbane
Well-known member
Alright, some people has requested this so I'll share what I know about it.
This is example of entity which produces autoscrolling effect:
When this entity is spawned on level, the first thing it does is stop camera scrolling. This is to nullify player's control to camera.
Then in its IDLE animation, it moves screen slowly with speed : 2 pixels / 5 centiseconds (see same colored numbers above)
Modify these values in script above to change speed.
At end of level (right side if it autoscrolls right or left side if it autoscrolls left), it will stop, removes itself and returns cameracontrol back to player(s).
It has 2 modes defined by its facing direction:
Autoscroll right
ScreenMover is facing right
Autoscroll left
ScreenMover is facing left
Known issues:
Autoscroll != Autodrag
If player is left behind because of this effect, it won't drag nor pull player inscreen
This is example of entity which produces autoscrolling effect:
name ScreenMover
type none
anim spawn
@script
if(frame==1){
changelevelproperty("scrollspeed", 0);
}
@end_script
delay 5
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim idle
@script
void self = getlocalvar("self");
int Dir = getentityproperty(self, "direction");
int XPos = openborvariant("xpos");
int Width = openborvariant("levelwidth");
int Screen = openborvariant("hResolution");
if(Dir==1){
if(XPos < Width-Screen && Dir==1){
changeopenborvariant("xpos", XPos+2);
} else {
changelevelproperty("scrollspeed", 2);
killentity(self);
}
} else if(Dir==0){
if(XPos > 0){
changeopenborvariant("xpos", XPos-2);
} else {
changelevelproperty("scrollspeed", 2);
killentity(self);
}
}
@end_script
loop 1
delay 5
offset 1 1
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
When this entity is spawned on level, the first thing it does is stop camera scrolling. This is to nullify player's control to camera.
Then in its IDLE animation, it moves screen slowly with speed : 2 pixels / 5 centiseconds (see same colored numbers above)
Modify these values in script above to change speed.
At end of level (right side if it autoscrolls right or left side if it autoscrolls left), it will stop, removes itself and returns cameracontrol back to player(s).
It has 2 modes defined by its facing direction:
Autoscroll right
spawn ScreenMover
flip 1
coords 100 190
at 0
ScreenMover is facing right
Autoscroll left
spawn ScreenMover
coords 100 190
at 0
ScreenMover is facing left
Known issues:
Autoscroll != Autodrag
If player is left behind because of this effect, it won't drag nor pull player inscreen