You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
1.8 KiB
112 lines
1.8 KiB
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
char field[23][29];
|
|
|
|
int Ballx = -1;
|
|
int Bally = 27;
|
|
|
|
void buildBin(int width, int heigth){
|
|
field[width][heigth] = 'V';
|
|
field[width+1][heigth+1] = '\\';
|
|
field[width+2][heigth+2] = '\\';
|
|
field[width-1][heigth+1] = '/';
|
|
field[width-2][heigth+2] = '/';
|
|
field[width][heigth+1] = ' ';
|
|
}
|
|
|
|
void loadLevel() {
|
|
int lvlnum;
|
|
clearField();
|
|
switch (lvlnum)
|
|
{
|
|
}
|
|
}
|
|
|
|
int main()
|
|
{
|
|
int ballX = 7;
|
|
int BallY = 23;
|
|
|
|
while (1)
|
|
{
|
|
system("clear");
|
|
|
|
for (int i = 0; i < 23; i++)
|
|
{
|
|
for (int j = 0; j < 29; j++)
|
|
{
|
|
field[i][j] = ' ';
|
|
}
|
|
}
|
|
|
|
field[ballX][BallY -= 1] = 'O';
|
|
|
|
|
|
buildBin(10,10);
|
|
|
|
for (int i = 0; i < 29; i++)
|
|
{
|
|
printf("|");
|
|
for (int j = 0; j < 23; j++)
|
|
{
|
|
if (i == 0 || i == 29 - 1 || i == 2)
|
|
printf("=");
|
|
else
|
|
printf("%c", field[j][i]);
|
|
}
|
|
printf("|");
|
|
printf("\n");
|
|
}
|
|
getStartPosition();
|
|
|
|
sleep(1);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
void getStartPosition()
|
|
{
|
|
|
|
while (Ballx == -1)
|
|
{
|
|
for (int i = 2, j = 0; i <= 20; i += 2, j++)
|
|
{
|
|
field[i][Bally] = j + '0';
|
|
}
|
|
Generatefield();
|
|
//printf("W\x84\hle die position des Balls (0-9):\n");
|
|
printf("W\x84\hle die position des Balls (0-9):\n");
|
|
|
|
scanf("%d", &Ballx);
|
|
|
|
if (Ballx < 0 || 9 < Ballx)
|
|
{
|
|
Ballx = -1;
|
|
continue;
|
|
}
|
|
Ballx = (Ballx + 1);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
void clearField()
|
|
{
|
|
int fieldWidth = 25;
|
|
int fieldHeigth = 30;
|
|
|
|
for (int i = 0; i <= fieldWidth; i++)
|
|
{
|
|
for (int j = 0; j <= fieldHeigth; j++)
|
|
{
|
|
field[i][j] = ' ';
|
|
}
|
|
}
|
|
}
|
|
|
|
void Generatefield() {
|
|
|
|
}
|
|
|
|
|