Invaderz game: original one: just help me: need more: just ask:
#include <iostream.h>
#include <conio.h>
#include <dos.h>
#include <stdlib.h>
#include <fstream.h>
int x = 10;
int y = 24;
int bx = 1;
int by = 5;
int bux;
int buy;
int lorr = 0;
int bull = 0;
int tmer = 0;
int main()
{
while(1)
{
gotoxy(x, y);
putch('^');
gotoxy(bx, by);
putch('-');
if (tmer == 100)
{
if (bx == 1)
bull = 0;
if (bx == 80)
bull = 1;
if (bull == 1)
bx = bx - 1;
if (bull == 0)
bx = bx + 1;
tmer = 0;
}
if (kbhit())
{
char movement = getch();
if (movement == 27)
break;
if (movement == 75)
{
if (x != 1)
x = x - 1;
}
if (movement == 77)
{
if (x != 80)
x = x + 1;
}
}
tmer = tmer + 1;
delay(1);
clrscr();
}
return 0;
}
borland C 3.1