#include #include #define WHITE makecol(255,255,255) #define BLUE makecol(64,64,160) #define BGCOLOR makecol(32,16,48) #define RED makecol(255,0,0) int gameover; int playnum; int difficulty; int lock; int gameend(); int gameplay(); int presents() { textprintf_centre_ex(screen, font, SCREEN_W/2, SCREEN_H/2, WHITE, 0, "JJW Mezun Presents"); rest(800); rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, 0); rest(800); return 0; } int titlescreen() { BITMAP *title; BITMAP *arrow; title = load_bitmap("files/title.bmp", NULL); arrow = load_bitmap("files/arrow.bmp", NULL); playnum = 1; difficulty = 1; lock = 1; rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, BLUE); draw_sprite(screen, arrow, SCREEN_W/2 - 128, SCREEN_H - 64); while(!key[KEY_ENTER] || lock == 1) { if(!key[KEY_ENTER]) lock = 0; draw_sprite(screen, title, SCREEN_W/2 - 64, 64); textprintf_centre_ex(screen, font, SCREEN_W/2, 128, WHITE, -1, "Beta Version 0.000005"); textprintf_centre_ex(screen, font, SCREEN_W/2, SCREEN_H - 64, WHITE, -1, "1 Player Mode"); textprintf_centre_ex(screen, font, SCREEN_W/2, SCREEN_H - 32, WHITE, -1, "2 Player Mode"); if(key[KEY_DOWN]) { playnum = 2; rectfill(screen, SCREEN_W/2 - 128, SCREEN_H - 64, SCREEN_W/2 - 112, SCREEN_H - 48, BLUE); draw_sprite(screen, arrow, SCREEN_W/2 - 128, SCREEN_H - 32); } if(key[KEY_UP]) { playnum = 1; rectfill(screen, SCREEN_W/2 - 128, SCREEN_H - 32, SCREEN_W/2 - 112, SCREEN_H - 16, BLUE); draw_sprite(screen, arrow, SCREEN_W/2 - 128, SCREEN_H - 64); } } if(playnum == 1) { lock = 1; rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, BLUE); draw_sprite(screen, arrow, SCREEN_W/2 - 128, SCREEN_H - 64); while(!key[KEY_ENTER] || lock == 1) { if(!key[KEY_ENTER]) lock = 0; draw_sprite(screen, title, SCREEN_W/2 - 64, 64); textprintf_centre_ex(screen, font, SCREEN_W/2, 128, WHITE, -1, "Beta Version 0.000005"); textprintf_centre_ex(screen, font, SCREEN_W/2, SCREEN_H - 64, WHITE, -1, "Easy Difficulty"); textprintf_centre_ex(screen, font, SCREEN_W/2, SCREEN_H - 32, WHITE, -1, "Hard Difficulty"); if(key[KEY_DOWN]) { difficulty = 2; rectfill(screen, SCREEN_W/2 - 128, SCREEN_H - 64, SCREEN_W/2 - 112, SCREEN_H - 48, BLUE); draw_sprite(screen, arrow, SCREEN_W/2 - 128, SCREEN_H - 32); } if(key[KEY_UP]) { difficulty = 1; rectfill(screen, SCREEN_W/2 - 128, SCREEN_H - 32, SCREEN_W/2 - 112, SCREEN_H - 16, BLUE); draw_sprite(screen, arrow, SCREEN_W/2 - 128, SCREEN_H - 64); } } } destroy_bitmap(arrow); destroy_bitmap(title); gameplay(); } int gameplay() { gameover = 0; BITMAP *nilly; BITMAP *nilly1; BITMAP *nilly2; BITMAP *nilly3; BITMAP *fuckster; BITMAP *fuckster2; BITMAP *fuckster3; BITMAP *heart; BITMAP *bullet; typedef struct SPRITE { int x, y, x2, y2, hp; }SPRITE; int nillyx, nillyy, nillyx2, nillyy2; int fuckster1x, fuckster1y, fuckster1x2, fuckster1y2; int fuckster2x, fuckster2y, fuckster2x2, fuckster2y2; BITMAP *nillypic; nilly = load_bitmap("files/nilly.bmp", NULL); nilly1 = load_bitmap("files/nilly1.bmp", NULL); nilly2 = load_bitmap("files/nilly2.bmp", NULL); nilly3 = load_bitmap("files/nilly3.bmp", NULL); fuckster = load_bitmap("files/fuckster.bmp", NULL); fuckster2 = load_bitmap("files/fuckster2.bmp", NULL); fuckster3 = load_bitmap("files/fuckster3.bmp", NULL); heart = load_bitmap("files/heart.bmp", NULL); bullet = load_bitmap("files/bullet.bmp", NULL); nillyx = 32; nillyy = 64; fuckster1x = (SCREEN_W - 48); fuckster1y = (SCREEN_H - 64); fuckster2x = 32; fuckster2y = (SCREEN_H - 64); gameover = 0; int health = 3; int invincibility = 0; int n = 0; int dir = 3; int bulletx; int bullety; nillypic = nilly3; nillyx2 = nillyx + 32; nillyy2 = nillyy + 32; fuckster1x2 = fuckster1x + 32; fuckster2x2 = fuckster2x + 32; fuckster1y2 = fuckster1y + 32; fuckster2y2 = fuckster2y + 32; rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, BGCOLOR); draw_sprite(screen, nillypic, nillyx, nillyy); draw_sprite(screen, fuckster, fuckster1x, fuckster1y); if(playnum == 1) draw_sprite(screen, fuckster, fuckster2x, fuckster2y); draw_sprite(screen, heart, 32, SCREEN_H - 32); draw_sprite(screen, heart, 64, SCREEN_H - 32); draw_sprite(screen, heart, 96, SCREEN_H - 32); while(!key[KEY_ESC] && gameover != 1) { rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); if(key[KEY_LEFT]) { rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); dir = 0; nillyx = nillyx - 16; nillyx2 = nillyx + 32; nillypic = nilly; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); } if(key[KEY_RIGHT] && gameover == 0) { rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); dir = 2; nillyx = nillyx + 16; nillyx2 = nillyx + 32; nillypic = nilly1; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(key[KEY_UP] && gameover == 0) { rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); dir = 1; nillyy = nillyy - 16; nillyy2 = nillyy + 32; nillypic = nilly2; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(key[KEY_DOWN] && gameover == 0) { rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); dir = 3; nillyy = nillyy + 16; nillyy2 = nillyy + 32; nillypic = nilly3; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(playnum == 2) { if(key[KEY_A] && gameover == 0) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1x = fuckster1x - 16; fuckster1x2 = fuckster1x + 32; draw_sprite(screen, fuckster, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(key[KEY_D] && gameover == 0) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1x = fuckster1x + 16; fuckster1x2 = fuckster1x + 32; draw_sprite_h_flip(screen, fuckster, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(key[KEY_W] && gameover == 0) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1y = fuckster1y - 16; fuckster1y2 = fuckster1y + 32; draw_sprite(screen, fuckster2, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(key[KEY_S] && gameover == 0) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1y = fuckster1y + 16; fuckster1y2 = fuckster1y + 32; draw_sprite(screen, fuckster3, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } } if(playnum == 1) { if(difficulty == 1) { if(fuckster1x < nillyx) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1x = fuckster1x + 4; fuckster1x2 = fuckster1x + 32; draw_sprite_h_flip(screen, fuckster, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster1y < nillyy) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1y = fuckster1y + 4; fuckster1y2 = fuckster1y + 32; draw_sprite(screen, fuckster2, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster1x > nillyx) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1x = fuckster1x - 4; fuckster1x2 = fuckster1x + 32; draw_sprite(screen, fuckster, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster1y > nillyy) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1y = fuckster1y - 4; fuckster1y2 = fuckster1y + 32; draw_sprite(screen, fuckster3, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster2x < nillyx) { rectfill(screen, fuckster2x, fuckster2y, fuckster2x+fuckster->w, fuckster2y+fuckster->h, BGCOLOR); fuckster2x = fuckster2x + 8; fuckster2x2 = fuckster2x + 32; draw_sprite_h_flip(screen, fuckster, fuckster2x, fuckster2y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster2y < nillyy) { rectfill(screen, fuckster2x, fuckster2y, fuckster2x+fuckster->w, fuckster2y+fuckster->h, BGCOLOR); fuckster2y = fuckster2y + 8; fuckster2y2 = fuckster2y + 32; draw_sprite(screen, fuckster2, fuckster2x, fuckster2y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster2x > nillyx) { rectfill(screen, fuckster2x, fuckster2y, fuckster2x+fuckster->w, fuckster2y+fuckster->h, BGCOLOR); fuckster2x = fuckster2x - 8; fuckster2x2 = fuckster2x + 32; draw_sprite(screen, fuckster, fuckster2x, fuckster2y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster2y > nillyy) { rectfill(screen, fuckster2x, fuckster2y, fuckster2x+fuckster->w, fuckster2y+fuckster->h, BGCOLOR); fuckster2y = fuckster2y - 8; fuckster2y2 = fuckster2y + 32; draw_sprite(screen, fuckster3, fuckster2x, fuckster2y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } } if(difficulty == 2) { if(fuckster1x < nillyx && (nillyx - fuckster1x) < SCREEN_W/2 || (fuckster1x - nillyx) > SCREEN_W/2) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1x = fuckster1x + 4; fuckster1x2 = fuckster1x + 32; draw_sprite_h_flip(screen, fuckster, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster1y < nillyy && (nillyy - fuckster1y) < SCREEN_H/2 || (fuckster1y - nillyy) > SCREEN_H/2) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1y = fuckster1y + 4; fuckster1y2 = fuckster1y + 32; draw_sprite(screen, fuckster2, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster1x > nillyx && (fuckster1x - nillyx) < SCREEN_W/2 || (nillyx - fuckster1x) > SCREEN_W/2) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1x = fuckster1x - 4; fuckster1x2 = fuckster1x + 32; draw_sprite(screen, fuckster, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster1y > nillyy && (fuckster1y - nillyy) < SCREEN_H/2 || (nillyy - fuckster1y) > SCREEN_H/2) { rectfill(screen, fuckster1x, fuckster1y, fuckster1x+fuckster->w, fuckster1y+fuckster->h, BGCOLOR); fuckster1y = fuckster1y - 4; fuckster1y2 = fuckster1y + 32; draw_sprite(screen, fuckster3, fuckster1x, fuckster1y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster2x < nillyx && (nillyx - fuckster2x) < SCREEN_W/2 || (fuckster2x - nillyx) > SCREEN_W/2) { rectfill(screen, fuckster2x, fuckster2y, fuckster2x+fuckster->w, fuckster2y+fuckster->h, BGCOLOR); fuckster2x = fuckster2x + 8; fuckster2x2 = fuckster2x + 32; draw_sprite_h_flip(screen, fuckster, fuckster2x, fuckster2y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster2y < nillyy && (nillyy - fuckster2y) < SCREEN_H/2 || (fuckster2y - nillyy) > SCREEN_H/2) { rectfill(screen, fuckster2x, fuckster2y, fuckster2x+fuckster->w, fuckster2y+fuckster->h, BGCOLOR); fuckster2y = fuckster2y + 8; fuckster2y2 = fuckster2y + 32; draw_sprite(screen, fuckster2, fuckster2x, fuckster2y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster2x > nillyx && (fuckster2x - nillyx) < SCREEN_W/2 || (nillyx - fuckster2x) > SCREEN_W/2) { rectfill(screen, fuckster2x, fuckster2y, fuckster2x+fuckster->w, fuckster2y+fuckster->h, BGCOLOR); fuckster2x = fuckster2x - 8; fuckster2x2 = fuckster2x + 32; draw_sprite(screen, fuckster, fuckster2x, fuckster2y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(fuckster2y > nillyy && (fuckster2y - nillyy) < SCREEN_H/2 || (nillyy - fuckster2y) > SCREEN_H/2) { rectfill(screen, fuckster2x, fuckster2y, fuckster2x+fuckster->w, fuckster2y+fuckster->h, BGCOLOR); fuckster2y = fuckster2y - 8; fuckster2y2 = fuckster2y + 32; draw_sprite(screen, fuckster3, fuckster2x, fuckster2y); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } } } if(nillyx < -30) nillyx = SCREEN_W; if(nillyx > SCREEN_W) nillyx = 0; if(nillyy < 0) nillyy = SCREEN_H; if(nillyy > SCREEN_H) nillyy = 0; if(fuckster1x < -30) fuckster1x = SCREEN_W; if(fuckster1x > SCREEN_W) fuckster1x = 0; if(fuckster1y < 0) fuckster1y = SCREEN_H; if(fuckster1y > SCREEN_H) fuckster1y = 0; if(fuckster2x < -30) fuckster2x = SCREEN_W; if(fuckster2x > SCREEN_W) fuckster2x = 0; if(fuckster2y < 0) fuckster2y = SCREEN_H; if(fuckster2y > SCREEN_H) fuckster2y = 0; if(nillyx > fuckster1x && nillyx < fuckster1x2 && nillyy > fuckster1y && nillyy < fuckster1y2 && invincibility != 1) { health = health - 1; invincibility = 0; rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); nillyy = nillyy + 16; nillyx = nillyx + 16; nillyy2 = nillyy + 32; nillyx2 = nillyx + 32; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(nillyx2 > fuckster1x && nillyx2 < fuckster1x2 && nillyy > fuckster1y && nillyy < fuckster1y2 && invincibility != 1) { health = health - 1; invincibility = 0; rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); nillyy = nillyy - 16; nillyx = nillyx + 16; nillyy2 = nillyy + 32; nillyx2 = nillyx + 32; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(nillyx > fuckster1x && nillyx < fuckster1x2 && nillyy2 > fuckster1y && nillyy2 < fuckster1y2 && invincibility != 1) { health = health - 1; invincibility = 0; rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); nillyy = nillyy + 16; nillyx = nillyx - 16; nillyy2 = nillyy + 32; nillyx2 = nillyx + 32; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(nillyx2 > fuckster1x && nillyx2 < fuckster1x2 && nillyy2 > fuckster1y && nillyy2 < fuckster1y2 && invincibility != 1) { health = health - 1; invincibility = 0; rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); nillyy = nillyy - 16; nillyx = nillyx - 16; nillyy2 = nillyy + 32; nillyx2 = nillyx + 32; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(nillyx > fuckster2x && nillyx < fuckster2x2 && nillyy > fuckster2y && nillyy < fuckster2y2 && invincibility != 1) { health = health - 1; invincibility = 0; rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); nillyy = nillyy + 16; nillyx = nillyx + 16; nillyy2 = nillyy + 32; nillyx2 = nillyx + 32; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(nillyx2 > fuckster2x && nillyx2 < fuckster2x2 && nillyy > fuckster2y && nillyy < fuckster2y2 && invincibility != 1) { health = health - 1; invincibility = 0; rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); nillyy = nillyy - 16; nillyx = nillyx + 16; nillyy2 = nillyy + 32; nillyx2 = nillyx + 32; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(nillyx > fuckster2x && nillyx < fuckster2x2 && nillyy2 > fuckster2y && nillyy2 < fuckster2y2 && invincibility != 1) { health = health - 1; invincibility = 0; rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); nillyy = nillyy + 16; nillyx = nillyx - 16; nillyy2 = nillyy + 32; nillyx2 = nillyx + 32; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(nillyx2 > fuckster2x && nillyx2 < fuckster2x2 && nillyy2 > fuckster2y && nillyy2 < fuckster2y2 && invincibility != 1) { health = health - 1; invincibility = 0; rectfill(screen, nillyx, nillyy, nillyx+nilly->w, nillyy+nilly->h, BGCOLOR); nillyy = nillyy - 16; nillyx = nillyx - 16; nillyy2 = nillyy + 32; nillyx2 = nillyx + 32; draw_sprite(screen, nillypic, nillyx, nillyy); rectfill(screen, 0, 0, SCREEN_W, 32, BLUE); textprintf_ex(screen, font, 16, 8, WHITE, -1, "Press ESC to exit this shitty-ass program. Don't touch the Fucksters."); draw_sprite(screen, heart, 32, SCREEN_H - 32); if(health > 1) draw_sprite(screen, heart, 64, SCREEN_H - 32); if(health > 2) draw_sprite(screen, heart, 96, SCREEN_H - 32); } if(nillyx == fuckster1x && nillyy == fuckster1y && invincibility != 1) { health = health - 1; invincibility = 0; } if(nillyx == fuckster2x && nillyy == fuckster2y && invincibility != 1) { health = health - 1; invincibility = 0; } if(health == 2) rectfill(screen, 96, SCREEN_H - 32, 112, SCREEN_H - 16, BGCOLOR); if(health == 1) { rectfill(screen, 96, SCREEN_H - 32, 112, SCREEN_H - 16, BGCOLOR); rectfill(screen, 64, SCREEN_H - 32, 80, SCREEN_H - 16, BGCOLOR); } if(invincibility == 1) invincibility = 0; if(key[KEY_P]) gameover = 1; if(health == 0) gameover = 1; rest(50); } if(gameover == 1) { rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, 0); draw_sprite(screen, nillypic, nillyx, nillyy); rest(200); rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, RED); draw_sprite(screen, nillypic, nillyx, nillyy); rest(200); rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, 0); draw_sprite(screen, nillypic, nillyx, nillyy); rest(200); rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, RED); draw_sprite(screen, nillypic, nillyx, nillyy); rest(200); rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, 0); draw_sprite(screen, nillypic, nillyx, nillyy); rest(200); rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, RED); draw_sprite(screen, nillypic, nillyx, nillyy); rest(200); rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, 0); draw_sprite(screen, nillypic, nillyx, nillyy); rest(200); rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, RED); draw_sprite(screen, nillypic, nillyx, nillyy); rest(200); rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, 0); rest(200); } destroy_bitmap(bullet); destroy_bitmap(heart); destroy_bitmap(nilly); destroy_bitmap(nilly1); destroy_bitmap(nilly2); destroy_bitmap(nilly3); destroy_bitmap(fuckster); destroy_bitmap(fuckster2); destroy_bitmap(fuckster3); gameend(); } int gameend() { if(gameover == 1) { int endselect = 0; BITMAP *arrow; arrow = load_bitmap("files/arrow.bmp", NULL); rectfill(screen, 0, 0, SCREEN_W, SCREEN_H, 0); draw_sprite(screen, arrow, SCREEN_W/2 - 128, SCREEN_H/2 + 64); while(!key[KEY_ENTER]) { textprintf_centre_ex(screen, font, SCREEN_W/2, SCREEN_H/2, WHITE, -1, "GAME OVER"); textprintf_centre_ex(screen, font, SCREEN_W/2, SCREEN_H/2 + 64, WHITE, -1, "Play again"); textprintf_centre_ex(screen, font, SCREEN_W/2, SCREEN_H/2 + 80, WHITE, -1, "Return to Menu"); textprintf_centre_ex(screen, font, SCREEN_W/2, SCREEN_H/2 + 96, WHITE, -1, "Quit Program"); if(key[KEY_DOWN] && endselect == 0) { rectfill(screen, SCREEN_W/2 - 128, SCREEN_H/2 + 64, SCREEN_W/2 - 112, SCREEN_H/2 + 80, 0); draw_sprite(screen, arrow, SCREEN_W/2 - 128, SCREEN_H/2 + 80); endselect = 1; rest(200); } if(key[KEY_DOWN] && endselect == 1) { rectfill(screen, SCREEN_W/2 - 128, SCREEN_H/2 + 80, SCREEN_W/2 - 112, SCREEN_H/2 + 96, 0); draw_sprite(screen, arrow, SCREEN_W/2 - 128, SCREEN_H/2 + 96); endselect = 2; rest(200); } if(key[KEY_UP] && endselect == 2) { rectfill(screen, SCREEN_W/2 - 128, SCREEN_H/2 + 96, SCREEN_W/2 - 112, SCREEN_H/2 + 112, 0); draw_sprite(screen, arrow, SCREEN_W/2 - 128, SCREEN_H/2 + 80); endselect = 1; rest(200); } if(key[KEY_UP] && endselect == 1) { rectfill(screen, SCREEN_W/2 - 128, SCREEN_H/2 + 80, SCREEN_W/2 - 112, SCREEN_H/2 + 96, 0); draw_sprite(screen, arrow, SCREEN_W/2 - 128, SCREEN_H/2 + 64); endselect = 0; rest(200); } } if(endselect == 0) gameplay(); if(endselect == 1) titlescreen(); destroy_bitmap(arrow); } return 0; } int main(void) { allegro_init(); install_keyboard(); set_color_depth(16); set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 640, 480, 0, 0); presents(); titlescreen(); allegro_exit(); return 0; } END_OF_MAIN()