2023-03-07 23:15:00 +00:00
|
|
|
#ifndef SPACEWARPLAYER_H
|
|
|
|
#define SPACEWARPLAYER_H
|
|
|
|
#include "xyVector.h"
|
|
|
|
|
|
|
|
// A struct storing the needed data to draw a ship:
|
|
|
|
typedef struct ship
|
|
|
|
{
|
|
|
|
int number;
|
|
|
|
xyVector engine;
|
|
|
|
xyVector gravity;
|
|
|
|
xyVector position;
|
|
|
|
xyVector velocity;
|
|
|
|
SDL_Rect rectangle;
|
|
|
|
} ship;
|
|
|
|
|
|
|
|
// A struct to store the input state for one player:
|
|
|
|
typedef struct playerController
|
|
|
|
{
|
2023-03-14 00:56:31 +00:00
|
|
|
SDL_Joystick * joystick;
|
|
|
|
SDL_Haptic * haptic;
|
2023-03-07 23:15:00 +00:00
|
|
|
int number;
|
2023-03-14 00:56:31 +00:00
|
|
|
double turningAmount, acceleratingAmount;
|
2023-03-07 23:15:00 +00:00
|
|
|
bool turningClockwise, turningAnticlockwise, accelerating;
|
|
|
|
} playerController;
|
|
|
|
|
|
|
|
#endif
|