aboutsummaryrefslogtreecommitdiff
path: root/src/engine/player_controller.c
diff options
context:
space:
mode:
authorNielsCoding <48092678+heavydemon21@users.noreply.github.com>2023-03-15 15:37:21 +0100
committerNielsCoding <48092678+heavydemon21@users.noreply.github.com>2023-03-15 15:37:21 +0100
commit3891486b368f4cdd1c5e00019a2a66ca05e656e6 (patch)
treecd27ef74ef917bed16c90be9552dd007b4a7f2b5 /src/engine/player_controller.c
parent67bbe8dc3e7e0eb5eeb00b84f9766ef3d3b6b4b4 (diff)
game loop and bullet
TODO game loop: -(startingscreen) read correct indexes -(shop) read correct indexes -gameplay still needs alot with different levels etc.. rest not yet done bullet needs testing and correct PAL and tilemap reading
Diffstat (limited to 'src/engine/player_controller.c')
-rw-r--r--src/engine/player_controller.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/engine/player_controller.c b/src/engine/player_controller.c
index 22f6eb6..f938844 100644
--- a/src/engine/player_controller.c
+++ b/src/engine/player_controller.c
@@ -3,7 +3,7 @@
#include "engine/draw_screen.h"
#include "engine/sprite_controller.h"
#include "engine/player_controller.h"
-
+#include "engine/bullet.h"
#include "input.h"
void hh_player_actions() {
@@ -29,6 +29,17 @@ void hh_player_actions() {
// hh_input_read();
player.vel = (vec2){.x = (-1 * g_hh_controller_p1.dpad_left) + (1 * g_hh_controller_p1.dpad_right),
.y = (-1 * g_hh_controller_p1.dpad_up) + (1 * g_hh_controller_p1.dpad_down) };
+
+ // shooting code
+ static Bullet bullet;
+ if(g_hh_controller_p1.button_primary){
+ bullet.isActive = false;
+ shootBullet(player.vel, &bullet);
+ }
+ else{
+ updateBullet(&bullet, 1);
+
+ }
// const int8_t maa = 3;
// const int8_t mbb = -3;
// if (g_hh_controller_p1.dpad_up)