Browse Source

refactoring: Die Variable an die Konvention angepasst

main
fdai7103 2 years ago
parent
commit
e952071462
  1. 14
      src/Paper-Bin.c

14
src/Paper-Bin.c

@ -17,7 +17,7 @@ int binY = 10;
char field[fieldWidth][fieldHeigth]; char field[fieldWidth][fieldHeigth];
int windForce = 0; int windForce = 0;
int ScorePoints = 0;
int scorePoints = 0;
int lifeCount = 3; int lifeCount = 3;
int ballX = -1; int ballX = -1;
@ -156,12 +156,12 @@ int main()
switch (ball_In_Bin) switch (ball_In_Bin)
{ {
case (1): case (1):
ScorePoints += 50;
scorePoints += 50;
loadLevel(++lvlnumber); loadLevel(++lvlnumber);
break; break;
case(2): case(2):
ScorePoints -= 5;
scorePoints -= 5;
lifeCount--; lifeCount--;
if (lifeCount < 1) if (lifeCount < 1)
{ {
@ -228,10 +228,10 @@ void generateField()
system("clear"); system("clear");
buildBin(binX, binY); buildBin(binX, binY);
if (ScorePoints < 0)
ScorePoints = 0;
if (scorePoints < 0)
scorePoints = 0;
int tmp = ScorePoints;
int tmp = scorePoints;
field[12][1] = '0' + tmp % 10; field[12][1] = '0' + tmp % 10;
tmp /= 10; tmp /= 10;
@ -289,7 +289,7 @@ void addScoreboard()
printf("Bitte gib deinen Namen ein:\n"); printf("Bitte gib deinen Namen ein:\n");
scanf("%s", name); scanf("%s", name);
fprintf(fp, "%s %d\n", name, ScorePoints);
fprintf(fp, "%s %d\n", name, scorePoints);
fclose(fp); fclose(fp);
} }

Loading…
Cancel
Save