1.0
06 May 2016 18:36
//you may customize these four values
const float FadePosXMin = 0.0;
const float FadePosXMax = 1.0;
const float FadePosYMin = 0.0;
const float FadePosYMax = 1.0;
const int LevelWidth = jjLayers[4].width * 32;
const int LevelHeight = jjLayers[4].height * 32;
const float LevelWidthF = float(LevelWidth);
const float LevelHeightF = float(LevelHeight);
const float FadePosXRange = FadePosXMax - FadePosXMin;
const float FadePosYRange = FadePosYMax - FadePosYMin;
void onDrawLayer4(jjPLAYER@ play, jjCANVAS@) {
const jjPLAYER@ nextPlayer = jjLocalPlayers[(play.localPlayerID + 1) % jjLocalPlayerCount];
if (LevelWidth != jjSubscreenWidth)
jjTexturedBGFadePositionX = (1.0 - float(nextPlayer.cameraX) / (LevelWidthF - jjSubscreenWidth)) * FadePosXRange + FadePosXMin;
else
jjTexturedBGFadePositionX = 0.5; //don't divide by zero!
if (LevelHeight != jjSubscreenHeight)
jjTexturedBGFadePositionY = (1.0 - float(nextPlayer.cameraY) / (LevelHeightF - jjSubscreenHeight)) * FadePosYRange + FadePosYMin;
else
jjTexturedBGFadePositionY = 0.5; //don't divide by zero!
}
Jazz2Online © 1999-INFINITY (Site Credits). We have a Privacy Policy. Jazz Jackrabbit, Jazz Jackrabbit 2, Jazz Jackrabbit Advance and all related trademarks and media are ™ and © Epic Games. Lori Jackrabbit is © Dean Dodrill. J2O development powered by Loops of Fury and Chemical Beats.
Eat your lima beans, Johnny.