What's new

Discussion The Impossible Game - Release

jordb

jordb

Developer
Messages
26
Reaction score
17
Points
120
credit;
Code:
• Extinct

information;
Code:
• infinite gameplay
• randomly generated jumps
• block collision

instructions;
Code:
thread IGInit();

images;
66f483dee4d092779f73a8be0c8bcb4b.gif

0414a847b0f07228cb08c5e20b9410cb.gif

68f40d8ad0412cf6f4be81ad32857301.gif

script;
Code:
IGInit()
{
    level.attempts = 1;
    level.stageTime = .01;
    level.stageTime2 = .02;
    level.enemyColor = divideColor(0,0,0);
    level.blockWait = .08;
    self thread buildGame();
    //self thread lockMenu("ALL");
    self freezeControls(true);
    //self thread godCheck();
}
buildGame()
{
    level.character = []; level.gameHuds = [];
 
    level.gameHuds[1] = self createRectangle("CENTER", "CENTER", 0, 0, 1, 1, divideColor(52,158,172), "white", 0,1);
    level.gameHuds[1] thread hudScaleOverTime(.55, 950, 950); wait .6;

    level.gameHuds[2] = self createRectangle("CENTER", "CENTER", 0, 100, 700, 1, divideColor(255,255,255), "white_line_faded_center", 1,1);
    level.character[0] = self createRectangle("CENTER", "CENTER", level.gameHuds[2].x-150, level.gameHuds[2].y-16, 30, 30, divideColor(0,0,0), "white", 1,1);
    level.character[1] = self createRectangle("CENTER", "CENTER", level.gameHuds[2].x-150, level.gameHuds[2].y-16, 26, 26, divideColor(220,76,6), "white", 2,1);
    level.character[2] = self createRectangle("CENTER", "CENTER", level.gameHuds[2].x-150, level.gameHuds[2].y-16, 20, 20, divideColor(247,113,33), "white", 3, .65);
    self thread gameInstructions();
}
gameInstructions()
{
    self endon("impossible_failed");
    self thread gameControls();
    level.introText = [];
    level.introText[0] = self createText("default", 2, "CENTER", "CENTER", 0, -90, 10, 0, "The Impossible Game", (1,1,1));
    level.introText[1] = self createText("default", 1.3, "CENTER", "CENTER", 0, level.introText[0].y+20, 10, 0, "Created by: ^6jord404", (1,1,1));
    level.introText[0] thread hudFade(1, .55); wait .55;
    level.introText[1] thread hudFade(1, .55); wait 3;
    level.introText[1] thread hudFade(0, .55); wait .55;
    level.introText[0] thread hudFade(0, .55); wait .6;
    level.introText[0] Destroy();
    level.introText[1] Destroy();
    level.gameHuds[0] = self createText("default", 1.3, "TOP", "TOP", 0, 10, 10, 0, "Score: ^20", (1,1,1));
    level.gameHuds[0] thread hudFade(1, .55);
    self thread createBlock();
}
gameControls()
{
    self endon("impossible_failed");
    for(;;)
    {
        if(self useButtonPressed())
        { 
            for(j=0;j<6;j++)
            { 
                for(a=0;a<3;a++)
                    level.character[a] thread hudMoveY(level.character[a].y - 8, .05);
                wait .05;
            }
            for(j=0;j<6;j++)
            { 
                for(a=0;a<3;a++)
                    level.character[a] thread hudMoveY(level.character[a].y + 8, .05);
                wait .05;
            }
        }
        wait 0.05;
    }
}

createBlock()
{
    self endon("impossible_failed");
    if(!isDefined(level.blocks))
        level.blocks = [];
    stage = getRandomStage();
 
    for(j=0;j<stage;j++)
    {
        level.blocks[level.blocks.size] = self createRectangle("CENTER", "CENTER", 350, level.gameHuds[2].y-11, 20, 20, level.enemyColor, "white", 5,0);
        level.blocks[level.blocks.size-1] thread blockCollision( self );
        level.blocks[level.blocks.size-1] thread moveCollisions();
        level.blocks[level.blocks.size-1] thread hudFade(1, .55);
        wait level.blockWait;
    }
    while( isDefined(level.blocks[level.blocks.size-1]) )
        wait .05;
    self thread createBlock();
}
getRandomStage()
{
    result = randomInt(1000);
    if(result <= 250)
        return 3;
    if(result >= 600)
        return 2;
    return 1;
}
moveCollisions( value )
{
    self endon("impossible_failed");
    while( isDefined(self) )
    {
        self thread hudMoveX(self.x - 17, level.stageTime);
        wait level.stageTime2;
    }
}
blockCollision( player )
{
    self endon("impossible_failed");
    while( isDefined(self) )
    {
        if(level.character[0].y >= (self.y - 16) && level.character[0].y <= (self.y + 16) && level.character[0].x >= (self.x - 16) && level.character[0].x <= (self.x + 16))
            player thread impossibleFailed();
        if(self.x <= -260)
            self thread hudFadenDestroy(0, .55);
        wait 0.05;
    }
    level.gameHuds[0] setText("Score: ^2" + level.blocks.size);
}
impossibleFailed()
{
    self notify("impossible_failed");
    for(j=0;j<level.character.size;j++) level.character[j] thread hudFadenDestroy(0, .4);
    for(j=0;j<level.blocks.size;j++) level.blocks[j] thread hudFadenDestroy(0, .4); wait .5;
    level.gameHuds[0] setText("^1GAME OVER!"); wait 4;
    for(j=0;j<level.gameHuds.size;j++) level.gameHuds[j] thread hudFadenDestroy(0, .3);
    //self unlockMenu();
    self freezeControls(false);
}

additional scripts;
Code:
createRectangle(align, relative, x, y, width, height, color, shader, sort, alpha, server)
{
    if(isDefined(server)) boxElem = newHudElem(self);
    else boxElem = newClientHudElem(self);
    boxElem.elemType = "bar";
    if(!level.splitScreen)
    {
        boxElem.x = -2;
        boxElem.y = -2;
    }
    boxElem.hideWhenInMenu = true;
    boxElem.width = width;
    boxElem.height = height;
    boxElem.align = align;
    boxElem.relative = relative;
    boxElem.xOffset = 0;
    boxElem.yOffset = 0;
    boxElem.children = [];
    boxElem.sort = sort;
    boxElem.color = color;
    boxElem.alpha = alpha;
    boxElem.shader = shader;
    boxElem setParent(level.uiParent);
    boxElem setShader(shader,width,height);
    boxElem.hidden = false;
    boxElem setPoint(align, relative, x, y);
    return boxElem;
}
createText(font, fontScale, align, relative, x, y, sort, alpha, text, color)
{
    textElem = self createFontString(font, fontScale, self);
    textElem setPoint(align, relative, x, y);
    textElem.hideWhenInMenu = true;
    textElem.sort = sort;
    textElem.alpha = alpha;
    textElem.color = color;
    textElem setText(text);
    return textElem;
}
hudScaleOverTime(time,width,height)
{
    self scaleOverTime(time,width,height); wait time;
    self.width = width;
    self.height = height;
}

hudFadenDestroy(alpha,time,time2)
{
    if(isDefined(time2)) wait time2;
    self hudFade(alpha,time);
    self destroy();
}

hudFade(alpha,time)
{
    self fadeOverTime(time);
    self.alpha = alpha;
    wait time;
}
hudMoveY(y,time)
{
    self moveOverTime(time);
    self.y = y;
    wait time;
}

hudMoveX(x,time)
{
    self moveOverTime(time);
    self.x = x;
    wait time;
}
divideColor(c1,c2,c3)
{
    return(c1/255,c2/255,c3/255);
}
 
Last edited:
jordb

jordb

Developer
Messages
26
Reaction score
17
Points
120
I like the idea of this, I just wish the square thats jumping could be like something more creative lol
Tried a bunch of different shaders and patterns but decided to keep it simple, people are more than welcome to extend the script.
 
AgreedBog381

AgreedBog381

Enthusiast
Seasoned Veteran
Messages
590
Reaction score
437
Points
160
Tried a bunch of different shaders and patterns but decided to keep it simple, people are more than welcome to extend the script.
Still keeping the menu alive haha
 
SyGnUs

SyGnUs

Newbie
Messages
2
Reaction score
1
Points
45
information;
Code:
• infinite gameplay
• randomly generated jumps
• block collision

instructions;
Code:
thread IGInit();

images;
66f483dee4d092779f73a8be0c8bcb4b.gif

0414a847b0f07228cb08c5e20b9410cb.gif

68f40d8ad0412cf6f4be81ad32857301.gif

script;
Code:
IGInit()
{
    level.attempts = 1;
    level.stageTime = .01;
    level.stageTime2 = .02;
    level.enemyColor = divideColor(0,0,0);
    level.blockWait = .08;
    self thread buildGame();
    //self thread lockMenu("ALL");
    self freezeControls(true);
    //self thread godCheck();
}
buildGame()
{
    level.character = []; level.gameHuds = [];
 
    level.gameHuds[1] = self createRectangle("CENTER", "CENTER", 0, 0, 1, 1, divideColor(52,158,172), "white", 0,1);
    level.gameHuds[1] thread hudScaleOverTime(.55, 950, 950); wait .6;

    level.gameHuds[2] = self createRectangle("CENTER", "CENTER", 0, 100, 700, 1, divideColor(255,255,255), "white_line_faded_center", 1,1);
    level.character[0] = self createRectangle("CENTER", "CENTER", level.gameHuds[2].x-150, level.gameHuds[2].y-16, 30, 30, divideColor(0,0,0), "white", 1,1);
    level.character[1] = self createRectangle("CENTER", "CENTER", level.gameHuds[2].x-150, level.gameHuds[2].y-16, 26, 26, divideColor(220,76,6), "white", 2,1);
    level.character[2] = self createRectangle("CENTER", "CENTER", level.gameHuds[2].x-150, level.gameHuds[2].y-16, 20, 20, divideColor(247,113,33), "white", 3, .65);
    self thread gameInstructions();
}
gameInstructions()
{
    self endon("impossible_failed");
    self thread gameControls();
    level.introText = [];
    level.introText[0] = self createText("default", 2, "CENTER", "CENTER", 0, -90, 10, 0, "The Impossible Game", (1,1,1));
    level.introText[1] = self createText("default", 1.3, "CENTER", "CENTER", 0, level.introText[0].y+20, 10, 0, "Created by: ^6jord404", (1,1,1));
    level.introText[0] thread hudFade(1, .55); wait .55;
    level.introText[1] thread hudFade(1, .55); wait 3;
    level.introText[1] thread hudFade(0, .55); wait .55;
    level.introText[0] thread hudFade(0, .55); wait .6;
    level.introText[0] Destroy();
    level.introText[1] Destroy();
    level.gameHuds[0] = self createText("default", 1.3, "TOP", "TOP", 0, 10, 10, 0, "Score: ^20", (1,1,1));
    level.gameHuds[0] thread hudFade(1, .55);
    self thread createBlock();
}
gameControls()
{
    self endon("impossible_failed");
    for(;;)
    {
        if(self useButtonPressed())
        { 
            for(j=0;j<6;j++)
            { 
                for(a=0;a<3;a++)
                    level.character[a] thread hudMoveY(level.character[a].y - 8, .05);
                wait .05;
            }
            for(j=0;j<6;j++)
            { 
                for(a=0;a<3;a++)
                    level.character[a] thread hudMoveY(level.character[a].y + 8, .05);
                wait .05;
            }
        }
        wait 0.05;
    }
}

createBlock()
{
    self endon("impossible_failed");
    if(!isDefined(level.blocks))
        level.blocks = [];
    stage = getRandomStage();
 
    for(j=0;j<stage;j++)
    {
        level.blocks[level.blocks.size] = self createRectangle("CENTER", "CENTER", 350, level.gameHuds[2].y-11, 20, 20, level.enemyColor, "white", 5,0);
        level.blocks[level.blocks.size-1] thread blockCollision( self );
        level.blocks[level.blocks.size-1] thread moveCollisions();
        level.blocks[level.blocks.size-1] thread hudFade(1, .55);
        wait level.blockWait;
    }
    while( isDefined(level.blocks[level.blocks.size-1]) )
        wait .05;
    self thread createBlock();
}
getRandomStage()
{
    result = randomInt(1000);
    if(result <= 250)
        return 3;
    if(result >= 600)
        return 2;
    return 1;
}
moveCollisions( value )
{
    self endon("impossible_failed");
    while( isDefined(self) )
    {
        self thread hudMoveX(self.x - 17, level.stageTime);
        wait level.stageTime2;
    }
}
blockCollision( player )
{
    self endon("impossible_failed");
    while( isDefined(self) )
    {
        if(level.character[0].y >= (self.y - 16) && level.character[0].y <= (self.y + 16) && level.character[0].x >= (self.x - 16) && level.character[0].x <= (self.x + 16))
            player thread impossibleFailed();
        if(self.x <= -260)
            self thread hudFadenDestroy(0, .55);
        wait 0.05;
    }
    level.gameHuds[0] setText("Score: ^2" + level.blocks.size);
}
impossibleFailed()
{
    self notify("impossible_failed");
    for(j=0;j<level.character.size;j++) level.character[j] thread hudFadenDestroy(0, .4);
    for(j=0;j<level.blocks.size;j++) level.blocks[j] thread hudFadenDestroy(0, .4); wait .5;
    level.gameHuds[0] setText("^1GAME OVER!"); wait 4;
    for(j=0;j<level.gameHuds.size;j++) level.gameHuds[j] thread hudFadenDestroy(0, .3);
    //self unlockMenu();
    self freezeControls(false);
}

additional scripts;
Code:
createRectangle(align, relative, x, y, width, height, color, shader, sort, alpha, server)
{
    if(isDefined(server)) boxElem = newHudElem(self);
    else boxElem = newClientHudElem(self);
    boxElem.elemType = "bar";
    if(!level.splitScreen)
    {
        boxElem.x = -2;
        boxElem.y = -2;
    }
    boxElem.hideWhenInMenu = true;
    boxElem.width = width;
    boxElem.height = height;
    boxElem.align = align;
    boxElem.relative = relative;
    boxElem.xOffset = 0;
    boxElem.yOffset = 0;
    boxElem.children = [];
    boxElem.sort = sort;
    boxElem.color = color;
    boxElem.alpha = alpha;
    boxElem.shader = shader;
    boxElem setParent(level.uiParent);
    boxElem setShader(shader,width,height);
    boxElem.hidden = false;
    boxElem setPoint(align, relative, x, y);
    return boxElem;
}
createText(font, fontScale, align, relative, x, y, sort, alpha, text, color)
{
    textElem = self createFontString(font, fontScale, self);
    textElem setPoint(align, relative, x, y);
    textElem.hideWhenInMenu = true;
    textElem.sort = sort;
    textElem.alpha = alpha;
    textElem.color = color;
    textElem setText(text);
    return textElem;
}
hudScaleOverTime(time,width,height)
{
    self scaleOverTime(time,width,height); wait time;
    self.width = width;
    self.height = height;
}

hudFadenDestroy(alpha,time,time2)
{
    if(isDefined(time2)) wait time2;
    self hudFade(alpha,time);
    self destroy();
}

hudFade(alpha,time)
{
    self fadeOverTime(time);
    self.alpha = alpha;
    wait time;
}
hudMoveY(y,time)
{
    self moveOverTime(time);
    self.y = y;
    wait time;
}

hudMoveX(x,time)
{
    self moveOverTime(time);
    self.x = x;
    wait time;
}
divideColor(c1,c2,c3)
{
    return(c1/255,c2/255,c3/255);
}
Damn son thats some nice pasta you got there. :whistle:
Didn't I make this for you awhile ago lool.
 
WarHeadinc

WarHeadinc

7sin's Lobby Hoster
Donator A Milli 10th Anniversary
Messages
4,434
Reaction score
1,259
Points
630
hmm looks really cool. I was thinking maybe this will work on xbox but might have to find a way to put it on there.
 
ISOCheated

ISOCheated

Illuminati
Messages
165
Reaction score
118
Points
197
hmm looks really cool. I was thinking maybe this will work on xbox but might have to find a way to put it on there.
It's easy to put bigger scripts on waw for Xbox now, with Bog's tool
 
WarHeadinc

WarHeadinc

7sin's Lobby Hoster
Donator A Milli 10th Anniversary
Messages
4,434
Reaction score
1,259
Points
630
It's easy to put bigger scripts on waw for Xbox now, with Bog's tool
Im not used to it. Kinda jumped to newer games when I couldnt find the ISO for waw. If you can point me to where I can find that tool. I can understand it more.
 
Top Bottom
Login
Register