Skip to content

Instantly share code, notes, and snippets.

@moriyoshi
Created April 19, 2012 02:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moriyoshi/2417847 to your computer and use it in GitHub Desktop.
Save moriyoshi/2417847 to your computer and use it in GitHub Desktop.
ツンパァードラグーン / ゲーム説明: あなたはパンティーが降ってきてドラゴンが襲ってくる空間に閉じ込められました。↑キーでジャンプしてドラゴンを避けながら←→キーで移動し素早くパンティーをゲットしてください。
javascript:(function(d,rd,im,w,h,xx,yy,l,s,f,r,j,t,dg,pt){im.src="data:image/gif;base64,R0lGODlh2AEIAIABAAAAAP///yH5BAEKAAEALAAAAADYAQgAAAL+jI+py+0PYopA0SlD1Wjv11xYR31lZojnp6lrKsIxSNf2Eb+4m59yubugJLrRsILaKY8/j6/ZNPWAraW0CsNWM9zizbJifWmzltiMuY7GuGxQ6Yb/4qT11hRPsvc2ohPehRVoV1eopVc3iCjk98f0eAVJlySZBYnkRyfzFcYxwVdz5mmxIEVZ1qemuSl3F7VaqJInClprl2l5VmnYOtubiPnbCYTrmmuFXMqymxlspiiGCuKRMkptG6JLuxjZPcbUSzUnKNpYdooujY196QJmNeWO1gmbewrmM+x9zM9zL9doXpEZ4lhx+oRn1DpCHBBpsfTqmUMH4CapM4eqWEWoTwXrLQSlL5mhYsL2HaJ1p8e7YOZOSnTE6KIqlxKjOCEYbSKZNhyvfeTF890nmy9RZqs2Us9GciI3Lsv58yezP8YGAXWjcaYkeUnJOTMWCyZVmr4MxhSoVWeoIVijDu2gMGibmy+8rH1KTMeTpPGepjmi1u23bgWp7A2pjBG8vlgxZqX5xCExr1DCdfTLj2xRdmcFT5L70FrPNKE9mz6NOrXq1axbgyoAADs=";yy=h-8;im.onload=function(n,c,di,k,z){n=d.createElement("canvas");n.width=w;n.height=h;n.setAttribute("style","background-color:#ffe;width:512px;height:512px;position:absolute;left:0;top:0");d.body.appendChild(n);d.onkeydown=function(e){k=e.which;return false};d.onkeyup=function(e){k=0};c=n.getContext("2d");function di(x,y,a){c.drawImage(im,a*8,0,8,8,x,y,8,8)}function ds(x,y,s,i){for(i in s){di(x+i*8,y,s.charCodeAt(i)-32)}}function ht(xx,yy,x,y,a,b){a=xx+8,b=yy+8;return(a>=x&&a<x+8||xx>=x&&xx<x+8)&&(b>=y&&b<y+8||yy>=y&&yy<y+8)}z=setInterval(function(i,u){c.clearRect(0,0,w,h);ds(0,0,"SCORE "+s);ds(0,8,"LIFE");c.fillStyle="#000";c.fillRect(40,8,f,8);if(f<=0){ds(24,64,"GAME OVER");clearInterval(z)}di(xx,yy,l);k==37&&(l=(l|2)^1,xx--);k==39&&(l=l&9^1,xx++);!r&&k==38&&(r=1,j=-5);r&&(yy+=j,j++,yy==h-8&&(r=j=0));for(i in dg){if(dg[i]){with(dg[i]){di(x,y,(l^=1));ht(xx,yy,x,y)&&f--;x--;if(x<-8){dg[i]=0}}}else{!(t&64)&&rd()>0.998&&(dg[i]={x:w,y:h-8,l:12})}}for(i in pt){if(pt[i]){with(pt[i]){di(x,y,l);y++;if(y>=h||(ht(xx,yy,x,y)&&(s=Math.max(0,s+(u=300-(l&1)*400))))){pt[i]=0}}}else{!(t&32)&&rd()>0.995&&(pt[i]={x:0|w*rd(),y:0,l:2|2*rd()})}}t++},50)}})(document,Math.random,new Image(),128,128,0,0,8,0,64,0,0,0,[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment