Commit 2c877dfe authored by Max Kobelt's avatar Max Kobelt
Browse files

Adjust inital projectile position

parent b39b4ee9
#include "game.h"
#include "projectile.h"
#include "raylib.h"
......@@ -52,12 +53,12 @@ void drawGame() {
DrawRectangleLines((int) gameBorder.x, (int) gameBorder.y, (int) gameBorder.width, (int) gameBorder.height, WHITE);
if (playerProj) {
DrawRectangleRec((Rectangle) { playerProj->pos.x, playerProj->pos.y, 5, 10 }, WHITE);
DrawRectangleRec((Rectangle) { playerProj->pos.x, playerProj->pos.y, PROJECTILE_WIDTH, PROJECTILE_HEIGHT }, WHITE);
}
}
void spawnPlayerProjectile() {
playerProj = malloc(sizeof *playerProj);
playerProj->movingUp = true;
playerProj->pos = (Vector2) { laserCanonPos.x, laserCanonPos.y };
playerProj->pos = (Vector2) { laserCanonPos.x + laserCanon.width / 2, laserCanonPos.y - PROJECTILE_HEIGHT };
}
......@@ -5,6 +5,8 @@
#include <stdbool.h>
#define PROJECTILE_SPEED 5
#define PROJECTILE_HEIGHT 10
#define PROJECTILE_WIDTH 5
typedef struct {
bool movingUp;
......
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