Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » The 2004 Allegro ScreenHack

This thread is locked; no one can reply to it. rss feed Print
The 2004 Allegro ScreenHack
Billybob
Member #3,136
January 2003

I updated my first post so that it has my latest code. I squeezed it even more by replacing two defines with functions. I got a goodly amount of room to maybe put another small feature in...but I'm not sure what to put in?

zaphire
Member #1,273
September 2000
avatar

Wow... this was strangely amusing, in a very disturbing way. Anyways, here's my mini version of NiM.

1#include <allegro.h>/* MiniNiM 2004 - http://zaphire.ca */
2#include <math.h>/*Damn you for taking up another line, math.h*/
3typedef int i;typedef void v;typedef float f;BITMAP *b,*l;f ox,oy;struct W;
4struct B{f x,y,a;W *w;v ud(){x+=cos(a)*4;y+=sin(a)*4;}v re(){
5circlefill (b,x,y,2,4);}};B bs[2];struct W{W(){o=0;h=10;j=0;r=0;a=-3.14;m=0
6;}i x,y,h,j,r,m,D,J,S,L,kr,u,T,o;f a;v dig(){circlefill(l,x+cos(a)*2,y-5+
7sin(a)*2,4,0);};v sh(){if(m<0){B b;b.x=x;b.y=y-5;b.a=a;b.w=this;bs[o]=b;m=20
8;}}v ud(){m--;ox=x;oy=y;y++;if(key[T])dig();else if(key[S])sh();if(key<u>)a+=
9r?-.08:.08;if(key[D])a+=r?.08:-.08;if(key[J]){if(j>0){y-=10;j--;}}
10else if(j<10)j++;if(key[L]){x--;if(r){a=3.14f-a;}r=0;}if(key[kr]){x++;if(!r){a
11=3.14-a;}r=1;}while(getpixel(l,x,y)!=0){y--;if(y-oy<-5){x=ox;y=oy;break;}}if(h>
120){ellipsefill(b,x,y-4,8,4,2);circlefill(b,x-6+(12*r),y-10,4,2);line(b,x+(r?5:-
135),y-5,x+(r?5:-5)+cos(a)*10,y-5+sin(a)*10,5);line(b,x-5,y-18,x-5+h,y-18,7);}}
14};W z[2];main(){z[0].x=100;z[0].y=100;z[1].x=200;z[1].y=100;z[0].u=84;z[0].L=
1582;z[0].D=85;z[0].kr=83;z[0].J=108;z[0].S=106;z[0].T=104;z[1].u=23;z[1].L=1;z[1
16].D=19;z[1].kr=4;z[1].J=107;z[1].S=105;z[1].T=103;z[1].o=1;allegro_init();
17install_keyboard();set_gfx_mode(GFX_AUTODETECT,320,200,0,0);b=create_bitmap(320
18,200);l=create_bitmap(320,200);clear_to_color(l,1);i c;while (!key[59]){vsync()
19;clear_bitmap(b);draw_sprite(b,l,0,0);for(c=0;c<2;c++){z[c].ud();}for(c=0;c
20<2;c++){bs[c].ud();bs[c].re();for(i d=0;d<2;d++){if(getpixel(l,bs[c].x,
21bs[c].y)!=0){circlefill(l,bs[c].x,bs[c].y,3,0);bs[c].y=-100;}else if((abs(bs[c]
22.x-z[d].x)<10)&&(abs(bs[c].y-z[d].y)<10)&&(&z[d]!=bs[c].w)){bs[c].y=-100;bs[c].
23a=0;z[d].h--;if(z[d].h<1)goto E;}}}blit(b,screen,0,0,0,0,320,200);}E:if(z[0].h>
240)textout(b,font,"P1Win",140,80,4);else textout(b,font,"P2Win",140,80,4);blit(b
25,screen,0,0,0,0,320,200);while (!key[KEY_ESC]);}END_OF_MAIN();

Player1
-------
Move - arrow keys
Dig - hold shift
Jump - alt
Shoot - control

Player2
-------
Move - ASDW
Dig - other shift
Jump - other alt
Shoot - other control

This was built with MSVC6, so I may be benefiting from M$'s lack of compliance with ANSI standards in the scoping department.
This hack has been quite bad for my coding practices. I tried to use OPP as much as possible, but it was better to use structs than classes because I didn't have to add "public:", and using std::vectors took up way too much space.:'(
Well now that that's over, back to my precious OOP-oriented jobs. Thank goodness for hard drives larger than 2kb. ^^;;

CGamesPlay
Member #2,559
July 2002
avatar

What, you think making it a struct suddenly means it's not OO? You think a struct can not have polymorphism, static members, or anything a class can't? You're the second person to have done that in this thread. You people are weird.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

zaphire
Member #1,273
September 2000
avatar

Structs in C++ are just wrappers to public classes; but it still feels gross to use them. The point I was making was that there just wasn't enough room for the OOP hierarchy I had in mind. (a base positional object, a particle class and a class for moving on a bitmap derived from that, derive Bullet and Worm classes from the movement class, derive Human and AI control classes from that etc) The lack of space forced me to use non-OOP solutions which I wouldn't have used otherwise. Yes, I could have derived to my heart's content, if there had been room to do so while still being able to implement the basic things that I wanted to have in there.

So yeah, it was fun coming up with the smallest solutions, rather than the fastest/easiest to develop.

Fladimir da Gorf
Member #1,565
October 2001
avatar

I figured out I may not have time to continue my screenhack until next week. Well, the code's 26.2 lines now (about 25 if you don't count the damned first line :P), but I'll figure out eventually how to compress the code even further. And no, I won't strip out any graphics. ;)

1#include <allegro.h> /* -- TUNNEL B0.001 -- by "Fladimir da Gorf" */
2#define o(v,end)for(int v=0;v<end;v++) /* Arrow keys to move, space to fire */
3typedef int I;BITMAP *b,*m,*pl;I hp,v,k,W=320,H=200,pc=0x3C4AB4,e[99],r[99],h[99
4],n,l=1,Q;float x,y,xs,ys,t[99],w[99],ts[99],ws[99],E,T,ES,TS,CT;void D(BITMAP*b,
5I cx,I cy,I d){if(!v)v=(d=((I*)m->line[I(y)+cy-100])[I(x)+cx-160])?d:0;else((I*)
6b->line[cy])[cx]=v;}I L(I x,I y){v=0;do_line(b,160,100,x,y,0,D);}I M(){o(x,W){L(
7x,0);L(x,199);}o(y,H){L(0,y);L(W-1,y);}}I R(I x,I y,I r,I l){if(l){circlefill(m,
8x,y,r,0);I a=(rand()%100)?1:2;o(i,a)R(x+rand()%(2*r)-r,y+rand()%(2*r)-r,(r+rand(
9)%10-5)>?10<?40,i?l/2:l-1);}}I G(){o(y,m->h){o(x,m->w){I c=(2*x+y)&127;putpixel(
10m,x,y,makecol(c+9,c+5,c));}}x=500;y=500;R(x,y,20+rand()%50,2500);rect(m,0,0,999,
11999,0x1C1A17);o(u,3*l)while(getpixel(m,e<u>,r<u>)){e<u>=rand()%m->w;r<u>=rand()%
12m->h;h<u>=1;}hp=10;}float M(I a){return fixtof(a);}I tr=0x40000,am=0xFFFFFF;I F(
13float f){xs+=f*M(fcos(k));ys+=f*M(fsin(k));}I main(){srand(time(0));allegro_init
14();install_keyboard();set_color_depth(32);set_gfx_mode(0,W,H,0,0);b=create_bitm\
15ap(W,H);m=create_bitmap(999,999);pl=create_bitmap(14,10);clear_to_color(pl,0xFF\
1600FF);triangle(pl,0,0,14,5,0,10,pc);G();while(!key[59]){clear_to_color(b,0x201B\
1715);if(key[84])F(.4);if(key[85])F(-.25);if(key[82])k=(k-tr)&am;if(key[83])k=(k+
18tr)&am;x+=xs;y+=ys;if(getpixel(m,x,y)){x-=xs;y-=ys;xs=ys=0;}n=0;o(u,99){if(h<u>)
19{n++;float N=x-e<u>,M=y-r<u>,L=sqrt(N*N+M*M)/5;if(!(Q%(9*(u+4)))){t<u>=e<u>;w<u>
20=r<u>;ts<u>=N/L;ws<u>=M/L;}circlefill(b,e<u>-x+160,r<u>-y+100,9,0xA24D1A);if(t[u
21]){t<u>+=ts<u>;w<u>+=ws<u>;if(getpixel(m,t<u>,w<u>))t<u>=0;circle(b,t<u>-x+160,w
22<u>-y+100,2,0xFDFDDA);}}}Q++;if(!n){l++;G();}M();if(--CT>0){E+=ES;T+=TS;o(u,99)
23if(h<u>&&(E-e<u>)*(E-e<u>)+(T-r<u>)*(T-r<u>)<85){CT=0;--h<u>;}if(getpixel(m,E,T)
24)CT=0;circle(b,E-x+160,T-y+100,2,0x000000);}else if(key[75]){E=x;T=y;ES=M(fcos(k
25))*9;TS=M(fsin(k))*9;CT=30;}Q++;rotate_sprite(b,pl,153,95,k);o(u,99){if(getpixel
26(b,t<u>-x+160,w<u>-y+99)==pc){t<u>=0;if(!--hp){exit(0);}}}blit(b,screen,0,0,0,0,
27320,200);}}END_OF_MAIN()

Gameplay:
Use left and right arrows to turn, up arrow to accelete, down arrow for inverse acceleration. Use space to fire the orange circular turrets. Dodge the turret fire, you'll resist only 10 of their bullets. You'll advance to a new level after all turrets are destroyed.

Hints:
The ship will accelerate quite fast, so don't press up for too long at once. Flying circles around the enemy turrets may help to dodge their fire. Never stay still! ;)

Issues:
There's no way to know how much hull you have left or what level you're playing. The game just quits if you die. The game may run too fast in high-end PCs (if that's an issue, just add a rest(something) -function before the second last '}'-character). And sometimes the game may just crash. Hopefully it doesn't happen too often. There are some minor graphical issues that can't be fixed, as that adds extra code. You may pass through the wall if you fly far too fast, and if you happen to fly out of the map this way, it's crash 'n' burn. The speed of the enemy bullets seems to increase if you fly too far from the enemies.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Chris Katko
Member #1,881
January 2002
avatar

Quote:

What, you think making it a struct suddenly means it's not OO? You think a struct can not have polymorphism, static members, or anything a class can't?

Private and protected members? Perhaps?

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Zaphos
Member #1,468
August 2001

Etwinox: In C++ they a struct is allowed to have private and protected members. It just defaults to public.

Goodbytes
Member #448
June 2000
avatar

zaphire: Man, is it just me, or have you not posted here in like... either forever or a really long time? Keep up the Canadian gamedev bit! :)

Here's another "looks like the compo is progressing nicely" bit. I suppose I'll have to eventually draw the line somewhere...

So let's say that the deadline for a completed entry is Monday, February 16 2004. I realize that with time zones, that's a bit nonspecific, so... just try to have your entries in by around then, because that's probably about when we'll start the judging process. If you delay it past that time, you might run into some problems wherein I'll already have made the archive and can't be arsed to add your entry to it. :)

Fladimir: but maybe I'll give you some extra time if you need it. (unable to finish until next week you said?)


--
~Goodbytes

zaphire
Member #1,273
September 2000
avatar

No... I haven't posted here in ages...
...but believe, me I've been very busy with the Canadian gamedev bit; more specifically the Winnipeg gamedev bit! I'm currently working for three Winnipeg gamedev start-up companies, one of them being my own. ;) Check out my site below for more info.

Thomas Fjellstrom
Member #476
June 2000
avatar

I like that.. Extream Curling. Deffinitly a Canadian company ;)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

23yrold3yrold
Member #1,134
March 2001
avatar

zaphire: Sweet. We'll get Josh Bolduc back and make Winnipeg the next Silicon Valley. 8-)

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

zaphire
Member #1,273
September 2000
avatar

I'm dumb!...
It was funny, I was talking to one of my girlfriend's friends... he was trying to convince me to move all operations to Vancouver. :P I was like.. No! There's something about being able to develop in an environment in which you can freeze to death on any given day that just makes it magical.

Fladimir da Gorf
Member #1,565
October 2001
avatar

Goodbytes said:

Fladimir: but maybe I'll give you some extra time if you need it. (unable to finish until next week you said?)

Yeah, that's true... :( I'm busy during the week and away most of the weekend. How about the next Wednesday?

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

lillo
Member #303
April 2000
avatar

Hi all, nice entries here!

I finally found the time and finished my own one... Here it is:

1#include <allegro.h>//Monospace Shooter 80x25 lines, in memory of Milo Sedlacek
2BITMAP *b[5],*r;int i,j,x,y,L,p,f,*l,W=320,H=200;volatile int t;int D[]={10,648
3,15,657,26,717,35,165,36,322,-1021313012,-2122071033,1597440,25149544,67100736,
48192,103284803,-1032834184,-2121207582,1644691152,133308448,-288325278,-103281\
50256,3373058,1124075048,8192,3145728,871893760,272880001,360844072,1217207235,\
6-1444069639,805047120,7356545,8384526,22511061,955345};void T(){t++;}BITMAP*G(\
7int*g,int s){int b=0,z=s&31;s>>=5;r=create_bitmap(s,z);z*=s;char*d=r->dat;for(;
8z;z--,d++){if(*g&(1<<b))*d=11;else*d=0;if(++b>31){b=0;g++;}}return r;}void main
9(){struct{int t;float x,y,vx,h;}e[W],*m=e+100,*o=e+H,*C,*M,*X,N={0,};allegro_i\
10nit();install_keyboard();install_int(T,15);set_gfx_mode(0,W,H,0,0);for(i=0,l=D;
11i<5;i++)b<i>=G(D+*l++,*l++);l=D;r=create_bitmap(W,H);t=x=f=p=0;y=L=96;memset(e,
120,sizeof(N)*W);for(;;){clear(r);for(i=99,C=o,M=m;i;i--,C++,M++){if(!C->t&&!(ra\
13nd()%50)){C->t=1;C->x=W;C->y=rand()%H;C->vx=-(rand()%9)/6.-1;}if(C->t==1){putp\
14ixel(r,C->x,C->y,11);if(C->x<0)*C=N;}if(C->t&2){circlefill(r,C->x+5,C->y+5,MIN(
15C->h,15),11);if(C->h>15)circlefill(r,C->x+5,C->y+5,C->h-15,0);C->h++;if(C->h>30
16)*C=N;}C->x+=C->vx;if(M->t==0&&key[75]&&!f){f=15;*M=N;M->t=1;M->x=x+20;M->y=y+3
17;M->vx=3;}if(M->t){if(M->x>W)M->t=0;draw_sprite(r,b[4],M->x,M->y);for(j=99,X=e;
18j;j--,X++){if(X->t&&M->x+9>X->x&&M->x<X->x+21&&M->y+2>X->y&&M->y<X->y+15){X->t=
192;X->h=0;*(X+H)=*X;*M=*X=N;break;}}}M->x+=M->vx;}for(i=99,C=e;i;i--,C++){if(C->
20t)draw_sprite(r,b[C->t],C->x,C->y);if(C->t==2)C->y+=sin(C->h);C->h+=.03;C->x+=C
21->vx;if(C->x<-20)*C=N;}draw_sprite(r,*b,x,y);blit(r,screen,0,0,0,0,W,H);while(!
22t);t=0;L--;if(!L){L=*l;C=e+p;for(i=0;i<16;i++,L/=4,C++){*C=N;C->t=L&3;C->x=W+(i
23%4)*24;C->y=((i/4)*50+C->t*25)%200;C->vx=-2./C->t;C->h=p;p++;if(p>99)p=0;}L=96;
24l++;if(l>D+36)l=D;}if(f>0)f--;if(key[82]&&x>0)x--;if(key[83]&&x<300)x++;if(key[
2584]&&y>0)y--;if(key[85]&&y<192)y++;if(key[59])break;}}END_OF_MAIN()// Finished!

Yes, it's a (very) stripped down version of the old Monospace Shooter (for those who don't know it, it's a QB game by Milo Sedlacek, who passed away some years ago).

Arrow keys to move, space to fire, ESC to exit.
It features three enemies, but none of them fires at you... Not enough space to handle enemy fire. Also not enough space to handle more complex enemy movements, nor enemy/player collisions... But you get 5 hardcoded sprites, scrolling starfield, multiple player bullets, explosions, static level data that repeats forever and fun!

Feedback is welcome!

--
Angelo Mottola
lillo AT users DOT sourceforge DOT net
Enhanced Creations++

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

There's something about being able to develop in an environment in which you can freeze to death on any given day that just makes it magical.

"Magical" ... that's not exactly the word that went through my mind when I woke up to -54C 2 weeks ago :P

Mind you, I imagine my Win98 box freezes in any given environment anyway ;)

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

"Magical" ... that's not exactly the word that went through my mind when I woke up to -54C 2 weeks ago

And I thought the -38c we got a couple weeks ago was bad... Sure with windchill it was -50c... The entire week it was -50c with windchill.. Damn cold :)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

23yrold3yrold
Member #1,134
March 2001
avatar

Yeah, that -54C is with the windchill. Before then, I'd never seen it go past -44C in Winnipeg. Then it hit -48C, then -50C (couldn't believe it; halfway to double digits), then -54C (#@&%!!) ... oy.

Anyway, enough OT :P ...

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

zaphire
Member #1,273
September 2000
avatar

Winnipeggers are just bred tougher because of the harsh conditions; henceforth we can survive through equally harsh crunch times.

Matthew Leverton
Supreme Loser
January 1999
avatar

This was written for 20 semi's or less, so it doesn't fit in 25 lines. (Only 16 semi's, and no cheating using commas to execute multiple functions...)

#SelectExpand
1#include <allegro.h> 2#define B(x,y) b->line[x][y] 3#define P (B(22,7)) 4#define R (B(22,8)) 5int p[7][4][4][2]={{{{0,0},{0,1},{1,0},{1,1}},{{0,0},{0,1},{1,0},{1,1}},{{0,0},{ 60,1},{1,0},{1,1}},{{0,0},{0,1},{1,0},{1,1}}},{{{0,0},{1,0},{2,0},{3,0}},{{0,0},{ 70,1},{0,2},{0,3}},{{0,0},{1,0},{2,0},{3,0}},{{0,0},{0,1},{0,2},{0,3}}},{{{1,0},{ 80,1},{1,1},{2,1}},{{0,0},{0,1},{1,1},{0,2}},{{0,0},{1,0},{2,0},{1,1}},{{1,0},{0, 91},{1,1},{1,2}}},{{{2,0},{0,1},{1,1},{2,1}},{{0,0},{0,1},{0,2},{1,2}},{{0,0},{1, 100},{2,0},{0,1}},{{0,0},{1,0},{1,1},{1,2}}},{{{0,0},{0,1},{1,1},{2,1}},{{0,0},{1, 110},{0,1},{0,2}},{{0,0},{1,0},{2,0},{2,1}},{{1,0},{1,1},{0,2},{1,2}}},{{{0,0},{1, 120},{1,1},{2,1}},{{1,0},{0,1},{1,1},{0,2}},{{0,0},{1,0},{1,1},{2,1}},{{1,0},{0,1} 13,{1,1},{0,2}}},{{{1,0},{2,0},{0,1},{1,1}},{{0,0},{0,1},{1,1},{1,2}},{{1,0},{2,0} 14,{0,1},{1,1}},{{0,0},{0,1},{1,1},{1,2}}}};int main(void){BITMAP *b;if( 15allegro_init()?1:set_gfx_mode(GFX_AUTODETECT_WINDOWED,192,352,0,0)<0?1: 16install_timer()<0?1:install_keyboard()<0?1:!(b=create_bitmap_ex(8,SCREEN_W, 17SCREEN_H+50))?1:0)return 1;clear(b);rect(b,0,0,11,21,makecol(255,0,0));B(22,8)=( 18B(22,7)=(time(NULL)+(B(22,1)=(B(22,2)=1)+4))%7)*0;while(!key[KEY_ESC]&&B(22,0)== 190){while(retrace_count){if((B(22,1)+=(key[KEY_LEFT]&&!(B(22,4)%4)&&!(B(B(22,2)+p 20[P][R][0][1],B(22,1)+p[P][R][0][0]-1)+B(B(22,2)+p[P][R][1][1],B(22,1)+p[P][R][1] 21[0]-1)+B(B(22,2)+p[P][R][2][1],B(22,1)+p[P][R][2][0]-1)+B(B(22,2)+p[P][R][3][1], 22B(22,1)+p[P][R][3][0]-1))?-1:key[KEY_RIGHT]&&!(B(22,4)%4)&&!(B(B(22,2)+p[P][R][0 23][1],B(22,1)+p[P][R][0][0]+1)+B(B(22,2)+p[P][R][1][1],B(22,1)+p[P][R][1][0]+1)+B 24(B(22,2)+p[P][R][2][1],B(22,1)+p[P][R][2][0]+1)+B(B(22,2)+p[P][R][3][1],B(22,1)+ 25p[P][R][3][0]+1))?1:0))&&(B(22,2)+=((!(B(22,4)++%32)||key[KEY_DOWN])&&!(B(B(22,2 26)+p[P][R][0][1]+1,B(22,1)+p[P][R][0][0])+B(B(22,2)+p[P][R][1][1]+1,B(22,1)+p[P][ 27R][1][0])+B(B(22,2)+p[P][R][2][1]+1,B(22,1)+p[P][R][2][0])+B(B(22,2)+p[P][R][3][ 281]+1,B(22,1)+p[P][R][3][0]))?1:0))&&(1+(B(22,8)=(B(22,8)+((key[KEY_UP]&&!(B(22,4 29)%4)&&!(B(B(22,2)+p[P][(B(22,8)+1)%4][0][1]+1,B(22,1)+p[P][(B(22,8)+1)%4][0][0]) 30+B(B(22,2)+p[P][(B(22,8)+1)%4][1][1]+1,B(22,1)+p[P][(B(22,8)+1)%4][1][0])+B(B(22 31,2)+p[P][(B(22,8)+1)%4][2][1]+1,B(22,1)+p[P][(B(22,8)+1)%4][2][0])+B(B(22,2)+p[P 32][(B(22,8)+1)%4][3][1]+1,B(22,1)+p[P][(B(22,8)+1)%4][3][0]))?1:0)))%4))&&(!(B(22 33,4)%32)&&(B(B(22,2)+p[P][R][0][1]+1,B(22,1)+p[P][R][0][0])+B(B(22,2)+p[P][R][1][ 341]+1,B(22,1)+p[P][R][1][0])+B(B(22,2)+p[P][R][2][1]+1,B(22,1)+p[P][R][2][0])+B(B 35(22,2)+p[P][R][3][1]+1,B(22,1)+p[P][R][3][0])))){B(22,3)=B(B(22,2)+p[P][R][0][1] 36,B(22,1)+p[P][R][0][0])=B(B(22,2)+p[P][R][1][1],B(22,1)+p[P][R][1][0])=B(B(22,2) 37+p[P][R][2][1],B(22,1)+p[P][R][2][0])=B(B(22,2)+p[P][R][3][1],B(22,1)+p[P][R][3] 38[0])=1;while(++B(22,3)<21)if(B(B(22,3),1)+B(B(22,3),2)+B(B(22,3),3)+B(B(22,3),4) 39+B(B(22,3),5)+B(B(22,3),6)+B(B(22,3),7)+B(B(22,3),8)+B(B(22,3),9)+B(B(22,3),10)\ 40==10)blit(b,b,1,1,1,2,10,B(22,3)-1);if(1+(B(22,8)=(B(22,7)=(time(NULL)+(B(22,1)= 41(B(22,2)=1)+4))%7)*0)&&(B(B(22,2)+p[P][R][0][1],B(22,1)+p[P][R][0][0])+B(B(22,2) 42+p[P][R][1][1],B(22,1)+p[P][R][1][0])+B(B(22,2)+p[P][R][2][1],B(22,1)+p[P][R][2] 43[0])+B(B(22,2)+p[P][R][3][1],B(22,1)+p[P][R][3][0])))B(22,0)=1;}retrace_count=0; 44}rectfill(b,50,SCREEN_W,50+SCREEN_H,SCREEN_W,0);stretch_blit(b,b,(B(22,3)=0),0,\ 4512,22,0,50,192,352);while(B(22,3)++<4){rectfill(b,(B(22,1)+p[P][R][B(22,3)-1][0] 46)*16,50+(B(22,2)+p[P][R][B(22,3)-1][1])*16,14+(B(22,1)+p[P][R][B(22,3)-1][0])*16 47,50+14+(B(22,2)+p[P][R][B(22,3)-1][1])*16,makecol(255,255,255));}blit(b,screen,0 48,50,0,0,SCREEN_W,SCREEN_H);}destroy_bitmap(b);return 0;}END_OF_MAIN()

Fladimir da Gorf
Member #1,565
October 2001
avatar

Lillo, I tried your game, but all I could see was a starfield, and if I pressed space, also explosions here and there. :/ Oh, and does your starfield really have a motion blur effect, or is it just my monitor doing tricks?

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Lillo, I tried your game, but all I could see was a starfield, and if I pressed space, also explosions here and there. :/ Oh, and does your starfield really have a motion blur effect, or is it just my monitor doing tricks?

Thats unfortunetly all I got as well :( no sprites, just a star field, bullets, and explosions.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

zaphire
Member #1,273
September 2000
avatar

Quote:

Thats unfortunetly all I got as well no sprites, just a star field, bullets, and explosions.

That's way more features than some commercial games.

Billybob
Member #3,136
January 2003

zaphire: your link is a little broken, I had to type it in manually. Anyway, that's funny stuff. What was going through that company's mind when they released that game? I guess maybe they thought people would buy it just so they could have a good laugh.

Marcello
Member #1,860
January 2002
avatar

Matt: could you compress that even more by grouping all those arrays into single numbers using bits?

Marcello

Matthew Leverton
Supreme Loser
January 1999
avatar

I know - the original restriction was just line numbers (semicolons), so I didn't bother with anything like that. It still contains a lot of other things that could be redone for char count. All I did above was use a couple #defines to shorten the code.

I'm sure one could get an allegro tetris game in 25x80, but I don't have the time to waste at the moment...



Go to: