Player character library

PlayerChar.cpp

Committer:
isabelc
Date:
2017-03-20
Revision:
2:6263f2b8bf2c
Parent:
1:219e18b8f20e
Child:
3:315d21341563

File content as of revision 2:6263f2b8bf2c:

#include "PlayerChar.h"

// struct for state
struct State {
    int output;  // output value for current state
    float time;  // wait time for state
    int next_state[1]; // next state
};
//typedef const struct State STyp;

time = 0.5;

// array of states in the FSM, each element is the output of the counter, wait time, next state(s)
State fsm[2] = {
    {1,time,{2}},
    {2,time,{1}},
};

//y16x8
/* static int detectiveStill[] = {
     0,0,1,1,1,1,0,0,
     0,0,1,1,1,1,0,0,
     0,0,1,1,1,1,0,0,
     0,1,1,1,1,1,1,0,
     0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,
     0,1,1,1,1,1,1,0,
     1,1,1,1,1,1,1,1,
     1,0,1,1,1,1,0,1,
     1,0,1,1,1,1,0,1,
     0,0,1,1,1,1,0,0,
     0,0,0,1,1,0,0,0,
     0,0,1,1,1,1,0,0,
     0,0,1,1,1,1,0,0,
     0,0,1,0,0,1,0,0,
     0,0,1,0,0,1,0,0 },
};

//y16x8
static int detectiveRight1[] =   {
     0,1,1,1,1,0,0,0,
     0,1,1,1,1,0,0,0,
     0,1,1,1,1,0,0,0,
     1,1,1,1,1,1,0,0,
     0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,
     0,1,1,1,1,0,0,0,
     0,1,1,1,1,0,0,0,
     0,1,1,1,1,1,1,1,
     0,1,1,1,1,0,0,0,
     0,1,1,1,1,0,0,0,
     0,0,1,1,0,0,0,0,
     0,1,1,1,1,0,0,0,
     0,1,1,1,1,1,0,0,
     0,1,0,0,0,1,0,0,
     0,1,0,0,0,1,0,0,
};

//y16x8
static int detectiveLeft1[] =   {
     0,0,0,1,1,1,1,0,
     0,0,0,1,1,1,1,0,
     0,0,0,1,1,1,1,0,
     0,0,1,1,1,1,1,1,
     0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,
     0,0,0,1,1,1,1,0,
     0,0,0,1,1,1,1,0,
     1,1,1,1,1,1,1,0,
     0,0,0,1,1,1,1,0,
     0,0,0,1,1,1,1,0,
     0,0,0,0,1,1,0,0,
     0,0,0,1,1,1,1,0,
     0,0,1,1,1,1,1,0,
     0,0,1,0,0,0,1,0,
     0,0,1,0,0,0,1,0,
};

//y14x12
static int detectiveJumping[]= {
    0,0,0,0,1,1,1,1,0,0,0,0,
    0,0,0,0,1,1,1,1,0,0,0,0,
    0,0,0,0,1,1,1,1,0,0,0,0,
    1,0,0,1,1,1,1,1,1,0,0,1,
    0,1,0,0,0,0,0,0,0,0,1,0,
    0,0,1,0,0,0,0,0,0,1,0,0,
    0,0,0,1,1,1,1,1,1,0,0,0,
    0,0,0,0,1,1,1,1,0,0,0,0,
    0,0,0,0,1,1,1,1,0,0,0,0,
    0,0,0,0,1,1,1,1,0,0,0,0,
    0,0,0,0,0,1,1,0,0,0,0,0,
    0,0,0,0,1,0,0,1,0,0,0,0,
    0,0,0,1,0,0,0,0,1,0,0,0,
    0,0,1,0,0,0,0,0,0,1,0,0
};
*/