@@ 1,13 1,13 @@
<!DOCTYPE html>
<html lang="en">
<head> <meta charset="utf-8">
- <title>Qube*Cat - 0.9.2 </title>
+ <title>Qube*Cat - 1.0.0 </title>
<style>@font-face { font-family: HUD; src: url('f/ShareTechMono-Regular.ttf'); }</style>
</head>
<body style="margin: 0;">
<div style="display: flex; justify-content: center;">
<canvas id="the-canvas" width="640" height="480" tabindex="1"/>
- <script>var VERSION = "0.9.2";</script>
+ <script>var VERSION = "1.0.0";</script>
<script>"use strict";
var APP={name:"Qube*Cat",nickname:"qube-cat",screen:{width:640,height:480},fps:30};
function array_p(x){"( x -- f) Is x an Array?";return (x.constructor===Array);};
@@ 36,7 36,7 @@ var player={i:22,t:-1,x:0,face:0,frame:0
var yarnball={i:22,target:-1,x:0,frame:0,tick:0,state:"HIDE",anim:{IDLE:[[0,99]],JUMP:[[2,10],[1,10],[2,99]],DROP:[[0,10],[2,2],[0,99]]}};
function draw_tile(cx,offset,top,left,right){"( cx offset top left right --) Draw block to jump on.";(cx["fillStyle"]=left);(draw_path(cx,(adjust([[0,16],[32,32],[32,64],[0,64]],offset))));((cx.fill)());(cx["fillStyle"]=right);(draw_path(cx,(adjust([[32,64],[32,32],[64,16],[64,64]],offset))));((cx.fill)());(cx["fillStyle"]=top);(draw_path(cx,(adjust([[0,16],[32,0],[64,16],[32,32]],offset))));return ((cx.fill)());};
function draw_tile_mini(cx,offset,top,left,right){"( cx offset top left right --) Draw mini-block for HUD.";{var a=[[left,[[0,4],[8,8],[8,16],[0,12]]],[right,[[8,16],[8,8],[16,4],[16,12]]],[top,[[0,4],[8,0],[16,4],[8,8]]]],n=a.length,i=0;while((true&&true&&(i<n))){(((x) => {(cx["fillStyle"]=(first(x)));(draw_path(cx,(adjust((second(x)),offset))));((cx.fill)());return (i+=1);})(a[i]));};undefined;}(cx["strokeStyle"]="black");(draw_path(cx,(adjust([[0,4],[8,0],[16,4],[16,12],[8,16],[0,12]],offset))));return ((cx.stroke)());};
-function draw_hud(cx,game,player_3,colour){"( cx game player /colour/ --) Draw information overlay.";(colour=(colour||"black"));(cx["font"]="20px HUD");(cx["fillStyle"]=colour);((cx["fillText"])(("Score: "+player_3.score),32,40));((cx["fillText"])(("Falls: "+player_3.falls),32,60));((cx["fillText"])(game.level.name,32,128));{var i=0,t=game.level.turn.length;while((true&&true&&(i<t))){(((i_4) => {(draw_tile_mini(cx,[(32+(32*i_4)),(128+20)],game.level.turn[i_4],(first(game.level.base)),(second(game.level.base))));return (i+=1);})(i));};undefined;}((("PAWS"===game.level.state)===false)?undefined:((() => {return (((p) => {(cx["font"]="64px HUD");(cx["fillStyle"]="red");((cx["fillText"])("!PAWSED!",((first(p))-64),((second(p))+64)));(cx["font"]="20px HUD");return ((cx["fillText"])("Cat is taking a little break...",((first(p))-64),((second(p))+84)));})((whereis(game.level.tmobs,player_3))));})()));(((("WINS"===game.level.state)||("WAIT"===game.level.state))===false)?undefined:((() => {(cx["font"]="24px HUD");(cx["fillStyle"]=colour);return ((cx["fillText"])("Press [space] or [enter] to continue...",64,(APP.screen.height-100)));})()));return (((x,y) => {(cx["font"]="10px HUD");(cx["fillStyle"]=colour);((cx["fillText"])(("fps: "+game.log.fps),x,y));return ((cx["fillText"])(("v: "+VERSION),x,(y+10)));})((APP.screen.width-64),(APP.screen.height-26)));};
+function draw_hud(cx,game,player_3,colour){"( cx game player /colour/ --) Draw information overlay.";(colour=(colour||"black"));(cx["font"]="20px HUD");(cx["fillStyle"]=colour);((cx["fillText"])(("Falls: "+player_3.falls),32,40));((cx["fillText"])(game.level.name,32,128));{var i=0,t=game.level.turn.length;while((true&&true&&(i<t))){(((i_4) => {(draw_tile_mini(cx,[(32+(32*i_4)),(128+20)],game.level.turn[i_4],(first(game.level.base)),(second(game.level.base))));return (i+=1);})(i));};undefined;}((("PAWS"===game.level.state)===false)?undefined:((() => {return (((p) => {(cx["font"]="64px HUD");(cx["fillStyle"]="red");((cx["fillText"])("!PAWSED!",((first(p))-64),((second(p))+64)));(cx["font"]="20px HUD");return ((cx["fillText"])("Cat is taking a little break...",((first(p))-64),((second(p))+84)));})((whereis(game.level.tmobs,player_3))));})()));(((("WINS"===game.level.state)||("WAIT"===game.level.state))===false)?undefined:((() => {(cx["font"]="24px HUD");(cx["fillStyle"]=colour);return ((cx["fillText"])("Press [space] or [enter] to continue...",64,(APP.screen.height-100)));})()));return (((x,y) => {(cx["font"]="10px HUD");(cx["fillStyle"]=colour);((cx["fillText"])(("fps: "+game.log.fps),x,y));return ((cx["fillText"])(("v: "+VERSION),x,(y+10)));})((APP.screen.width-64),(APP.screen.height-26)));};
function whereis(rack,mob){"( rack mob -- (x y)) Convert mob location on rack to screen coords.";return ((((undefined===mob.target)||(-1===mob.target))===false)?(((p) => {return (((t) => {return (((dx) => {return (((dy) => {return ((() => {return [((first(p))+(mob.x*dx)),((second(p))+(mob.x*dy))];})());})(((second(t))-(second(p)))));})(((first(t))-(first(p)))));})(rack[mob.target]));})(rack[mob.i])):rack[mob.i]);};
function draw(screen,cx){"( screen cx --) Draw current scene.";((cx["clearRect"])(0,0,screen.width,screen.height));(cx["strokeStyle"]="red");((cx["strokeRect"])(0,0,screen.width,screen.height));(((base,turn) => {return ((() => {var i=0,t=Game.level.layout.length;while((true&&true&&(i<t))){(((i_5) => {(((1===Game.level.layout[i_5])===false)?undefined:((() => {return (draw_tile(cx,Game.level.tiles[i_5],turn[Game.level.tops[i_5]],(first(base)),(second(base))));})()));return (i+=1);})(i));};undefined;return undefined;})());})(Game.level.base,Game.level.turn));(((p) => {return (((f) => {return ((() => {((("FALL"===player.state)===false)?undefined:((() => {return (p=[(first(p)),((second(p))+(first(player.x)))]);})()));((("DROP"===player.state)===false)?undefined:((() => {return (p=[(first(p)),((second(p))-(first(player.x)))]);})()));return ((cx["drawImage"])(Sprites.cat,(128*(first(f))),(128*player.face),128,128,(first(p)),(second(p)),128,128));})());})((frame_get(player))));})((whereis(Game.level.tmobs,player))));(((!("HIDE"===yarnball.state))===false)?undefined:((() => {return (((p) => {return ((() => {((("DROP"===yarnball.state)===false)?((("JUMP"===yarnball.state)===false)?undefined:((() => {return (p=[(first(p)),((second(p))-(64*((Math.sin)((yarnball.x*3.14159)))))]);})())):((() => {return (p=[(first(p)),((second(p))-(first(yarnball.x)))]);})()));return ((cx["drawImage"])(Sprites.mob,0,0,128,128,(first(p)),(second(p)),128,128));})());})((whereis(Game.level.tmobs,yarnball))));})()));return (draw_hud(cx,Game,player));};
function level_pawsing(level){"( level --) Pause gameplay.";((level)["state"]="PAWS");return ((level)["tick"]=0);};