LUCK 3.0, Day 3 of 1

Ok, I must confess I am obsessed.

This is intended to be the final version, I dont think I can manage to get something more into it!

For this version I added:

  • Move using directional keys
  • Added Enemies: They chase you down and quickly reduce your oxygen!
  • Enemies are quicker as you go into the dungeon.
  • Combat against enemies, you can choose to run or face them in deadly hand to flipper combat!
  • Enemies don’t run into walls
  • Press space after you win or lose so you can see your results (really!)
  • Fixed bug on random generation (wasnt working for new levels)

Picture:

LUCK 3.0, Source Code Included
LUCK 3.0, Source Code Included

So far, LUCK is a <1KBRL With the following features

  • Move using the directional keys
  • Pick up at least 10 relics through the 20 dungeon floors
  • Your oxygen drops steadly, your time is limited
  • Line of Sight, risk exploring the dungeon for the relics or descending for better LUCK
  • Random Level Generation
  • Themed Levels
  • Combat hand to hand with progressively harder enemies

Download Executables and Source

The 1023 bytes Java source code follows

import sz.csi.jcurses.*;class D{int a,b,c,d,k,l,o,p,q,w,v,r,
i,e=600,f,h;boolean m[][];int r(){return(int)(Math.random()*
17+1);}int[]s=new int[]{0,0,-1,1,-1,1,0,0};void a(int x,int
y,char h){j.print(x,y,Math.abs(a-x)+Math.abs(b-y)<7?h:' ',1+
v%13);}public static void main(String[]p){new D();}D(){
j.cls();for(;;){if(q==a&w==b){m=new boolean[20][20];for(i=0;
++i<20;){m[r()][r()]=m[0][i]=m[19][i]=m[i][0]=m[i][19]=true;
}q=r();w=r();a=r();b=r();o=r();p=r();v++;m[q][w]=m[o][p]=
false;}if(o==a&p==b){o=40;p=3;r++;}d=-1;while(d++<19){c=-1;
while(c++<19)a(c,d,m[c][d]?'#':'.');}j.print(2,22,"LCK L"+v+
"E"+e+"R"+r+" ",7);j.print(a,b,"@",12);a(q,w,'>');a(o,p,'%'
);a(k,l,'&');i=j.inkey().code;d=s[i%4];c=s[4+i%4];if(a+d==k&
b+c==l){if(r()>8){k=r();l=r();}}else if(!m[a+d][b+c]){a+=d;b
+=c;}f=Integer.signum(a-k);h=Integer.signum(b-l);if(k+f==a&l
+h==b)e-=5;else if(e%(5-(int)(v/4.5d))==0&!m[k+f][l+h]){k+=f
;l+=h;}if(--e<0|v>20)break;}j.print(2,23,r>9?"WON":"DIE",4);
j.waitKey(40);}JCursesConsoleInterface j=new
JCursesConsoleInterface();}

Stats

Aprox. Work Time: 10:00 (6:00+4:00)
Source Files: 1
LOC: 1
SLOC-L: 15

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s