Commit c944af9b authored by Valentin Bartschies's avatar Valentin Bartschies
Browse files

Add casting to float

parent 620a3a69
......@@ -12,9 +12,9 @@ int laserCanonSize;
void initGame() {
laserCanonSize = GAME_SCREEN_WIDTH / 20;
laserCanonPos = (Vector2) {GAME_SCREEN_WIDTH / 2, GAME_SCREEN_HEIGHT - (laserCanonSize * 2)};
laserCanon = (Rectangle) {laserCanonPos.x, laserCanonPos.y, laserCanonSize, laserCanonSize};
gameBorder = (Rectangle) {0, 0, GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT};
laserCanonPos = (Vector2) {(float) GAME_SCREEN_WIDTH / 2, (float) GAME_SCREEN_HEIGHT - (laserCanonSize * 2)};
laserCanon = (Rectangle) {(float) laserCanonPos.x, (float) laserCanonPos.y, (float) laserCanonSize, (float) laserCanonSize};
gameBorder = (Rectangle) {0.0, 0.0, (float) GAME_SCREEN_WIDTH, (float) GAME_SCREEN_HEIGHT};
}
void calcGame() {
......@@ -37,7 +37,7 @@ void calcGame() {
}
// Update position of laserCanon
laserCanon = (Rectangle) {laserCanonPos.x, laserCanonPos.y, laserCanonSize, laserCanonSize};
laserCanon = (Rectangle) {(float) laserCanonPos.x, (float) laserCanonPos.y, (float) laserCanonSize, (float) laserCanonSize};
}
void drawGame() {
......
......@@ -18,8 +18,8 @@ void initMenu() {
letterCount = framesCount = 0;
int inputBoxWidth = GAME_SCREEN_WIDTH / 2;
inputBox = (Rectangle) { (GAME_SCREEN_WIDTH - inputBoxWidth) / 2, GAME_SCREEN_HEIGHT / 2, inputBoxWidth, GAME_SCREEN_HEIGHT / 7 };
playBtnPos = (Vector2) { (GAME_SCREEN_WIDTH - MeasureText("PLAY", PLAY_FONT_SIZE)) / 2, GAME_SCREEN_HEIGHT / 5 };
inputBox = (Rectangle) { ((float) GAME_SCREEN_WIDTH - inputBoxWidth) / 2, (float) GAME_SCREEN_HEIGHT / 2, (float) inputBoxWidth, (float) GAME_SCREEN_HEIGHT / 7 };
playBtnPos = (Vector2) { (GAME_SCREEN_WIDTH - (float) MeasureText("PLAY", PLAY_FONT_SIZE)) / 2, (float) GAME_SCREEN_HEIGHT / 5 };
}
void calcMenu() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment