Add fire when thrust is active
This commit is contained in:
9
main.c
9
main.c
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user