Hey guys, as you may recall, a few of you graciously helped me put together a scrolling background a few weeks back.
Upon returning to that section of my project, and trying to script some racing action on top of the background, I've run into a few problems. This is the script I'm using.
function room_RepExec()// this scrolls the background
{
if (oRoad.Visible==true && oFinish.X >= 400) {
oStart.X -=20;
oRoad.X -= 20; // speed
if (oRoad.X <= -640) oRoad.X += 640;
}
if (oDracoRacer.X >= 350) {
oFinish.Move(400, 349, 20, eNoBlock, eAnywhere);
}
function room_AfterFadeIn()// this controls the racer's (oDracoRacer) movement
{
oDracoRacer.SetView(20);
oDracoRacer.Animate(0, 5, eRepeat, eNoBlock, eForwards);
oDracoRacer.Move(200, 312, 5, eNoBlock, eAnywhere);
oDracoRacer.Move(100, 312, 4, eNoBlock, eAnywhere);
Wait(200);
oDracoRacer.Move(700, 312, 5, eNoBlock, eAnywhere);
}
There are a few problems I'm encountering. If I set the move commands to eBlock then they stop the background from scrolling, but if I set them to eNoBlock then they muddle together instead of being three separate movements. Also, the wait command stops the background from scrolling as well. Finally when oDracoRacer's x coordinate exceeds 350, the finish line does not move onto the screen.
TLDR: Is there any way I can have the RepExec script running, while stopping the RoomLoad one?
Also, how do you guys post your code in those neat little white boxes? I'd like to start doing that, just for everyone's sake XD
Upon returning to that section of my project, and trying to script some racing action on top of the background, I've run into a few problems. This is the script I'm using.
function room_RepExec()// this scrolls the background
{
if (oRoad.Visible==true && oFinish.X >= 400) {
oStart.X -=20;
oRoad.X -= 20; // speed
if (oRoad.X <= -640) oRoad.X += 640;
}
if (oDracoRacer.X >= 350) {
oFinish.Move(400, 349, 20, eNoBlock, eAnywhere);
}
function room_AfterFadeIn()// this controls the racer's (oDracoRacer) movement
{
oDracoRacer.SetView(20);
oDracoRacer.Animate(0, 5, eRepeat, eNoBlock, eForwards);
oDracoRacer.Move(200, 312, 5, eNoBlock, eAnywhere);
oDracoRacer.Move(100, 312, 4, eNoBlock, eAnywhere);
Wait(200);
oDracoRacer.Move(700, 312, 5, eNoBlock, eAnywhere);
}
There are a few problems I'm encountering. If I set the move commands to eBlock then they stop the background from scrolling, but if I set them to eNoBlock then they muddle together instead of being three separate movements. Also, the wait command stops the background from scrolling as well. Finally when oDracoRacer's x coordinate exceeds 350, the finish line does not move onto the screen.
TLDR: Is there any way I can have the RepExec script running, while stopping the RoomLoad one?
Also, how do you guys post your code in those neat little white boxes? I'd like to start doing that, just for everyone's sake XD