Pardon the mess, Play My Code is in beta!

READY TO PLAY?
CLICK TO LOG IN!

sign up - lost password

Hooper the Happy Hopper »

You do not own this project, so changes will not be saved

/* 
 * The AGameAWeek/PMC Template thing
 * Week 4 edition!
*/


/* Brief File Layout
 * 
 *          Tweaks at the Top
 * 
 * Variables
 * Sprite/Sound Loader
 * Default Inks
 * 
 * Menu : Tweak name / brief instructions
 * 
 * 
 * ^^^^^^^^^^^^^^^^
 *          Ignore the Middle
 * Main Loop
 * Loading screen
 * Messy function stuff that can be ignored forever
 * vvvvvvvvvvvvvvv
 * 
 * 
 * 
 *          Code the End
 * Gamey bit goes at the bottom.
 * Don't forget to set $Score, to save highscores.
*/


// Globals
$jscrw=getScreenWidth();
$jscrh=getScreenHeight();

$MyUser = new User();
$MyName=$MyUser.getName();

$j_scaleX=1;
$j_scaleY=1;
$flipat=120;
$flipcred=0;$creds=0;

$titletick=0;$tune=0;

$GameType=2;
$GameMode=-2;
$EndofGame=0;
$MenuIn=-32;
$Debug='';

$kdown=0;

$waiter=0;

$score=0;
$level=0;

// Arrays!  Hurray!
$Palette=[];
$img=[];
$imgData=[];
$sfx=[];
$grid=[];
$grub=[];
$beep=[];
$bto=0;


$score_table=[];

50.times() do |n|
    $score_table[n]=0;
end;

Load();


// Defaults
LoadImage(99,'bg_smash_blue',512,1,1);
LoadImage(98,'bg_desert',512,1,1);   // If anyone asks, yes, that was DEFINITELY meant to be clouds.. ok!!
LoadImage(1,'sprites_001',16,32,32);
LoadImage(2,'sprites_002',16,32,32);
LoadImage(3,'floor',128,1,2);

LoadSFX(1);
LoadSFX(2);

LoadSFX(95);
LoadSFX(97);
LoadSFX(98);
LoadSFX(99);


// Default Colour Scheme
AddInk( 0,  0,  0,  0) //  0 Black
AddInk( 1,  0,  0,128) //  1 Blue
AddInk( 2,  0,  0,255) //  2 Bright Blue
AddInk( 3,128,  0,  0) //  3 Red
AddInk( 4,128,  0,128) //  4 Magenta 
AddInk( 5,128,  0,255) //  5 Mauve
AddInk( 6,255,  0,  0) //  6 Bright Red
AddInk( 7,255,  0,128) //  7 Purple
AddInk( 8,255,  0,255) //  8 Bright Magenta

AddInk( 9,  0,128,  0) //  9 Green
AddInk(10,  0,128,128) // 10 Cyan
AddInk(11,  0,128,255) // 11 Sky Blue
AddInk(12,128,128,  0) // 12 Yellow
AddInk(13,128,128,128) // 13 White 
AddInk(14,128,128,255) // 14 Pastel Blue
AddInk(15,255,128,  0) // 15 Orange
AddInk(16,255,128,128) // 16 Pink
AddInk(17,255,128,255) // 17 Pastel Magenta

AddInk(18,  0,255,  0) // 18 Bright Green
AddInk(19,  0,255,128) // 19 Sea Green
AddInk(20,  0,255,255) // 20 Bright Cyan
AddInk(21,128,255,  0) // 21 Lime
AddInk(22,128,255,128) // 22 Pastel Green
AddInk(23,128,255,255) // 23 Pastel Cyan
AddInk(24,255,255,  0) // 24 Bright Yellow
AddInk(25,255,255,128) // 25 Pastel Yellow
AddInk(26,255,255,255) // 26 Bright White



Font(32)


// -=-=-=-=-=-=-=-=-
//  Menu Stuff         (Up top : once it's done I can ignore it)
// -=-=-=-=-=-=-=-=-

def RunMenu(delta)    
    Options=3

    
    ResetDraw()
    SetSize(2);
    DrawImg(99,(($jscrw-((40*3)+20))/2),$jscrh/2+44,0)
    
    ResetDraw()
    if ($MenuIn<0) $MenuIn=$MenuIn+(delta);end;
    if ($MenuIn>0) $MenuIn=0;end;
    
    Ribbon(0,$jscrw*.35,64,"Hooper the Happy Hopper",24,15,26,$MenuIn,1,0.75)
    Ribbon(1,$jscrw-(20*3)-10,$jscrh*.5,"Sidebar?",26,0,0,-$MenuIn,3,0.5)
    Ink(15);font(32)
    text(($jscrw-70)-($MenuIn*8),64,"HTML5",1,1)
    
    Ribbonb(0,40,$jscrh-16,"Z to start, Cursors to move",0,26,14,-$MenuIn*2,0.7,0.2)
    font(32);
    x=(($jscrw-((40*3)+20))/2)
    y=((($jscrh/2)+64)-(Options*20))-($MenuIn*16)
    
//    Ink(14);if ($GameType==1) ink(26);end;
//    ShadowText(x,y,"Easy",1,1);y=y+40
    Ink(14);if ($GameType==2) ink(26);end;
    ShadowText(x,y,"Start!",1,1);y=y+40
//    Ink(14);if ($GameType==3) ink(26);end;
//    ShadowText(x,y,"Hard",1,1);y=y+40
    
//    if (playkey(0) && $kdown==0) $GameType=$GameType-1;$kdown=1;playsfx(99);end;
//    if (playkey(8) && $kdown==0) $GameType=$GameType+1;$kdown=2;playsfx(99);end;
$GameType=2;

    if ((playkey(10) || playkey(11)) && $kdown==0) $GameMode=10;$kdown=3;playsfx(98);end; 
    if ($GameType<1) $GameType=Options;end;
    if ($GameType>Options) $GameType=1;end;

    Font(16);Ink(26)
    10.times() do |n|
        d=240-(n*14)
        if ($GameType==1) SetColor(d,d,d/4);end;
        if ($GameType==2) SetColor(d,d/2,d/4);end;
        if ($GameType==3) SetColor(d,d/4,d/4);end;
            
        Text($jscrw-30,(108+($MenuIn*40))+(n*26),PadRight($score_table[n+(($GameType-1)*10)],'0',8),:right,0)
    end;
    
    if ($but.getmousex()>$jscrw-120 && $but.getmousey()<80 && $MenuIn==0)
        ink(15)
        FillRoundedRect($jscrw/2,$jscrh/2,$jscrw*0.8,$jscrh*0.8,38,1,1)
        ink(24)
        FillRoundedRect($jscrw/2,$jscrh/2,($jscrw*0.8)-32,($jscrh*0.8)-32,32,1,1)
        
        ink(0);font(20)
        y=80;
        Text($jscrw/2,y,"PlayMyCode.com uses Quby to",1,1);y=y+22
        Text($jscrw/2,y,"generate HTML5 based games.",1,1);y=y+32
        Text($jscrw/2,y,"",1,1);y=y+24
        Text($jscrw/2,y,"Simply log in, click Build, and start coding.",1,1);y=y+16
        Text($jscrw/2,y,"",1,1);y=y+30
        Text($jscrw/2,y,"Once you're done, you can embed",1,1);y=y+22
        Text($jscrw/2,y,"your game onto your own site.",1,1);y=y+58
        font(32)
        Text($jscrw/2,y,"PlayMyCode.com",1,1);y=y+42
        font(20)
        Text($jscrw/2,y,"Like YouTube, but for Games!",1,1);y=y+28
        font(12)
        Text($jscrw/2,y,"Game created by Jayenkai : AGameAWeek.com",1,1);
    end;
    
    
ResetDraw();
$flipat=$flipat-delta
if ($flipat<-75) $flipat=75;end;
if ($flipat>-8 && $flipat<8) $creds=rand(12,23.9).floor();end;
    $flipcred=dcos($flipat*1.2)*64;
    if ($flipcred<32) $flipcred=32;end;
    
    a=($creds/16).floor()+1;b=($creds%16)*64;
    16.times() do |x|
        DrawImg(a,($jscrw-(16*16))+(x*16),(($jscrh-48)-$MenuIn)+$flipcred,b+x)
    end;
    
end;



// Main Loop
onEachFrame() do |delta|
$but=getControls();
fill( 0, 0, 0 )
    if ($GameMode==-2) Title(delta); end;
    if ($GameMode==-1) GotoMenu(delta); end;
    if ($GameMode==0) RunMenu(delta); end;

    if ($GameMode==10) GotoGame(delta); end;
    if ($GameMode==11) RunGame(delta); end;
    if ($GameMode==12) EndGame(delta); end;


    if (!(playkey(0) || playkey(3) || playkey(5) || playkey(8) || playkey(10) || playkey(11) || playkey(12) || playkey(13) )) $kdown=0;end;
    ink(26);font(12);Shadowtext($jscrw-1,1,$debug,:right,0);
end

def Title(delta)
    ResetDraw()
            
    if ($titletick>140)
        SetSize(2);
        d=($titletick-140)*3
        if (d>255) d=255;end;
        SetColor(d,d,d)
        DrawImg(99,(($jscrw-((40*3)+20))/2),$jscrh/2+44,0)
    end;
    if ($titletick>30 && $tune==0) PlaySFX(95);$tune=1;end;
    $titletick=$titletick+delta
    if ($titletick>240) $GameMode=-1; end;
    
    in=($titletick-60)
    if ($titletick>59 and $titletick<161) in=0;end;
    if ($titletick>160) in=$titletick-160;end;
    if ($titletick<240)
        Ribbon(0,$jscrw*.5,$jscrh*.25,"AGameAWeek.com",24,15,0,in,1.5,0.8)
        Ribbon(0,$jscrw*.5,$jscrh*.75,"PlayMyCode.com",8,26,0,-in,1.5,0.8)
    end;
    
end;

def GotoMenu(delta)
    $GameMode=0;
    $MenuIn=-32;
    $kdown=1;
    Debug('');
end;





// -=-=-=-=-=-=-=-=-
//  Function Stuff       (Middle : Pretty much ignore, always!)
// -=-=-=-=-=-=-=-=-

// Stuffs
def Debug(ftxt)
    $Debug=ftxt;
end;

def Save()
    savetext='';
    50.times() do |n|
        savetext=savetext+PadRight($score_table[n],' ',32);
    end;
    $myUser.saveGame(savetext);
end;

def Load()
    loadtext=$myUser.LoadGame();
    if (loadtext!=null)
    50.times() do |n|
        loadbit='';
        32.times() do |m|
            c=loadtext.GetChar((n*32)+m);
            if (c!=' ' && c!=null) loadbit=loadbit+c;end;
            $score_table[n]=loadbit;
        end;
    end;
    end;
end;

def dsin(fdeg) return (fdeg/57.29577866666166).sin(); end;
def dcos(fdeg) return (fdeg/57.29577866666166).cos(); end;
def rnd(fa,fb) return rand(fa,fb+0.999999).floor();end;

// Doodley

def Ribbon(horvert,cx,cy,txt,ink1,ink2,ink3,in,size,alpha)
    Ink(ink2,alpha)
    if (horvert==0) FillRect((cx-$jscrw)+(in*64),(cy-(20*size)),$jscrw*2,(40*size)); end;
    if (horvert==1) FillRect((cx-(20*size)),(cy-$jscrh)+(in*64),(40*size),$jscrh*2); end;

    Ink(ink1,alpha)
    if (horvert==0) 
        FillRect((cx-$jscrw)-(in*48),(cy-(20*size))+in,$jscrw*2,(4))
        FillRect((cx-$jscrw)-(in*32),(cy+((20*size)-4))-in,$jscrw*2,(4))
    end;
    if (horvert==1) 
        FillRect((cx-(20*size))-in,(cy-$jscrh)-(in*48),(4),$jscrh*2)
        FillRect((cx+((20*size)-4))+in,(cy-$jscrh)-(in*32),(4),$jscrh*2)
    end;
    
    Font(32);
    Ink(ink3)
    if (horvert==0) ShadowText(cx-(in*16),cy,txt,1,1);end;
//    if (horvert=1) ShadowText(cx-(in*16),cy,txt,1,1);end;
        
end;


def Ribbonb(horvert,cx,cy,txt,ink1,ink2,ink3,in,size,alpha)
    Ink(ink2,alpha)
    if (horvert==0) FillRect((cx-$jscrw)+(in*64),(cy-(20*size)),$jscrw*2,(40*size)); end;
    if (horvert==1) FillRect((cx-(20*size)),(cy-$jscrh)+(in*64),(40*size),$jscrh*2); end;

    Ink(ink1,alpha)
    if (horvert==0) 
        FillRect((cx-$jscrw)-(in*48),(cy-(20*size))+in,$jscrw*2,(4))
        FillRect((cx-$jscrw)-(in*32),(cy+((20*size)-4))-in,$jscrw*2,(4))
    end;
    if (horvert==1) 
        FillRect((cx-(20*size))-in,(cy-$jscrh)-(in*48),(4),$jscrh*2)
        FillRect((cx+((20*size)-4))+in,(cy-$jscrh)-(in*32),(4),$jscrh*2)
    end;
    
    Font(16);
    Ink(ink3)
    if (horvert==0) ShadowText(cx-(in*16),cy,txt,0,1);end;
//    if (horvert=1) ShadowText(cx-(in*16),cy,txt,1,1);end;
        
end;

// Palettey

def AddInk(n,r,g,b)
    $Palette[(n*3)+1]=r;
    $Palette[(n*3)+2]=g;
    $Palette[(n*3)+3]=b;
end;
def Ink(n)
    SetColor($Palette[(n*3)+1],$Palette[(n*3)+2],$Palette[(n*3)+3]);
end;
def Ink(n,alpha)
    SetColor($Palette[(n*3)+1],$Palette[(n*3)+2],$Palette[(n*3)+3],alpha);
end;

// Wordy
def Text(fx,fy,ftxt,fcx,fcy)
    FillText(ftxt,fx,fy,fcx,fcy)
end;
def ShadowText(fx,fy,ftxt,fcx,fcy)
    SetColor(0,0,0) do
        FillText(ftxt,fx+1,fy+1,fcx,fcy)
    end;
    FillText(ftxt,fx,fy,fcx,fcy)
end;
def font(size)
    setFont( 'Arial', size,'bold');// Yeah, I'm lazy, so what!!?
end;

def PadRight(ftxta,pad,len)
    ftxt=''+ftxta;
    while (ftxt.length()0)
        sx=((frame % $imgData[(n*10)+1]).floor())*sz;
        sy=((frame / $imgData[(n*10)+1]).floor())*sz;
    end;

    if (frame>$imgData[(n*10)+1]*$imgData[(n*10)+2]) frame=$imgData[(n*10)+1]*$imgData[(n*10)+2]; end;
    DrawImage($img[n],sx,sy,sz,sz,x,y,sz*$j_scaleX,sz*$j_scaleY,1)
end;

def SetSize(fx)
    $j_scaleX=fx;$j_scaleY=fx;
end;
def SetSize(fx,fy)
    $j_scaleX=fx;$j_scaleY=fy;
end;

def ResetDraw()
    SetColor(255,255,255,1);
    SetSize(1);
    Font(32);
end;


// SFX
def LoadSFX(fn)
    $sfx[fn]=new sound(PadRight(fn,'0',3)+'.mp3');
end;

def PlaySFX(fn)
    if ($sfx[fn]==null) LoadSFX(fn);end;
    if ($sfx[fn]) $sfx[fn].Play();end;
end;


// Keys
def PlayKey(fn)
    if (fn==0) return ($but.isKeyDown('up') || $but.isKeyDown('w') ); end; 
    if (fn==8) return ($but.isKeyDown('down') || $but.isKeyDown('s') ); end; 
        
    if (fn==3) return ($but.isKeyDown('left') || $but.isKeyDown('a') ); end; 
    if (fn==5) return ($but.isKeyDown('right') || $but.isKeyDown('d') ); end; 

    if (fn==10) return ($but.isKeyDown('z') || $but.isKeyDown('space') || $but.isKeyDown('enter') || $but.isKeyDown('j') ); end; 
    if (fn==11) return ($but.isKeyDown('x') || $but.isKeyDown('k') ); end; 
    if (fn==12) return ($but.isKeyDown('c') || $but.isKeyDown('l') ); end; 
    if (fn==13) return ($but.isKeyDown('v') || $but.isKeyDown('i') ); end; 

    if (fn==1) return ($but.isKeyDown('backspace') || $but.isKeyDown('tab') ); end; 
end;

// -=-=-=-=-=-=-=-=-
//       Game             (Hit End to skip to the bottom, do codeystuff)
// -=-=-=-=-=-=-=-=-

def EndGame(delta)
    
    alpha=($waiter)/40
    if (alpha<0) alpha=0;end;
    if (alpha>0.7) alpha=0.7;end;
        
    fill(0,0,0,alpha)
    
    $waiter=$waiter+delta;
    usewait=($waiter-20)*2;
    if (usewait>0) usewait=0;end;
    if ($waiter>160) usewait=($waiter-160)*3; end;
        
    put=10;
    10.times() do |n|
        if ($score>$score_table[n+(($GameType-1)*10)] && put==10) put=n;end;
    end;
        
    Ribbon(0,$jscrw*.25,$jscrh*.4,"Game Over",6,3,6,-usewait,2,0.5)    
    Ribbon(0,$jscrw*.7,$jscrh*.6,"Score : "+$score,2,11,26,usewait,1,0.7)
    
if (put<10) 
    nth='First';
    if (put==1) nth='Second';end;
    if (put==2) nth='Third';end;
    if (put==3) nth='Forth';end;
    if (put==4) nth='Fifth';end;
    if (put==5) nth='Sixth';end;
    if (put==6) nth='Seventh';end;
    if (put==7) nth='Eighth';end;
    if (put==8) nth='Ninth';end;
    if (put==9) nth='Tenth';end;

    Ribbon(0,$jscrw*.5,($jscrh*.8)+((usewait.abs())*4),"Highscore : "+nth,9,18,26,-usewait,1,0.4)
end;


    if ($waiter>180)
        if (put<10) 
            10.times() do |n|
                m=9-n;
                if (m<10 && m>put) $score_table[m+(($GameType-1)*10)]=$score_table[(m-1)+(($GameType-1)*10)];end;
            end;
            $score_table[put+(($GameType-1)*10)]=$score;
        end;
        
        Save();
        $GameMode=-1; $waiter=0;
    end;
end;


def GotoGame(delta)
    Debug('');
    $score=0;$level=1;
    $GameMode=11;
    $EndofGame=0;
    $waiter=0;
    $bgx=0;
    $fgx=0;
    $gap=16;
    100.times() do |n|
        $grid[n]=0;
        $gap=$gap-1;
        if ($gap<0)
            $grid[n]=rand(250,400)
            $gap=rand(16,40)
            
            $grub[(n*9)+0]=rand(-60,60)
            $grub[(n*9)+1]=rnd(0,7)
            $grub[(n*9)+2]=rand(-1,1)
            
            $grub[(n*9)+3]=rand(-60,60)
            $grub[(n*9)+4]=rnd(0,7)
            $grub[(n*9)+5]=rand(-1,1)
            
            $grub[(n*9)+6]=rand(-60,60)
            $grub[(n*9)+7]=rnd(0,7)
            $grub[(n*9)+8]=rand(-1,1)
            
        end;
        if (n==16)
            $grub[(n*9)+1]=-1
            $grub[(n*9)+4]=-1
            $grub[(n*9)+7]=-1
            $py=$grid[n]-80;
            $flr=$py;
        end;
    end;
    
    $dist=0;
    $psy=0;
    $px=40;$psx=0;
    $panim=0;
    $combo=0;
    $wpsy=0;
    
    20.times() do |b|
        $beep[b*10]=0;
    end;
    $mdown=1;
end;

def GETS(s)
    $score=$score+s;
    $bto=($bto+1) % 20;
    ID=$bto*10;
    $beep[ID]=s;
    $beep[ID+1]=$px;
    $beep[ID+2]=$py;
    $beep[ID+3]=1;
    
end;
def RunGame(delta)
    ResetDraw();
    SetSize(4);
    DrawImg(98,$bgx+1024,$jscrh-1024,0)
    DrawImg(98,$bgx+3072,$jscrh-1024,0)
    
    $spd=0;
    if ($px>200) $spd=1;end;
    if ($px>240) $spd=2;end;
    if ($px>280) $spd=4;end;
    if ($px>320) $spd=6;end;
    if ($px>380) $spd=8;end;
    
    $bgx=$bgx-(($spd*delta)*.75) 
    if ($bgx<-2048) $bgx=$bgx+2048;end;
    
    $fgx=$fgx-$spd*delta
    if ($fgx<-8) 
        $fgx=$fgx+8;
        99.times() do |n|
            $grid[n]=$grid[n+1];
            9.times() do |m|
                $grub[(n*9)+m]=$grub[((n+1)*9)+m]
            end;
        end; 
        $gap=$gap-1;
        $grid[99]=0;
        $grub[(99*9)+1]=-1;
        $grub[(99*9)+4]=-1;
        $grub[(99*9)+7]=-1;

        if ($gap<0)
            $grid[99]=rand(250,400)
            $gap=rand(16,40)
            
            $grub[(99*9)+0]=rand(-60,60)
            $grub[(99*9)+1]=rnd(0,7)
            $grub[(99*9)+2]=rand(-1,1)
            
            $grub[(99*9)+3]=rand(-60,60)
            $grub[(99*9)+4]=rnd(0,7)
            $grub[(99*9)+5]=rand(-1,1)
            
            $grub[(99*9)+6]=rand(-60,60)
            $grub[(99*9)+7]=rnd(0,7)
            $grub[(99*9)+8]=rand(-1,1)
        end;
    end;
    
ResetDraw()
    $flr=500;
    100.times() do |n|
        if ($grid[n]>0)
            SetSize(1)
            dx=((n-8)*8)+$fgx;
            if (($px-dx).abs()<67) $flr=$grid[n]-80;end;
                
            drawimg(3,dx,$grid[n],0)
            drawimg(3,dx,$grid[n]+128,1)
            drawimg(3,dx,$grid[n]+256,1)
            drawimg(3,dx,$grid[n]+384,1)
            3.times() do |m|
                a=(m*3);b=(m*3)+1;c=(m*3)+2
                
                if ($grub[(n*9)+a]<-60) $grub[(n*9)+c]=rand(0,1);end;
                if ($grub[(n*9)+a]>60) $grub[(n*9)+c]=0-rand(0,1);end;
                if (rand(0,200)<2) $grub[(n*9)+c]=rand(-1,1);end;
                if ($grub[(n*9)+b]>-1 && $grub[(n*9)+b]<8)
                    $grub[(n*9)+a]=$grub[(n*9)+a]+$grub[(n*9)+c]
                    if ($wpsy>0.3 && ($py-($grid[n]-72)).abs()<10 && ($px-(dx+$grub[(n*9)+a])).abs()<15)
                        $combo=$combo+1;
                        GETS(($combo*5))
                        $grub[(n*9)+b]=$grub[(n*9)+b]+8;
                        $psy=-7;$wpsy=-7;
                        PlaySFX(2);
                    end;
                    
                    SetSize(1);DrawImg(1,dx+$grub[(n*9)+a],$grid[n]-72,968+$grub[(n*9)+b])
                end;
                if ($grub[(n*9)+b]>7)
                    SetSize(1.5,0.25);DrawImg(1,dx+$grub[(n*9)+a],$grid[n]-64,968+($grub[(n*9)+b]-8))
                end;
            end;
            
        end;
    end;
    
    // Jay's Awesome Artistic Tutorial.
        // How to make a man...
    drawimg(1,$px-1,$py-9,585) // Ball for his head    
    drawimg(1,$px,$py+2,776) // Spaceship for his body
    drawimg(1,$px,$py-8,905) // Spikey ball for face
    
    drawimg(1,$px-7-dsin($panim)*2,$py+2+dcos($panim*3)*4,881) // two lazers
    drawimg(1,$px+8+dsin($panim+90)*2,$py+2-dcos(($panim+90)*3)*4,865) // for his hands
    
    drawimg(1,$px-5+dsin($panim*2)*1,$py+13-(dsin($panim*3)*4).abs(),876) // two lazers
    drawimg(1,$px+6-dsin($panim*2)*1,$py+13-(dcos($panim*3)*4).abs(),876) // for his feet
            // sorted!
            
            
    if (playkey(3)==0 && Playkey(5)==0) $panim=45;end;
    if (playkey(5) || playkey(3)) $panim=$panim+3;end;
        
    spdx=6
    if (playkey(3)) $psx=$psx-0.9;end;
    if (playkey(5)) $psx=$psx+0.9;end;
    if ($psx>spdx) $psx=spdx;end;
    if ($psx<-spdx) $psx=-spdx;end;
    if (playkey(5)==0) if ($psx>0) $psx=$psx-1.3; if ($psx<0) $psx=0;end;end;end;
    if (playkey(3)==0) if ($psx<0) $psx=$psx+1.3; if ($psx>0) $psx=0;end;end;end;
        
    $px=$px+($psx*delta)-($spd*delta);
    $py=$py+($psy*delta);
    if ($py>$jscrh && $endofgame==0) $endofgame=1;PlaySFX(97);end;
    // floor
        
    $wpsy=$psy;

    if (($py-($flr+(2.5*delta))).abs()<5*delta && $psy>0) $psy=0;$py=$flr;if ($wpsy<0.5) $combo=0;end;end;
    if ((playkey(0) || playkey(10)) && $mdown==0 && $psy==0) $psy=-8;PlaySFX(1);$mdown=1;end;
    if (playkey(0)==0 && playkey(10)==0) $mdown=0;end; 
    $psy=$psy+0.24;
    
    
    if ($psy>8) $psy=8;end;

    font(16);
    20.times() do |b|
        ID=b*10;
        if ($beep[ID]>0 && $beep[ID+3]>0)
            ink(0,$beep[ID+3]);
            $beep[ID+1]=$beep[ID+1]-$spd*delta;
            $beep[ID+3]=$beep[ID+3]-0.01;
            $beep[ID+2]=$beep[ID+2]-2.5*delta;
            text($beep[ID+1],$beep[ID+2],$beep[ID],1,1)
        end;
    end;

    ink(26,0.8);font(12);
    Shadowtext(1,1,'[DEL] to quit',0,0);
    
    ink(22,1);font(16)
    Shadowtext($jscrw/2,$jscrh-4,'Score : '+PadRight($score,'0',8),1,:bottom);
    

    // For the minute, no pause..  must fix
    if (playkey(1) && $EndofGame==0) $EndofGame=99; end;
    if ($EndofGame!=0) EndGame(delta);end;
end;



ERRORS

YOUR BROWSER DOES NOT SUPPORT HTML5!

Please use one of these instead

Our games cannot run in your browser