2024-02-21 13:25:55 +00:00
|
|
|
#include "system/keyboard.h"
|
|
|
|
struct RabbitPosition {
|
|
|
|
int rabbitPosition[2];
|
|
|
|
int oldRabbitPosition[2];
|
|
|
|
int rabbitLimits[2][2];
|
|
|
|
signed char rabbitVelocity[2];
|
2024-02-20 17:51:59 +00:00
|
|
|
|
2024-02-21 13:25:55 +00:00
|
|
|
int mousePosition[2];
|
|
|
|
int oldMousePosition[2];
|
|
|
|
|
|
|
|
int mouseDotPosition[2];
|
|
|
|
int oldMouseDotPosition[2];
|
|
|
|
|
|
|
|
int mouseAngle;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RabbitWeaponry {
|
|
|
|
char cooldown;
|
2024-02-20 17:51:59 +00:00
|
|
|
};
|
2024-02-21 13:25:55 +00:00
|
|
|
|
|
|
|
struct BulletPosition {
|
|
|
|
// 1 if the bullet should be rendered
|
|
|
|
char isActive;
|
|
|
|
// sweep up the bullet from the display
|
|
|
|
char willBeInactive;
|
|
|
|
int x, y;
|
|
|
|
int oldX, oldY;
|
|
|
|
|
|
|
|
signed char velocityXSteps[2], velocityYSteps[2];
|
|
|
|
char velocityStep;
|
|
|
|
};
|
|
|
|
|
|
|
|
void calculateTargetAngle(struct RabbitPosition*, struct MouseStatus*);
|
|
|
|
void captureAndLimitMousePosition(struct RabbitPosition*, struct MouseStatus*);
|
|
|
|
void handleRabbitMovement(struct RabbitPosition*, struct KeyboardKeydownState*);
|