rendered paste body#include "zcommon.acs"
bool bGameOver = true;
bool bShowTut = true;
int iHighScore = 0;
int iPlayer = 0;
int iPoints = 0;
int iPointsPreviousLevel = 0;
int iPointsNextLevel = 50;
int iScrollSpeed = 50;
int iProjectiles = 1;
script 1 (void)
{
ClearInventory(); // this doesn't work in an enter script in netplay! yay bugs!
}
script 2 (void) // Treadmill minigame start
{
iPlayer = PlayerNumber();
bGameOver = false;
iPoints = 0;
Teleport(1);
Ceiling_LowerAndCrush(5, 255, 255);
Sector_SetDamage(5, 255, 0);
if (bShowTut == true)
{
HudMessage(s:"Hello, and welcome to the\nJetsons Space DM treadmill\nminigame!"; HUDMSG_PLAIN, 1, CR_GRAY, 0.1, 0.8, 4.0);
Delay(35*4);
HudMessage(s:"Jane will spawn crazy\nobstacles at random, and you\nhave to dodge them!"; HUDMSG_PLAIN, 1, CR_GRAY, 0.1, 0.8, 4.0);
Delay(35*4);
HudMessage(s:"Every second you stay\non the treadmill, you get a\npoint, and every 50 points,\nthe level increases!"; HUDMSG_PLAIN, 1, CR_GRAY, 0.1, 0.8, 4.0);
Delay(35*4);
HudMessage(s:"When the level increases,\n1 more object is spawned\nper spawn interval, and the\nspeed of the treadmill\nis upped."; HUDMSG_PLAIN, 1, CR_GRAY, 0.1, 0.8, 4.0);
Delay(35*4);
bShowTut = false;
}
HudMessage(s:"Ready?"; HUDMSG_PLAIN, 1, CR_GRAY, 0.1, 0.8, 2.0);
Delay(35*2);
HudMessage(s:"3"; HUDMSG_PLAIN, 1, CR_GRAY, 0.1, 0.8, 1.0);
Delay(35*1);
HudMessage(s:"2"; HUDMSG_PLAIN, 1, CR_GRAY, 0.1, 0.8, 1.0);
Delay(35*1);
HudMessage(s:"1"; HUDMSG_PLAIN, 1, CR_GRAY, 0.1, 0.8, 1.0);
Delay(35*1);
HudMessage(s:"Go!"; HUDMSG_PLAIN, 1, CR_GRAY, 0.1, 0.8, 4.0);
Scroll_Floor(4, iScrollSpeed, 0, 2);
Delay(35*4);
HudMessage(s:"Points: ",d:iPoints; HUDMSG_PLAIN, 1, CR_RED, 0.1, 0.8, 1.0);
while (bGameOver == false) {
iPoints++;
HudMessage(s:"Points: ",d:iPoints; HUDMSG_PLAIN, 1, CR_RED, 0.1, 0.8, 1.0);
CheckLevel(iPoints);
delay(35);
}
}
script 3 DEATH
{
if (PlayerNumber() == iPlayer && bGameOver == false)
{
bGameOver = true;
Ceiling_RaiseByValue(5, 255, 104);
Sector_SetDamage(5, 0, 0);
Scroll_Floor(4, 0, 0, 0);
iPlayer = 0;
iPointsPreviousLevel = 0;
iPointsNextLevel = 50;
iScrollSpeed = 50;
iProjectiles = 1;
HudMessage(s:"Major beef, squid! Game over..."; HUDMSG_PLAIN, 1, CR_GRAY, 0.1, 0.8, 4.0);
Delay(35*4);
if (iPoints > iHighScore) {
iHighScore = iPoints;
}
HudMessage(s:"High Score: ",d:iHighScore; HUDMSG_PLAIN, 1, CR_BRICK, 0.1, 0.8, 4.0);
}
}
script 4 (int gone) DISCONNECT
{
if (gone == iPlayer && bGameOver == false)
{
bGameOver = true;
Ceiling_RaiseByValue(5, 255, 104);
Sector_SetDamage(5, 0, 0);
Scroll_Floor(4, 0, 0, 0);
iPlayer = 0;
iPointsPreviousLevel = 0;
iPointsNextLevel = 50;
iScrollSpeed = 50;
iProjectiles = 1;
}
}
script 999 open
{
Sector_SetDamage(6, 255, 0);
}
function void CheckLevel (int points) // Check which level you are on, and shoot accordingly.
{ // Don't mind the messy code. :(
if (points > iPointsPreviousLevel && points < iPointsNextLevel && points != iPointsNextLevel) {
for (int i=0; i<iProjectiles; i++)
Thing_Projectile(Random(2,11), Random(153, 155), 0, 128, 0);
}
if (points == iPointsNextLevel) {
if (!(iProjectiles >= 8))
iProjectiles++;
if (!(iScrollSpeed >= 500))
iScrollSpeed += 50;
iPointsPreviousLevel += 50;
iPointsNextLevel += 50;
Scroll_Floor(4, iScrollSpeed, 0, 2);
HudMessage(s:"Level up!"; HUDMSG_PLAIN, 2, CR_TAN, 0.1, 0.6, 4.0);
// AmbientSound(etc/jane, 127);
}
}