74 lines
1.4 KiB
C
74 lines
1.4 KiB
C
#ifndef __MOVEMENT_H__
|
|
#define __MOVEMENT_H__
|
|
|
|
#include "system/keyboard.h"
|
|
|
|
struct RabbitPosition {
|
|
int rabbitPosition[2];
|
|
int oldRabbitPosition[2];
|
|
int rabbitLimits[2][2];
|
|
signed char rabbitVelocity[2];
|
|
|
|
int mousePosition[2];
|
|
int oldMousePosition[2];
|
|
|
|
int mouseDotPosition[2];
|
|
int oldMouseDotPosition[2];
|
|
|
|
int mouseAngle;
|
|
};
|
|
|
|
struct RabbitWeaponry {
|
|
char cooldown;
|
|
char currentWeapon;
|
|
int currentWeaponRemainingRounds;
|
|
char damage;
|
|
};
|
|
|
|
struct PlayerPowerup {
|
|
int x, y;
|
|
int cooldown;
|
|
char isActive;
|
|
char willBeInactive;
|
|
char type;
|
|
};
|
|
|
|
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;
|
|
|
|
int wallCooldown;
|
|
|
|
signed int velocityXSteps[2], velocityYSteps[2];
|
|
int velocityStep;
|
|
int angle;
|
|
};
|
|
|
|
struct EnemyPosition {
|
|
int hitPoints;
|
|
int enemyPosition[2];
|
|
int oldEnemyPosition[2];
|
|
|
|
int enemyMoveDelayStep;
|
|
int enemyFireDelayStep;
|
|
|
|
char isActive;
|
|
|
|
char willBeInactive;
|
|
char wasKilled;
|
|
|
|
char hasLeftGate;
|
|
char gateExitedFrom;
|
|
};
|
|
|
|
void calculateTargetAngle(struct RabbitPosition*);
|
|
void captureAndLimitMousePosition(struct RabbitPosition*, struct MouseStatus*);
|
|
void handleRabbitMovement(struct RabbitPosition*, struct KeyboardKeydownState*);
|
|
void handleEnemyMovement(struct EnemyPosition[], struct RabbitPosition*);
|
|
|
|
#endif
|