feat: Added basic shooting
This commit is contained in:
18
code/first.c
18
code/first.c
@@ -27,6 +27,9 @@
|
||||
#include "game/impl/bandit.c"
|
||||
#include "game/testnavmesh.h"
|
||||
|
||||
const int width = 1280;
|
||||
const int height = 720;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
(void)argc;
|
||||
@@ -80,16 +83,12 @@ int main(int argc, char **argv)
|
||||
npc1->collision.pos.x = 15;
|
||||
npc1->collision.pos.y = 15;
|
||||
npc1->collision.size.x = 1;
|
||||
npc1->collision.size.y = 1;
|
||||
npc1->collision.size.y = 2;
|
||||
npc1->name = S("Matt");
|
||||
npc1->mode = NPC_ACTION_WAITING;
|
||||
npc1->waitTime = 0;
|
||||
npc1->maxWaitTime = 5;
|
||||
npc1->maxWaitTime = 5000;
|
||||
npc1->currentNavNode = 0;
|
||||
npc1->collision.pos.x = 15;
|
||||
npc1->collision.pos.y = 15;
|
||||
npc1->collision.size.x = 10;
|
||||
npc1->collision.size.y = 10;
|
||||
}
|
||||
|
||||
Bandit *badman = &world->bandit;
|
||||
@@ -107,6 +106,7 @@ int main(int argc, char **argv)
|
||||
|
||||
world->navMesh = &TestNavMesh;
|
||||
world->npcPOI[0] = 100;
|
||||
world->player.world = world;
|
||||
world->player.pos.x = 0;
|
||||
world->player.pos.y = 0;
|
||||
world->player.bulletsLoaded = PLAYER_BULLET_COUNT;
|
||||
@@ -126,7 +126,11 @@ int main(int argc, char **argv)
|
||||
{
|
||||
running = false;
|
||||
}
|
||||
|
||||
V3f projection = G_CameraUnproject(&game->camera, V2f_Clip(
|
||||
V2F(e.button.x, e.button.y),
|
||||
V2F(width, height)
|
||||
));
|
||||
game->world->mouseProjected = V2F(projection.x, projection.y);
|
||||
ProcessEvents(&e, game->world);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user