I get errors when i try this:
Code:
class Player:
public Character
{
private:
static const float JUMP_HEIGHT = 13;
static const int REGEN_DELAY = 100;
static const int ALARM_REGENATE = 1;
static const int ACTION_STAND = 0;
static const int ACTION_DUCK = 1;
static const int ACTION_WALK = 2;
static const int ACTION_JUMP = 3;
static const int ACTION_PUNCH = 4;
static const int ACTION_KICK = 5;
static const int ACTION_SIT = 6;
struct
{
int imageCount, nextAction;
float speed;
} static const PLAYER_ACTIONS[] = {
{1, -1, 0.0f}, //stand
{1, -1, 0.0f}, //duck
{6, -1, 0.5f}, //walk
{1, -1, 0.0f}, //jump
{4, ACTION_STAND, 0.4f}, //punch
{4, ACTION_STAND, 0.3f}, //kick
{1, -1, 0.0f}, //sit
};
...
};
D:\Code\StickOnline\src\/Player.h:32: error: a brace-enclosed initializer is not allowed here before '{' token
D:\Code\StickOnline\src\/Player.h:40: error: invalid in-class initialization of static data member of non-integral type `const Player::<anonymous struct>[]'
The error occurs at " } static const PLAYER_ACTIONS[] = {"