The final(?) edition of el14jbed's ELEC2645 project

Dependencies:   N5110 SDFileSystem mbed

Jacob Markl 200852678

Arrays.h

Committer:
horizontalwolf
Date:
2016-05-05
Revision:
0:cba7494d5dff

File content as of revision 0:cba7494d5dff:

/**
@file Arrays.h
@brief The header file containing the global arrays and sprites.
@brief Revision 9.9.
@author Jacob Markl
@date   May 2016
*/
#ifndef Arrays_H
#define Arrays_H

struct State {
    int mapno;  /*!< map number for current state */
    int next_state[4]; /*!< next state (depending on direction up,right,down,left) */
    int mobcode; /*!< identifyer for what arangement of mobs appear on the map */
    int cleared;  /*!< 0 if not clear, 1 if cleared */
};
typedef struct State STyp;

STyp fsm[8] = {
    {1,{0,1,0,0},0,1},
    {2,{1,1,2,0},1,0},
    {3,{1,3,2,2},2,0},
    {4,{3,4,3,2},3,0},
    {5,{5,4,6,3},0,1},
    {6,{5,5,4,5},4,0},
    {7,{4,7,6,6},5,0},
    {8,{7,7,7,6},6,0}
};/*!< the FSM for the first level */
/* level 2 map
      [9][10][11]
[1][4][5]    [13][8]
      [7][10][12]


*/


STyp lvl2fsm[11] = {
    {1,{0,1,0,0},0,1}, //0
    {4,{1,2,1,0},3,0}, //1
    {5,{4,2,3,1},0,1}, //2
    {7,{2,6,3,3},5,0}, //3
    {9,{4,5,2,4},7,0}, //4
    {10,{5,7,5,4},8,0}, //5
    {10,{6,8,6,3},8,0}, //6
    {11,{7,7,9,5},9,0}, //7
    {12,{9,8,8,6},10,0},//8
    {13,{7,10,8,9},11,0},//9
    {8,{10,10,10,9},6,0}//10
};/*!< The FSM for the second level */

STyp cfsm[11];

int const g_menuscreen[15][84] = {
//   0                 1                   2                   3                   4                   5                   6                   7                   8
//   1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0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1,1,1,1,1,1},
    {1,1,1,0,1,1,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,0,1,0,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,1,0,0,0,1,1,1,1,1,0,0,0,0,1,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
    {1,1,1,1,1,1,1,0,0,1,0,1,1,1,0,1,1,0,0,1,0,1,1,1,0,0,0,1,1,1,0,0,1,0,0,0,1,1,1,0,0,1,0,1,0,1,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
}; /*!< menu screen array */

int const g_LoZ[48][84] = {
//   0                 1                   2                   3                   4                   5                   6                   7                   8
//   1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
    {0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0},//1
    {0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,1,0,0,0,1,0,1,1,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,1,0,0,1,0,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,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0},//48

};/*!< intro screen array */


//##################### MAPS ####################

/* level 1 map

12 6
 345
   78

*/

/* level 2 map
      [9][10][11]
[1][4][5]    [13][8]
      [7][10][12]


*/

// for maps rock = 1,exit = 2, , doorup = 4, doorright = 5, doordown = 6, doorleft = 7

int const g_map_1[8][8]= {
    {1,1,1,1,1,1,1,1},
    {1,0,0,0,0,0,0,1},
    {1,0,0,0,0,0,0,1},
    {1,0,0,0,0,0,0,1},
    {1,0,0,0,0,0,0,5},
    {1,0,0,0,0,0,0,1},
    {1,0,0,0,0,0,0,1},
    {1,1,1,1,1,1,1,1},
};/*!< 1st map array*/

int const g_map_2[8][8]= {
    {1,1,1,1,1,1,1,1},
    {1,0,0,0,0,0,0,1},
    {1,0,1,1,0,1,0,1},
    {1,0,1,1,0,0,0,1},
    {7,0,1,1,1,0,0,1},
    {1,1,1,1,1,0,0,1},
    {1,1,1,0,0,0,0,1},
    {1,1,1,6,1,1,1,1},
};/*!< 2nd map array */

int const g_map_3[8][8]= {
    {1,1,1,4,1,1,1,1},
    {1,0,0,0,1,1,0,1},
    {1,0,0,1,1,0,1,1},
    {1,0,1,1,0,1,1,1},
    {1,0,1,1,1,1,0,5},
    {1,0,0,0,0,0,0,1},
    {1,0,0,0,0,0,0,1},
    {1,1,1,1,1,1,1,1},
};/*!< 3rd map array */

int const g_map_4[8][8]= {
    {1,1,1,1,1,1,1,1},
    {1,0,0,0,0,0,0,1},
    {1,0,1,0,1,0,0,1},
    {1,0,1,0,1,1,1,1},
    {7,0,1,0,1,1,0,5},
    {1,1,1,0,1,0,0,1},
    {1,0,0,0,0,0,0,1},
    {1,1,1,1,1,1,1,1},
};/*!< 4th map array */

int const g_map_5[8][8]= {
    {1,1,1,4,1,1,1,1},
    {1,1,1,0,1,1,1,1},
    {1,1,1,0,1,1,1,1},
    {1,1,1,0,1,1,1,1},
    {7,0,0,0,1,1,1,1},
    {1,1,1,0,1,1,1,1},
    {1,1,1,0,1,1,1,1},
    {1,1,1,6,1,1,1,1},
};/*!< 5th map array */

int const g_map_6[8][8]= {
    {1,1,1,1,1,1,1,1},
    {1,0,0,0,0,0,0,1},
    {1,0,0,0,0,0,0,1},
    {1,0,0,0,0,0,0,1},
    {1,0,0,0,0,0,0,1},
    {1,0,1,1,1,1,0,1},
    {1,0,0,0,0,0,0,1},
    {1,1,1,6,1,1,1,1},
};/*!< 6th map array */

int const g_map_7[8][8]= {
    {1,1,1,4,1,1,1,1},
    {1,0,0,0,1,0,0,1},
    {1,0,1,1,1,0,0,1},
    {1,0,1,0,0,0,0,1},
    {1,0,0,0,1,1,0,5},
    {1,0,0,0,1,1,1,1},
    {1,0,0,0,1,1,1,1},
    {1,1,1,1,1,1,1,1},
};/*!< 7th map array */
int const g_map_8[8][8]= {
    {1,1,1,1,1,1,1,1},
    {1,0,0,0,0,0,0,1},
    {1,0,0,0,0,0,0,1},
    {1,0,0,0,0,0,0,1},
    {7,0,0,0,0,0,0,2},
    {1,0,0,0,0,0,0,1},
    {1,0,0,0,0,0,0,1},
    {1,1,1,1,1,1,1,1},
};/*!< 8th map array */



int const g_map_9[8][8]= {
    {1,1,1,1,1,1,1,1},
    {1,0,0,0,0,0,0,1},
    {1,0,0,1,0,1,0,1},
    {1,1,0,1,0,1,1,1},
    {1,0,0,1,0,0,0,5},
    {1,0,1,1,1,1,1,1},
    {1,0,0,0,1,0,0,1},
    {1,1,1,6,1,1,1,1},
};/*!< 9th map array */

int const g_map_10[8][8]= {
    {1,1,1,1,1,1,1,1},
    {1,0,0,0,1,1,1,1},
    {1,0,1,0,1,1,1,1},
    {1,0,1,0,1,1,1,1},
    {7,0,1,0,1,0,0,5},
    {1,0,1,0,1,0,1,1},
    {1,0,0,0,0,0,1,1},
    {1,1,1,1,1,1,1,1},
};/*!< 10th map array */

int const g_map_11[8][8]= {
    {1,1,1,1,1,1,1,1},
    {1,0,0,0,0,0,0,1},
    {1,0,1,0,0,1,0,1},
    {1,0,0,0,0,0,0,1},
    {7,0,0,0,0,0,0,1},
    {1,0,1,0,0,1,0,1},
    {1,0,0,0,0,0,0,1},
    {1,1,1,6,1,1,1,1},
};/*!< 11th map array */

int const g_map_12[8][8]= {
    {1,1,1,4,1,1,1,1},
    {1,1,1,0,0,0,0,1},
    {1,1,1,1,1,1,0,1},
    {1,0,1,0,0,1,0,1},
    {7,0,1,0,0,1,0,1},
    {1,0,1,0,0,1,0,1},
    {1,0,0,0,0,0,0,1},
    {1,1,1,1,1,1,1,1},
};/*!< 12th map array */

int const g_map_13[8][8]= {
    {1,1,1,4,1,1,1,1},
    {1,1,1,0,0,0,0,1},
    {1,1,1,0,0,1,0,1},
    {1,1,1,1,1,1,0,1},
    {1,1,1,1,1,1,0,5},
    {1,0,1,0,0,1,0,1},
    {1,0,0,0,0,0,0,1},
    {1,1,1,6,1,1,1,1},
};/*!< 13th map array */



//########### SPRITES ############

int const g_player[6][6] = {
    {0,0,0,0,0,0},
    {0,0,1,1,1,1},
    {0,1,1,0,0,0},
    {0,1,1,0,1,0},
    {0,0,1,1,1,0},
    {0,0,0,0,1,0}
};/*!< player sprite array */

int const g_playerA[6][6] = {
    {0,0,0,0,1,1},
    {0,0,1,1,0,0},
    {0,1,1,0,0,0},
    {0,1,1,0,1,0},
    {0,0,1,1,1,0},
    {0,0,0,0,1,0}
};/*!< player attack sprite array */

//########## ITEMS/THING ###########
int const g_rock[6][6] = {
    {0,0,1,1,0,0},
    {0,1,0,0,1,0},
    {0,1,1,0,1,0},
    {1,0,0,1,0,1},
    {1,0,0,1,1,1},
    {1,1,1,1,1,1}
};/*!< rock sprite array */

int const g_heart[6][6] = {
    {0,1,0,0,1,0},
    {1,0,1,1,0,1},
    {1,0,0,0,0,1},
    {1,0,0,0,0,1},
    {0,1,0,0,1,0},
    {0,0,1,1,0,0}
};/*!< heart sprite array */

int const g_door[6][6] = {
    {0,1,1,1,1,0},
    {1,0,1,1,0,1},
    {1,0,1,1,0,1},
    {1,0,0,0,1,1},
    {1,0,0,0,0,1},
    {1,1,1,1,1,1}
};/*!< door sprite array */

int const g_exit[6][6] = {
    {1,1,1,1,1,1},
    {1,1,0,0,1,1},
    {0,1,1,1,1,0},
    {0,1,0,0,1,0},
    {0,1,1,1,1,0},
    {0,1,0,0,1,0}
};/*!< exit sprite array */

int const g_sword[6][6] = {
    {1,0,0,0,0,0},
    {0,1,1,1,0,0},
    {0,1,1,0,0,0},
    {0,1,0,1,0,0},
    {0,0,0,0,1,0},
    {0,0,0,0,0,1}
};/*!< sword sprite array */
//############## HOSTILES ##################
struct move {
    int nextstate;
    int nextx;
    int nexty;
    int facing;

};

int const g_rat[6][6] = {
    {0,0,0,0,0,0},
    {0,0,1,1,0,1},
    {0,1,1,1,1,0},
    {1,0,1,1,0,1},
    {1,0,0,0,0,0},
    {0,1,1,0,0,0}
};/*!< rat sprite array */
typedef const struct move RSTyp;

RSTyp const ratfsm[8] = {
    {1,1,0,1},
    {2,1,0,1},
    {3,0,1,2},
    {4,0,1,2},
    {5,-1,0,3},
    {6,-1,0,3},
    {7,0,-1,4},
    {0,0,-1,4}
};/*!< The FSM for the rat */

int const g_frog[6][6] = {
    {0,0,0,0,0,1},
    {1,1,0,0,1,0},
    {0,1,1,1,1,1},
    {0,1,1,1,1,1},
    {1,1,0,0,1,0},
    {0,0,0,0,0,1}
};/*!< frog sprite array */

typedef const struct move FSTyp;

FSTyp frogfsm[10] = {
    {1,1,0,1},
    {2,1,0,1},
    {3,1,0,1},
    {4,1,0,1},
    {5,1,0,1},
    {6,-1,0,1},
    {7,-1,0,3},
    {8,-1,0,3},
    {9,-1,0,3},
    {0,-1,0,3}

};/*!< The FSM for the frog */

int const g_crab[6][6] = {
    {1,0,0,1,1,0},
    {1,0,1,1,0,1},
    {0,1,1,0,0,0},
    {0,1,1,0,0,0},
    {1,0,1,1,0,1},
    {1,0,0,1,1,0}
};/*!< crab sprite array */

typedef const struct move CSTyp;

CSTyp crabfsm[2] = {
    {1,1,0,1},
    {0,-1,0,3}
};/*!< The FSM for the Crab */

int const g_shroom[6][6] = {
    {0,0,1,1,0,0},
    {0,1,0,0,1,0},
    {1,0,0,1,0,1},
    {1,1,0,0,1,1},
    {0,1,1,1,1,0},
    {1,1,0,0,1,1}
};/*!< shroom sprite array*/

typedef const struct move SSTyp;

SSTyp shroomfsm[4] = {
    {1,0,1,1},
    {2,0,1,1},
    {3,0,-1,1},
    {0,0,-1,1}
};/*!< The FSM for the shroom */

int const g_boss[6][6] = {
    {0,1,1,1,1,0},
    {1,0,0,1,0,1},
    {1,1,1,0,0,1},
    {1,0,0,0,0,1},
    {1,1,1,1,1,0},
    {0,1,0,1,0,1}
}; /*!< boss sprite array*/

typedef const struct move BSTyp;

BSTyp bossfsm[23] = {
    {1,1,1,1},
    {2,1,1,1},
    {3,1,-1,1},
    {4,1,-1,1},
    {5,-1,-1,2},
    {6,-1,-1,2},
    {7,-1,1,2},
    {8,-1,1,2},
    {9,2,0,1},
    {10,0,-2,1},
    {11,-2,0,2},
    {12,0,2,2},
    {13,2,0,1},
    {14,0,2,2},
    {15,-2,0,2},
    {16,0,-2,1},
    {17,0,-1,2},
    {18,1,0,1},
    {19,0,1,2},
    {0,-1,0,1},
};/*!< The FSM for the Boss */
#endif