name ElevBack
type none
setlayer -10
antigravity 100
anim idle
@script
void self = getlocalvar("self");
int Vy = getindexedvar(0);
changeentityproperty(self, "velocity", 0, 0, Vy);
@end_script
loop 1
delay 1
offset 192 0
frame data/bgs/elevator/elevator.png
frame data/bgs/elevator/elevator.png
spawn ElevBack # the background to move
flip 1
coords 192 240 2500
at 0
spawn delay
health 20 # wait for 2 seconds before moving
coords 160 240
at 0
group 1 1
at 0
spawn delay
@script
void main()
{
setindexedvar(0, -1); // background move with -1 pixels / centiseconds speed
}
@end_script
health 110 # move for 11 seconds
coords 160 240
at 0
spawn delay
@script
void main()
{
setindexedvar(0, 0); // stop the background
}
@end_script
health 20 # 2 seconds wait
coords 160 240
at 0
# these groups are for controlling spawned enemies
group 3 3 # example
at 0
# spawned enemies here
group 1 1
at 0
spawn delay
health 20
coords 160 240
at 0
Bloodbane said:However, it turns out the gates above aren't low enough OR the ceiling isn't high enough causing background (black backgorund that is) to be shown
And it was a smart decisionOh yes, I chose to use indexed variable for this purpose
I'd recommend it to anyone who is bothered with the classic direction bug.
name delay
health 10
type enemy
nomove 1
antigravity 100
offscreenkill 3000
anim idle
@script
void self = getlocalvar("self");
int Health = getentityproperty(self, "health");
if(frame==1){
changeentityproperty(self, "health", Health-1);
if(Health <= 0){
killentity(self);
}
}
@end_script
loop 1
delay 9
offset 1 1
frame data/chars/misc/empty.gif
delay 1
frame data/chars/misc/empty.gif
anim spawn
delay 1
offset 1 1
frame data/chars/misc/empty.gif
Bloodbane said:I must remind you that this method is for single trip: after the background reaches the top part, you can't move it down again
If you want to make continuous scrolling, you need different method