Add fire when thrust is active

This commit is contained in:
Camden Dixie O'Brien
2025-10-13 18:44:30 +01:00
parent cbea1d73c7
commit 0dc7d53bbe

9
main.c
View File

@@ -2,8 +2,8 @@
#include "renderer.h"
#include <linux/input-event-codes.h>
#include <sys/select.h>
#include <stdio.h>
#include <sys/select.h>
#define LIN_PWR 0.0001
#define ROT_PWR 0.001
@@ -32,6 +32,11 @@ static const vec2_t ship[] = {
{ 0.0, -0.07 },
{ -0.05, -0.1 },
};
static const vec2_t fire[] = {
{ 0.015, -0.1 },
{ -0.015, -0.1 },
{ 0.0, -0.15 },
};
static const vec2_t thrust = { 0, LIN_PWR };
@@ -138,6 +143,8 @@ int main()
renderer_clear();
renderer_draw(ship, NELEMS(ship), m);
if (input.fwd != 0)
renderer_draw(fire, NELEMS(fire), m);
renderer_swap();
}
}