Final Submission. I have read and agreed with Statement of Academic Integrity.

Dependencies:   mbed

Committer:
louisberard
Date:
Fri Jun 05 19:41:15 2020 +0000
Revision:
10:4f204c2ac16c
Parent:
9:b160a3de0d00
Final Submission. I have read and agreed with Statement of Academic Integrity.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
louisberard 10:4f204c2ac16c 1 /**
louisberard 10:4f204c2ac16c 2 ELEC2645 Embedded Systems Project
louisberard 10:4f204c2ac16c 3 School of Electronic & Electrical Engineering
louisberard 10:4f204c2ac16c 4 University of Leeds
louisberard 10:4f204c2ac16c 5 2019/20
louisberard 10:4f204c2ac16c 6
louisberard 10:4f204c2ac16c 7 Name: Louis Berard
louisberard 10:4f204c2ac16c 8 Username: LL17L2B
louisberard 10:4f204c2ac16c 9 Student ID Number: 201209172
louisberard 10:4f204c2ac16c 10 Date: 05/06/20
louisberard 10:4f204c2ac16c 11 */
eencae 0:7423345f87c5 12 #include "mbed.h"
eencae 0:7423345f87c5 13 #include "Gamepad.h"
eencae 0:7423345f87c5 14 #include "N5110.h"
louisberard 9:b160a3de0d00 15 ///Objects
louisberard 1:86f96ceaf593 16 Gamepad pad;
louisberard 1:86f96ceaf593 17 N5110 lcd;
louisberard 9:b160a3de0d00 18 ///initialise global variables to be used throughout the game
louisberard 9:b160a3de0d00 19 ///initial player position in all levels.
louisberard 1:86f96ceaf593 20 char player_char = 'x';
louisberard 10:4f204c2ac16c 21 int player_xpos = 9;
louisberard 4:8b75386f68ef 22 int player_ypos = 45;
louisberard 8:dc7b09f23d75 23 int aim_xpos;
louisberard 8:dc7b09f23d75 24 int aim_ypos;
louisberard 4:8b75386f68ef 25 int portal_1_xpos;
louisberard 4:8b75386f68ef 26 int portal_1_ypos;
louisberard 4:8b75386f68ef 27 int portal_2_xpos;
louisberard 4:8b75386f68ef 28 int portal_2_ypos;
louisberard 9:b160a3de0d00 29 ///initialise x direction movement
louisberard 8:dc7b09f23d75 30 int move = 0;
louisberard 9:b160a3de0d00 31 ///initialise terminators for menu and game loops.
louisberard 8:dc7b09f23d75 32 bool choice = false;
louisberard 8:dc7b09f23d75 33 bool endgame = false;
louisberard 9:b160a3de0d00 34 ///initialise Game array
louisberard 7:8e1111ab8a8c 35 char array[84][48];
louisberard 9:b160a3de0d00 36 /**the characters in the level array's represent the following:
louisberard 10:4f204c2ac16c 37 *'0' = air
louisberard 10:4f204c2ac16c 38 *'1' = right facing wall
louisberard 10:4f204c2ac16c 39 *'2' = floor
louisberard 10:4f204c2ac16c 40 *'3' = cieling
louisberard 10:4f204c2ac16c 41 *'4' = left facing wall
louisberard 10:4f204c2ac16c 42 *'B' = Button
louisberard 10:4f204c2ac16c 43 *'S' = Spikes
louisberard 10:4f204c2ac16c 44 *'P' = portal 1
louisberard 10:4f204c2ac16c 45 *'Q' = portal 2
louisberard 10:4f204c2ac16c 46 *'x' = player
louisberard 8:dc7b09f23d75 47 */
louisberard 9:b160a3de0d00 48 /// level 1
louisberard 7:8e1111ab8a8c 49 char _level_1[84][48] = {
louisberard 4:8b75386f68ef 50 {'3','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','2'},
louisberard 4:8b75386f68ef 51 {'3','0','0','0','0','0','0','0','0','0','2','3','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','2'},
louisberard 4:8b75386f68ef 52 {'3','0','0','0','0','0','0','0','0','0','2','3','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','2'},
louisberard 4:8b75386f68ef 53 {'3','0','0','0','0','0','0','0','0','B','2','3','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','2'},
louisberard 4:8b75386f68ef 54 {'3','0','0','0','0','0','0','0','0','B','2','3','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','2'},
louisberard 4:8b75386f68ef 55 {'3','0','0','0','0','0','0','0','0','B','2','3','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','2'},
louisberard 4:8b75386f68ef 56 {'3','0','0','0','0','0','0','0','0','B','2','3','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','2'},
louisberard 4:8b75386f68ef 57 {'3','0','0','0','0','0','0','0','0','B','2','3','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','2'},
louisberard 4:8b75386f68ef 58 {'3','0','0','0','0','0','0','0','0','B','2','3','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','2'},
louisberard 4:8b75386f68ef 59 {'3','0','0','0','0','0','0','0','0','B','2','3','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','2'},
louisberard 4:8b75386f68ef 60 {'3','0','0','0','0','0','0','0','0','B','2','3','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','2'},
louisberard 4:8b75386f68ef 61 {'3','0','0','0','0','0','0','0','0','B','2','3','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','2'},
louisberard 4:8b75386f68ef 62 {'3','0','0','0','0','0','0','0','0','B','2','3','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','2'},
louisberard 4:8b75386f68ef 63 {'3','0','0','0','0','0','0','0','0','B','2','3','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','2'},
louisberard 4:8b75386f68ef 64 {'3','0','0','0','0','0','0','0','0','0','2','3','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','2'},
louisberard 4:8b75386f68ef 65 {'3','0','0','0','0','0','0','0','0','0','2','3','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','2'},
louisberard 4:8b75386f68ef 66 {'3','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','2'},
louisberard 4:8b75386f68ef 67 {'3','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','2'},
louisberard 4:8b75386f68ef 68 {'3','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','2'},
louisberard 4:8b75386f68ef 69 {'3','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','2'},
louisberard 4:8b75386f68ef 70 {'3','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','2'},
louisberard 4:8b75386f68ef 71 {'3','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','2'},
louisberard 4:8b75386f68ef 72 {'3','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','2'},
louisberard 4:8b75386f68ef 73 {'3','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','2'},
louisberard 4:8b75386f68ef 74 {'3','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','2'},
louisberard 4:8b75386f68ef 75 {'3','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','2'},
louisberard 4:8b75386f68ef 76 {'3','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','2'},
louisberard 4:8b75386f68ef 77 {'3','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','2'},
louisberard 4:8b75386f68ef 78 {'3','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','2'},
louisberard 4:8b75386f68ef 79 {'3','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','2'},
louisberard 4:8b75386f68ef 80 {'3','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','2'},
louisberard 4:8b75386f68ef 81 {'3','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','2'},
louisberard 4:8b75386f68ef 82 {'3','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','2'},
louisberard 4:8b75386f68ef 83 {'3','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','2'},
louisberard 4:8b75386f68ef 84 {'3','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','2'},
louisberard 4:8b75386f68ef 85 {'3','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','2'},
louisberard 4:8b75386f68ef 86 {'3','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','2'},
louisberard 4:8b75386f68ef 87 {'3','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','2'},
louisberard 4:8b75386f68ef 88 {'3','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','2'},
louisberard 4:8b75386f68ef 89 {'3','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','2'},
louisberard 4:8b75386f68ef 90 {'3','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','2'},
louisberard 4:8b75386f68ef 91 {'3','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','2'},
louisberard 4:8b75386f68ef 92 {'3','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','2'},
louisberard 4:8b75386f68ef 93 {'3','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','2'},
louisberard 4:8b75386f68ef 94 {'3','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','2'},
louisberard 4:8b75386f68ef 95 {'3','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','2'},
louisberard 4:8b75386f68ef 96 {'3','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','2'},
louisberard 4:8b75386f68ef 97 {'3','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','2'},
louisberard 4:8b75386f68ef 98 {'3','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','2'},
louisberard 4:8b75386f68ef 99 {'3','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','2'},
louisberard 4:8b75386f68ef 100 {'3','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','2'},
louisberard 4:8b75386f68ef 101 {'3','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','2'},
louisberard 4:8b75386f68ef 102 {'3','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','2'},
louisberard 4:8b75386f68ef 103 {'3','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','2'},
louisberard 4:8b75386f68ef 104 {'3','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','2'},
louisberard 4:8b75386f68ef 105 {'3','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','2'},
louisberard 4:8b75386f68ef 106 {'3','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','2'},
louisberard 4:8b75386f68ef 107 {'3','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','2'},
louisberard 4:8b75386f68ef 108 {'3','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','2'},
louisberard 4:8b75386f68ef 109 {'3','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','2'},
louisberard 4:8b75386f68ef 110 {'3','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','2'},
louisberard 4:8b75386f68ef 111 {'3','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','2'},
louisberard 4:8b75386f68ef 112 {'3','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','2'},
louisberard 4:8b75386f68ef 113 {'3','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','2'},
louisberard 4:8b75386f68ef 114 {'3','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','2'},
louisberard 4:8b75386f68ef 115 {'3','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','2'},
louisberard 4:8b75386f68ef 116 {'3','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','2'},
louisberard 4:8b75386f68ef 117 {'3','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','2'},
louisberard 4:8b75386f68ef 118 {'3','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','2'},
louisberard 4:8b75386f68ef 119 {'3','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','1','1','1','1','1','1','1','1','1','2'},
louisberard 4:8b75386f68ef 120 {'3','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','4','4','4','4','4','4','4','4','4','4','4','2'},
louisberard 4:8b75386f68ef 121 {'3','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','2'},
louisberard 4:8b75386f68ef 122 {'3','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','2'},
louisberard 4:8b75386f68ef 123 {'3','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','2'},
louisberard 4:8b75386f68ef 124 {'3','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','2'},
louisberard 4:8b75386f68ef 125 {'3','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','2'},
louisberard 4:8b75386f68ef 126 {'3','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','2'},
louisberard 4:8b75386f68ef 127 {'3','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','2'},
louisberard 4:8b75386f68ef 128 {'3','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','2'},
louisberard 4:8b75386f68ef 129 {'3','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','2'},
louisberard 4:8b75386f68ef 130 {'3','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','2'},
louisberard 4:8b75386f68ef 131 {'3','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','D','D','D','D','D','D','D','D','D','D','D','D','D','D','D','D','D','2'},
louisberard 4:8b75386f68ef 132 {'3','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','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 4:8b75386f68ef 133 {'3','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','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 134 };
louisberard 9:b160a3de0d00 135 /// level 3
louisberard 8:dc7b09f23d75 136 char _level_3[84][48] = {
louisberard 7:8e1111ab8a8c 137 {'3','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','2'},
louisberard 7:8e1111ab8a8c 138 {'3','0','0','0','2','2','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 139 {'3','0','0','0','0','2','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 140 {'3','0','0','0','0','0','2','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 141 {'3','0','0','0','0','0','2','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 142 {'3','0','0','0','0','0','0','2','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 143 {'3','0','0','0','0','0','0','2','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 144 {'3','0','0','0','0','0','0','0','2','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 145 {'3','0','0','0','0','0','0','0','2','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 146 {'3','0','0','0','0','0','0','0','0','2','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 147 {'3','0','0','0','0','0','0','0','0','2','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 148 {'3','0','0','0','0','0','0','0','0','0','2','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','1','1','1','1','1','1','2'},
louisberard 7:8e1111ab8a8c 149 {'3','0','0','0','0','0','0','0','0','0','2','0','2','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','4','4','4','4','4','4','2'},
louisberard 7:8e1111ab8a8c 150 {'3','0','0','0','0','0','0','0','0','0','0','2','2','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','2','2','2'},
louisberard 7:8e1111ab8a8c 151 {'3','0','0','0','0','0','0','0','0','0','0','2','2','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','2','2','2'},
louisberard 7:8e1111ab8a8c 152 {'3','0','0','0','0','0','0','0','0','0','0','0','2','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','2','2','2'},
louisberard 7:8e1111ab8a8c 153 {'3','0','0','0','0','0','0','0','0','0','0','0','2','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','2','2','2'},
louisberard 7:8e1111ab8a8c 154 {'3','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','2','2','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 155 {'3','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','2','2','2','0','0','0','0','0','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 156 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','0','0','0','0','0','0','0','0','0','0','2','2','2','0','0','0','0','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 157 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','2','0','0','0','0','0','0','0','0','0','0','2','2','2','0','0','0','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 158 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','2','0','0','0','0','0','0','0','0','0','0','2','2','2','0','0','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 159 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','2','0','0','0','0','0','0','0','0','0','0','2','2','2','0','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 160 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','2','0','0','0','0','0','0','0','0','0','0','2','2','2','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 161 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','2','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 162 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','2','2','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 163 {'3','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','2','2','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 164 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 165 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 166 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 167 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 168 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 169 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 170 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 171 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 172 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 173 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 174 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 175 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 176 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 177 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 178 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 179 {'3','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','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 180 {'3','0','0','0','0','0','0','2','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','1','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 181 {'3','0','0','0','0','0','0','2','3','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 182 {'3','0','0','0','0','0','0','2','3','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','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 183 {'3','0','0','0','0','0','0','2','3','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','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 184 {'3','0','0','0','0','0','0','2','3','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','2','3','0','0','0','0','0','0','0','S','0','2'},
louisberard 7:8e1111ab8a8c 185 {'3','0','0','0','0','0','0','2','3','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','2','3','0','0','0','0','0','0','0','0','S','2'},
louisberard 7:8e1111ab8a8c 186 {'3','0','0','0','0','0','0','2','3','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','2','3','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 187 {'3','0','0','0','0','0','0','2','3','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','2','3','0','0','0','0','0','0','0','2','2','2'},
louisberard 7:8e1111ab8a8c 188 {'3','0','0','0','0','0','0','2','3','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','2','3','0','0','0','0','0','0','0','2','2','2'},
louisberard 7:8e1111ab8a8c 189 {'3','0','0','0','0','0','0','2','3','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','2','2','2'},
louisberard 7:8e1111ab8a8c 190 {'3','0','0','0','0','0','0','2','3','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','2','2','2'},
louisberard 7:8e1111ab8a8c 191 {'3','0','0','0','0','0','0','2','3','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','2','2','2'},
louisberard 7:8e1111ab8a8c 192 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 193 {'3','0','0','0','0','0','0','2','3','4','4','4','4','4','4','4','4','4','4','4','4','2','3','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','2'},
louisberard 7:8e1111ab8a8c 194 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','4','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 195 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 196 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 197 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 198 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 199 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 200 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 201 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 202 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 203 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 204 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 205 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 206 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 207 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 208 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 209 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 210 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 211 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','B','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 212 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','B','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 213 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','B','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 214 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','B','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 215 {'3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','B','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 216 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 217 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','1','1','1','1','1','1','1','1','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 218 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','4','4','4','4','4','4','4','4','2','3','D','D','D','D','D','D','D','D','D','D','D','D','D','D','D','2'},
louisberard 7:8e1111ab8a8c 219 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','2','1','1','1','1','1','1','1','1','2','3','0','0','0','0','0','0','0','D','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 220 {'3','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','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 221 };
louisberard 9:b160a3de0d00 222 /// level 2
louisberard 8:dc7b09f23d75 223 char _level_2[84][48] = {
louisberard 7:8e1111ab8a8c 224 {'3','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','4','2'},
louisberard 7:8e1111ab8a8c 225 {'3','0','0','0','2','2','0','0','0','0','0','0','0','2','3','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','2','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 226 {'3','0','0','0','0','2','0','0','0','0','0','0','0','2','3','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','2','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 227 {'3','0','0','0','0','0','2','0','0','0','0','0','0','2','3','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','2','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 228 {'3','0','0','0','0','0','2','0','0','0','0','0','0','2','3','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','2','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 229 {'3','0','0','0','0','0','0','2','0','0','0','0','0','2','3','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','2','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 230 {'3','0','0','0','0','0','0','2','0','0','0','0','0','2','3','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','4','4','4','4','4','4','2'},
louisberard 7:8e1111ab8a8c 231 {'3','0','0','0','0','0','0','0','2','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 232 {'3','0','0','0','0','0','0','0','2','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 233 {'3','0','0','0','0','0','0','0','0','2','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 234 {'3','0','0','0','0','0','0','0','0','2','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 235 {'3','0','0','0','0','0','0','0','0','0','2','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 236 {'3','0','0','0','0','0','0','0','0','0','2','0','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 237 {'3','0','0','0','0','0','0','0','0','0','0','2','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 238 {'3','0','0','0','0','0','0','0','0','0','0','2','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 239 {'3','0','0','0','0','0','0','0','0','0','0','0','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 240 {'3','0','0','0','0','0','0','0','0','0','0','0','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 241 {'3','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','2'},
louisberard 7:8e1111ab8a8c 242 {'3','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','2'},
louisberard 7:8e1111ab8a8c 243 {'3','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','2'},
louisberard 7:8e1111ab8a8c 244 {'3','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','2'},
louisberard 7:8e1111ab8a8c 245 {'3','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','2'},
louisberard 7:8e1111ab8a8c 246 {'3','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','2'},
louisberard 7:8e1111ab8a8c 247 {'3','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','2'},
louisberard 7:8e1111ab8a8c 248 {'3','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','2'},
louisberard 7:8e1111ab8a8c 249 {'3','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','2'},
louisberard 7:8e1111ab8a8c 250 {'3','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','2'},
louisberard 7:8e1111ab8a8c 251 {'3','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','2'},
louisberard 7:8e1111ab8a8c 252 {'3','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','2'},
louisberard 7:8e1111ab8a8c 253 {'3','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','2'},
louisberard 7:8e1111ab8a8c 254 {'3','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','2'},
louisberard 7:8e1111ab8a8c 255 {'3','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','2'},
louisberard 7:8e1111ab8a8c 256 {'3','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','2'},
louisberard 7:8e1111ab8a8c 257 {'3','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','2'},
louisberard 7:8e1111ab8a8c 258 {'3','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','2'},
louisberard 7:8e1111ab8a8c 259 {'3','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','2'},
louisberard 7:8e1111ab8a8c 260 {'3','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','2'},
louisberard 7:8e1111ab8a8c 261 {'3','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','2'},
louisberard 7:8e1111ab8a8c 262 {'3','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','2'},
louisberard 7:8e1111ab8a8c 263 {'3','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','2'},
louisberard 7:8e1111ab8a8c 264 {'3','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','2'},
louisberard 7:8e1111ab8a8c 265 {'3','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','2'},
louisberard 7:8e1111ab8a8c 266 {'3','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','2'},
louisberard 7:8e1111ab8a8c 267 {'3','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','2'},
louisberard 7:8e1111ab8a8c 268 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 269 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 270 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 271 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 272 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 273 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 274 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 275 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 276 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 277 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 278 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 279 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 280 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 281 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 282 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 283 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 284 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 285 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 286 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 287 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 288 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 289 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 290 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 291 {'3','0','0','0','0','0','0','2','3','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','2'},
louisberard 7:8e1111ab8a8c 292 {'3','0','0','0','0','0','0','2','3','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','1','1','1','1','1','1','1','1','1','2'},
louisberard 7:8e1111ab8a8c 293 {'3','0','0','0','0','0','2','2','3','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','2','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 294 {'3','0','0','0','0','B','2','2','3','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','4','4','4','4','4','4','4','4','4','4','4','2'},
louisberard 7:8e1111ab8a8c 295 {'3','0','0','0','0','B','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 296 {'3','0','0','0','0','B','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 297 {'3','0','0','0','0','B','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 298 {'3','0','0','0','0','B','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 299 {'3','0','0','0','0','B','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 300 {'3','0','0','0','0','B','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 301 {'3','0','0','0','0','B','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 302 {'3','0','0','0','0','B','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 303 {'3','0','0','0','0','B','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 304 {'3','0','0','0','0','0','2','2','3','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','2'},
louisberard 7:8e1111ab8a8c 305 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','1','D','D','D','D','D','D','D','D','D','D','D','D','D','D','D','D','D','2'},
louisberard 7:8e1111ab8a8c 306 {'3','0','0','0','0','0','0','2','3','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 7:8e1111ab8a8c 307 {'3','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','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','2'},
louisberard 10:4f204c2ac16c 308 };
louisberard 9:b160a3de0d00 309 ///Prototypes
louisberard 1:86f96ceaf593 310 void pad_init();
louisberard 1:86f96ceaf593 311 void update_display();
louisberard 1:86f96ceaf593 312 void apply_move();
louisberard 1:86f96ceaf593 313 void add_player_array();
louisberard 2:586409836de7 314 void get_move(int, Gamepad &pad);
louisberard 1:86f96ceaf593 315 void print_screen();
louisberard 2:586409836de7 316 void collision_detection(int);
louisberard 2:586409836de7 317 void erase_old_sprites(char,char);
louisberard 2:586409836de7 318 void jump();
louisberard 5:a33d791bd7fb 319 void get_portal_angle();
louisberard 4:8b75386f68ef 320 void place_portal_1();
louisberard 4:8b75386f68ef 321 void place_portal_2();
louisberard 9:b160a3de0d00 322 ///Main function
louisberard 10:4f204c2ac16c 323 int main(){
louisberard 9:b160a3de0d00 324 ///initialise the pad
louisberard 1:86f96ceaf593 325 pad_init();
louisberard 9:b160a3de0d00 326 ///loop until player has selected an option from the menu
louisberard 10:4f204c2ac16c 327 while(choice == false){
louisberard 9:b160a3de0d00 328 ///print welcome screen
louisberard 7:8e1111ab8a8c 329 lcd.clear();
louisberard 7:8e1111ab8a8c 330 lcd.printString("Welcome to",0,0);
louisberard 7:8e1111ab8a8c 331 lcd.printString("2D Portal!",0,1);
louisberard 7:8e1111ab8a8c 332 lcd.printString("A = controls",0,2);
louisberard 7:8e1111ab8a8c 333 lcd.printString("B = Level 1",0,3);
louisberard 7:8e1111ab8a8c 334 lcd.printString("X = Level 2",0,4);
louisberard 8:dc7b09f23d75 335 lcd.printString("Y = Level 3",0,5);
louisberard 7:8e1111ab8a8c 336 update_display();
louisberard 9:b160a3de0d00 337 ///cycle LED's whilst on home screen
louisberard 7:8e1111ab8a8c 338 pad.led(1,1);
louisberard 7:8e1111ab8a8c 339 wait(0.05);
louisberard 7:8e1111ab8a8c 340 pad.leds_off();
louisberard 7:8e1111ab8a8c 341 pad.led(4,1);
louisberard 7:8e1111ab8a8c 342 wait(0.05);
louisberard 7:8e1111ab8a8c 343 pad.leds_off();
louisberard 7:8e1111ab8a8c 344 pad.led(2,1);
louisberard 7:8e1111ab8a8c 345 wait(0.05);
louisberard 7:8e1111ab8a8c 346 pad.leds_off();
louisberard 7:8e1111ab8a8c 347 pad.led(5,1);
louisberard 7:8e1111ab8a8c 348 wait(0.05);
louisberard 7:8e1111ab8a8c 349 pad.leds_off();
louisberard 7:8e1111ab8a8c 350 pad.led(3,1);
louisberard 7:8e1111ab8a8c 351 wait(0.05);
louisberard 7:8e1111ab8a8c 352 pad.leds_off();
louisberard 7:8e1111ab8a8c 353 pad.led(6,1);
louisberard 7:8e1111ab8a8c 354 wait(0.05);
louisberard 7:8e1111ab8a8c 355 pad.leds_off();
louisberard 9:b160a3de0d00 356 /// print the controls for 5 seconds, then return to the menu screen.
louisberard 7:8e1111ab8a8c 357 if(pad.A_pressed() == 1){
louisberard 7:8e1111ab8a8c 358 lcd.clear();
louisberard 7:8e1111ab8a8c 359 lcd.printString("Joystick =Move",0,0);
louisberard 7:8e1111ab8a8c 360 lcd.printString("B = Portal 1",0,1);
louisberard 7:8e1111ab8a8c 361 lcd.printString("Y = portal 2",0,2);
louisberard 7:8e1111ab8a8c 362 lcd.printString("Pot2 = aim ",0,4);
louisberard 7:8e1111ab8a8c 363 lcd.printString("A = jump",0,3);
louisberard 7:8e1111ab8a8c 364 lcd.printString("Reset=Restart",0,5);
louisberard 7:8e1111ab8a8c 365 lcd.refresh();
louisberard 7:8e1111ab8a8c 366 wait_ms(5000);
louisberard 7:8e1111ab8a8c 367 choice = false;
louisberard 10:4f204c2ac16c 368 //printf("instructions selected\n");
louisberard 10:4f204c2ac16c 369 }
louisberard 9:b160a3de0d00 370 ///loads level 1.
louisberard 7:8e1111ab8a8c 371 else if(pad.B_pressed() == 1){
louisberard 7:8e1111ab8a8c 372 for(int i = 0; i < 84; i ++){
louisberard 7:8e1111ab8a8c 373 for(int j = 0; j < 48; j ++){
louisberard 7:8e1111ab8a8c 374 array[i][j] = _level_1[i][j];
louisberard 10:4f204c2ac16c 375 choice = true;
louisberard 10:4f204c2ac16c 376 }
louisberard 10:4f204c2ac16c 377 }
louisberard 10:4f204c2ac16c 378 }
louisberard 9:b160a3de0d00 379 ///loads level 2
louisberard 7:8e1111ab8a8c 380 else if(pad.X_pressed() == 1){
louisberard 7:8e1111ab8a8c 381 for(int i = 0; i < 84; i ++){
louisberard 7:8e1111ab8a8c 382 for(int j = 0; j < 48; j ++){
louisberard 7:8e1111ab8a8c 383 array[i][j] = _level_2[i][j];
louisberard 10:4f204c2ac16c 384 choice = true;
louisberard 10:4f204c2ac16c 385 }
louisberard 10:4f204c2ac16c 386 }
louisberard 10:4f204c2ac16c 387 }
louisberard 9:b160a3de0d00 388 ///loads level 3
louisberard 7:8e1111ab8a8c 389 else if(pad.Y_pressed() == 1){
louisberard 7:8e1111ab8a8c 390 for(int i = 0; i < 84; i ++){
louisberard 7:8e1111ab8a8c 391 for(int j = 0; j < 48; j ++){
louisberard 7:8e1111ab8a8c 392 array[i][j] = _level_3[i][j];
louisberard 10:4f204c2ac16c 393 choice = true;
louisberard 10:4f204c2ac16c 394 }
louisberard 10:4f204c2ac16c 395 }
louisberard 10:4f204c2ac16c 396 }
louisberard 9:b160a3de0d00 397 ///refresh lcd to display chosen level when menu loop breaks.
louisberard 7:8e1111ab8a8c 398 lcd.refresh();
louisberard 7:8e1111ab8a8c 399 }
louisberard 9:b160a3de0d00 400 ///Loop runs until the player has solved the puzzle and exited the right hand side of the screen.
louisberard 2:586409836de7 401 while(endgame == false){
louisberard 9:b160a3de0d00 402 /// converts joystick input into left or right movement.
louisberard 2:586409836de7 403 get_move(move, pad);
louisberard 9:b160a3de0d00 404 /// checks to see if the move is valid and handles teleportation logic.
louisberard 2:586409836de7 405 collision_detection(move);
louisberard 9:b160a3de0d00 406 /// checks to see if the player has jumped, if they have then the players y pos will descrease by 1
louisberard 2:586409836de7 407 if(pad.A_pressed() == 1){
louisberard 2:586409836de7 408 jump();
louisberard 10:4f204c2ac16c 409 }
louisberard 9:b160a3de0d00 410 ///checks to see if the player has placed portal 1, if they have then the portal will be placed in the array
louisberard 4:8b75386f68ef 411 else if(pad.B_pressed() == 1){
louisberard 10:4f204c2ac16c 412 int portal_1_counter = 0;
louisberard 4:8b75386f68ef 413 place_portal_1();
louisberard 9:b160a3de0d00 414 ///turns on left red led (LED1) to show portal 1 has been placed.
louisberard 8:dc7b09f23d75 415 pad.led(1,1);
louisberard 10:4f204c2ac16c 416 for(int i = 0; i < 84; i ++){
louisberard 10:4f204c2ac16c 417 for(int j = 0; j < 48; j ++){
louisberard 10:4f204c2ac16c 418 if (array[i][j] == 'P'){
louisberard 10:4f204c2ac16c 419 portal_1_counter+= 1;
louisberard 10:4f204c2ac16c 420 }
louisberard 10:4f204c2ac16c 421 }
louisberard 5:a33d791bd7fb 422 }
louisberard 10:4f204c2ac16c 423 if (portal_1_counter == 1){
louisberard 10:4f204c2ac16c 424 //printf("exactly 1 portal 1 has been placed\n");
louisberard 10:4f204c2ac16c 425 }
louisberard 10:4f204c2ac16c 426 }
louisberard 9:b160a3de0d00 427 ///checks to see if the player has placed portal 2, if they have then the portal will be placed in the array
louisberard 4:8b75386f68ef 428 else if(pad.Y_pressed() == 1){
louisberard 10:4f204c2ac16c 429 int portal_2_counter = 0;
louisberard 4:8b75386f68ef 430 place_portal_2();
louisberard 9:b160a3de0d00 431 ///turns on right red led (LED4) to show portal 2 has been placed.
louisberard 8:dc7b09f23d75 432 pad.led(4,1);
louisberard 10:4f204c2ac16c 433 for(int i = 0; i < 84; i ++){
louisberard 10:4f204c2ac16c 434 for(int j = 0; j < 48; j ++){
louisberard 10:4f204c2ac16c 435 if (array[i][j] == 'Q'){
louisberard 10:4f204c2ac16c 436 portal_2_counter+= 1;
louisberard 10:4f204c2ac16c 437 }
louisberard 10:4f204c2ac16c 438 }
louisberard 5:a33d791bd7fb 439 }
louisberard 10:4f204c2ac16c 440 if (portal_2_counter == 1){
louisberard 10:4f204c2ac16c 441 //printf("exactly 1 portal 2 has been placed\n");
louisberard 10:4f204c2ac16c 442 }
louisberard 10:4f204c2ac16c 443 }
louisberard 2:586409836de7 444 else
louisberard 9:b160a3de0d00 445 ///handles setting the new position of the player in the array and erasing the previous player position from the array.
louisberard 1:86f96ceaf593 446 apply_move();
louisberard 9:b160a3de0d00 447 ///prints to the lcd
louisberard 10:4f204c2ac16c 448 int player_counter = 0;
louisberard 10:4f204c2ac16c 449 for(int i = 0; i < 84; i ++){
louisberard 10:4f204c2ac16c 450 for(int j = 0; j < 48; j ++){
louisberard 10:4f204c2ac16c 451 if (array[i][j] == 'x'){
louisberard 10:4f204c2ac16c 452 player_counter+=1;
louisberard 10:4f204c2ac16c 453 }
louisberard 10:4f204c2ac16c 454 }
louisberard 10:4f204c2ac16c 455 }
louisberard 10:4f204c2ac16c 456 if (player_counter == 1){
louisberard 10:4f204c2ac16c 457 //printf("exactly 1 player has been placed\n");
louisberard 10:4f204c2ac16c 458 }
louisberard 1:86f96ceaf593 459 print_screen();
louisberard 9:b160a3de0d00 460 ///refreshes the lcd to display the new screen after movement.
louisberard 1:86f96ceaf593 461 update_display();
louisberard 9:b160a3de0d00 462 /// the objective of the game is to open the door and walk through it. as the door is on the right hand side of the screen, when the player
louisberard 9:b160a3de0d00 463 /// xpos exceeds 82, the puzzle is assumed to be solved as the door has to be opened to progress.
louisberard 4:8b75386f68ef 464 if(player_xpos > 82){
louisberard 10:4f204c2ac16c 465 endgame = true;
louisberard 10:4f204c2ac16c 466 }
eencae 0:7423345f87c5 467 }
louisberard 9:b160a3de0d00 468 ///clear the level and print the win screen
louisberard 4:8b75386f68ef 469 lcd.clear();
louisberard 8:dc7b09f23d75 470 lcd.printString("Puzzle solved!",0,0);
louisberard 10:4f204c2ac16c 471 lcd.printString("Press reset",0,1);
louisberard 10:4f204c2ac16c 472 lcd.printString("To play again",0,2);
louisberard 4:8b75386f68ef 473 lcd.refresh();
eencae 0:7423345f87c5 474 }
louisberard 9:b160a3de0d00 475 ///initialise the game array with 0's
louisberard 1:86f96ceaf593 476 void array_init(){
louisberard 3:2e2134c27c23 477 for(int j = 0; j < 48; j++){
louisberard 3:2e2134c27c23 478 for(int i = 0; i < 84; i++){
louisberard 1:86f96ceaf593 479 array[i][j] = '0';
louisberard 10:4f204c2ac16c 480 }
louisberard 10:4f204c2ac16c 481 }
louisberard 10:4f204c2ac16c 482 }
louisberard 1:86f96ceaf593 483 void apply_move(){
louisberard 9:b160a3de0d00 484 /// removes old player char in the array and increments the value of the player_xpos by the value in move
louisberard 1:86f96ceaf593 485 int old_player_xpos = player_xpos;
louisberard 1:86f96ceaf593 486 player_xpos += move;
louisberard 1:86f96ceaf593 487 array[old_player_xpos][player_ypos] = '0';
louisberard 10:4f204c2ac16c 488 //printf("player has moved!");
louisberard 9:b160a3de0d00 489 ///checks if the player is in the air, if they are then increase y by 1 until the player is on the floor and remove the old player char from the array
louisberard 2:586409836de7 490 int old_player_ypos = player_ypos;
louisberard 2:586409836de7 491 if(array[player_xpos][player_ypos+1] == '0'){
louisberard 2:586409836de7 492 player_ypos += 1;
louisberard 2:586409836de7 493 array[player_xpos][old_player_ypos] = '0';
louisberard 10:4f204c2ac16c 494 //printf("player has moved down!");
louisberard 10:4f204c2ac16c 495 }
louisberard 9:b160a3de0d00 496 ///checks if the player has landed on spikes and displays the end game screen with instructions for how to restart the game if they have.
louisberard 7:8e1111ab8a8c 497 else if(array[player_xpos][player_ypos+1] == 'S'){
louisberard 7:8e1111ab8a8c 498 lcd.clear();
louisberard 7:8e1111ab8a8c 499 lcd.printString("Spike hit!",0,0);
louisberard 7:8e1111ab8a8c 500 lcd.printString("Restart to",0,1);
louisberard 7:8e1111ab8a8c 501 lcd.printString("Try again!",0,2);
louisberard 7:8e1111ab8a8c 502 lcd.refresh();
louisberard 7:8e1111ab8a8c 503 wait_ms(1000000000);
louisberard 9:b160a3de0d00 504 ///places the player char in the array
louisberard 8:dc7b09f23d75 505 add_player_array();
louisberard 10:4f204c2ac16c 506 }
louisberard 1:86f96ceaf593 507 }
louisberard 9:b160a3de0d00 508 /// converts the chars in the array to on or off pixels, dependant on the type of object in the array. i.e walls are a dark pixel and portals are a light pixel
louisberard 9:b160a3de0d00 509 /// this helps to distinguis where the portals are.
louisberard 1:86f96ceaf593 510 void print_screen(){
louisberard 10:4f204c2ac16c 511 for(int j = 0; j < 48; j++){
louisberard 10:4f204c2ac16c 512 for(int i = 0; i < 84; i++){
louisberard 1:86f96ceaf593 513
louisberard 10:4f204c2ac16c 514 if (array[i][j] == '0'){
louisberard 10:4f204c2ac16c 515 lcd.setPixel(i,j,false);
louisberard 10:4f204c2ac16c 516 }
louisberard 10:4f204c2ac16c 517 else if(array[i][j] == '1'){
louisberard 10:4f204c2ac16c 518 lcd.setPixel(i,j, true);
louisberard 10:4f204c2ac16c 519 }
louisberard 10:4f204c2ac16c 520 else if(array[i][j] == '2'){
louisberard 10:4f204c2ac16c 521 lcd.setPixel(i,j, true);
louisberard 10:4f204c2ac16c 522 }
louisberard 10:4f204c2ac16c 523 else if(array[i][j] == '3'){
louisberard 10:4f204c2ac16c 524 lcd.setPixel(i,j, true);
louisberard 10:4f204c2ac16c 525 }
louisberard 10:4f204c2ac16c 526 else if(array[i][j] == '4'){
louisberard 10:4f204c2ac16c 527 lcd.setPixel(i,j, true);
louisberard 10:4f204c2ac16c 528 }
louisberard 10:4f204c2ac16c 529 else if(array[i][j] == 'x'){
louisberard 10:4f204c2ac16c 530 lcd.setPixel(i,j, true);
louisberard 10:4f204c2ac16c 531 }
louisberard 1:86f96ceaf593 532
louisberard 10:4f204c2ac16c 533 else if(array[i][j] == 'P' || array[i][j] == 'Q'){
louisberard 10:4f204c2ac16c 534 lcd.setPixel(i,j, false);
louisberard 1:86f96ceaf593 535 }
louisberard 10:4f204c2ac16c 536 else if(array[i][j] == 'B' || array[i][j] == 'D'|| array[i][j] == 'S'){
louisberard 10:4f204c2ac16c 537 lcd.setPixel(i,j, true);
louisberard 4:8b75386f68ef 538 }
louisberard 10:4f204c2ac16c 539 }
louisberard 10:4f204c2ac16c 540 }
louisberard 9:b160a3de0d00 541 /// finds the position pot(2) is aiming at and prints the aim assist line
louisberard 5:a33d791bd7fb 542 get_portal_angle();
louisberard 9:b160a3de0d00 543 /// prints the player sprite
louisberard 5:a33d791bd7fb 544 lcd.setPixel(player_xpos,player_ypos-1, true);
louisberard 5:a33d791bd7fb 545 lcd.setPixel(player_xpos-1,player_ypos-2, true);
louisberard 5:a33d791bd7fb 546 lcd.setPixel(player_xpos-1,player_ypos-3, true);
louisberard 4:8b75386f68ef 547 lcd.setPixel(player_xpos-2,player_ypos-3, true);
louisberard 5:a33d791bd7fb 548 lcd.setPixel(player_xpos,player_ypos-3, true);
louisberard 5:a33d791bd7fb 549 lcd.setPixel(player_xpos-1,player_ypos-4, true);
louisberard 5:a33d791bd7fb 550 lcd.setPixel(player_xpos-2,player_ypos-1, true);
louisberard 5:a33d791bd7fb 551 lcd.setPixel(player_xpos-2,player_ypos, true);
louisberard 10:4f204c2ac16c 552 }
louisberard 9:b160a3de0d00 553 ///initilise the pad and LCD
louisberard 10:4f204c2ac16c 554 void pad_init(){
eencae 0:7423345f87c5 555 lcd.init();
louisberard 3:2e2134c27c23 556 lcd.setContrast(0.45);
louisberard 1:86f96ceaf593 557 lcd.clear();
eencae 0:7423345f87c5 558 pad.init();
eencae 0:7423345f87c5 559 }
louisberard 9:b160a3de0d00 560 ///places the player char in the array
louisberard 10:4f204c2ac16c 561 void add_player_array(){
louisberard 1:86f96ceaf593 562 array[player_xpos][player_ypos] = player_char;
eencae 0:7423345f87c5 563 }
louisberard 9:b160a3de0d00 564 /// takes the input from the joystick and converts it into left/rigth movments
louisberard 10:4f204c2ac16c 565 void get_move(int, Gamepad &pad){
louisberard 10:4f204c2ac16c 566 char d = pad.get_direction();
louisberard 10:4f204c2ac16c 567 if(d == E){
louisberard 10:4f204c2ac16c 568 move = 1;
louisberard 10:4f204c2ac16c 569 }
louisberard 10:4f204c2ac16c 570 else if(d == W){
louisberard 10:4f204c2ac16c 571 move = -1;
louisberard 1:86f96ceaf593 572 }
louisberard 2:586409836de7 573 else move = 0;
louisberard 10:4f204c2ac16c 574 }
louisberard 9:b160a3de0d00 575 /// refreshes the display with the updated game screen
louisberard 10:4f204c2ac16c 576 void update_display(){
louisberard 9:b160a3de0d00 577 lcd.refresh(); ///Refreshes the lcd so the pixels appear
louisberard 9:b160a3de0d00 578 wait_ms(150); ///Frame rate of game
louisberard 2:586409836de7 579 }
louisberard 10:4f204c2ac16c 580 void collision_detection(int){
louisberard 9:b160a3de0d00 581 ///check if the player is moving into any object other than air. if they are then x direction movement = 0
louisberard 7:8e1111ab8a8c 582 char dir = pad.get_direction();
louisberard 7:8e1111ab8a8c 583 if(array[player_xpos+1][player_ypos] != '0' && dir == E){
louisberard 10:4f204c2ac16c 584 move = 0;
louisberard 10:4f204c2ac16c 585 }
louisberard 7:8e1111ab8a8c 586 else if(array[player_xpos-1][player_ypos] != '0' && dir == W){
louisberard 10:4f204c2ac16c 587 move = 0;
louisberard 10:4f204c2ac16c 588 }
louisberard 9:b160a3de0d00 589 /// checks if the player is directly next to a portal and runs the logic to check where the player should be teleported to. This is dependant on the surfaces the second portal is placed on.
louisberard 4:8b75386f68ef 590 if(array[player_xpos+1][player_ypos] == 'P' || array[player_xpos-1][player_ypos] == 'P' || array[player_xpos][player_ypos-1] == 'P' || array[player_xpos][player_ypos+1] == 'P' ){
louisberard 5:a33d791bd7fb 591 move = 0;
louisberard 9:b160a3de0d00 592 /// removes the old player char from the array
louisberard 5:a33d791bd7fb 593 array[player_xpos][player_ypos] = '0';
louisberard 9:b160a3de0d00 594 ///logic for entering portal 1
louisberard 9:b160a3de0d00 595 /// if the position horizontally next to portal 2 is a '3' then portal 2 has been placed on a ceiling and the player must be placed below portal 2.
louisberard 5:a33d791bd7fb 596 if (array[portal_2_xpos-1][portal_2_ypos] == '3'){
louisberard 4:8b75386f68ef 597 player_xpos = portal_2_xpos;
louisberard 10:4f204c2ac16c 598 player_ypos = portal_2_ypos+2;
louisberard 10:4f204c2ac16c 599 }
louisberard 9:b160a3de0d00 600 /// if the position horizontally next to portal 2 is a '2' then portal 2 has been placed on a floor and the player must be placed above and to the side of portal 2 so they dont fall back in.
louisberard 5:a33d791bd7fb 601 else if(array[portal_2_xpos-1][portal_2_ypos] == '2'){
louisberard 4:8b75386f68ef 602 player_xpos = portal_2_xpos + 1;
louisberard 10:4f204c2ac16c 603 player_ypos = portal_2_ypos-1;
louisberard 10:4f204c2ac16c 604 }
louisberard 9:b160a3de0d00 605 /// if the position vertically next to portal 2 is a '1' then portal 2 has been placed on a right facing wall and the player must be placed on the left of portal 2.
louisberard 7:8e1111ab8a8c 606 else if(array[portal_2_xpos][portal_2_ypos - 1] == '1'){
louisberard 5:a33d791bd7fb 607 player_xpos = portal_2_xpos - 2;
louisberard 10:4f204c2ac16c 608 player_ypos = portal_2_ypos;
louisberard 10:4f204c2ac16c 609 }
louisberard 9:b160a3de0d00 610 /// if the position vertically next to portal 2 is a '4' then portal 2 has been placed on a left facing wall and the player must be placed on the right of portal 2.
louisberard 7:8e1111ab8a8c 611 else if(array[portal_2_xpos][portal_2_ypos - 1] == '4'){
louisberard 5:a33d791bd7fb 612 player_xpos = portal_2_xpos + 2;
louisberard 10:4f204c2ac16c 613 player_ypos = portal_2_ypos;
louisberard 10:4f204c2ac16c 614 }
louisberard 10:4f204c2ac16c 615 }
louisberard 9:b160a3de0d00 616 /// logic for entering portal 2
louisberard 7:8e1111ab8a8c 617 else if(array[player_xpos+1][player_ypos] == 'Q' || array[player_xpos-1][player_ypos] == 'Q' || array[player_xpos][player_ypos-1] == 'Q' || array[player_xpos][player_ypos+1] == 'Q' ){
louisberard 5:a33d791bd7fb 618 move = 0;
louisberard 5:a33d791bd7fb 619 array[player_xpos][player_ypos] = '0';
louisberard 9:b160a3de0d00 620 /// if the position horizontally next to portal 1 is a '3' then portal 1 has been placed on a ceiling and the player must be placed below portal 1.
louisberard 5:a33d791bd7fb 621 if (array[portal_1_xpos-1][portal_1_ypos] == '3'){
louisberard 4:8b75386f68ef 622 player_xpos = portal_1_xpos;
louisberard 10:4f204c2ac16c 623 player_ypos = portal_1_ypos+2;
louisberard 10:4f204c2ac16c 624 }
louisberard 9:b160a3de0d00 625 /// if the position horizontally next to portal 1 is a '2' then portal 1 has been placed on a floor and the player must be placed above and to the side of portal 1 so they dont fall back in.
louisberard 5:a33d791bd7fb 626 else if(array[portal_1_xpos-1][portal_1_ypos] == '2'){
louisberard 4:8b75386f68ef 627 player_xpos = portal_1_xpos + 1;
louisberard 10:4f204c2ac16c 628 player_ypos = portal_1_ypos-1;
louisberard 10:4f204c2ac16c 629 }
louisberard 9:b160a3de0d00 630 /// if the position vertically next to portal 1 is a '1' then portal 1 has been placed on a right facing wall and the player must be placed on the left of portal 1.
louisberard 7:8e1111ab8a8c 631 else if(array[portal_1_xpos][portal_1_ypos - 1] == '1'){
louisberard 5:a33d791bd7fb 632 player_xpos = portal_1_xpos - 2;
louisberard 10:4f204c2ac16c 633 player_ypos = portal_1_ypos;
louisberard 10:4f204c2ac16c 634 }
louisberard 9:b160a3de0d00 635 /// if the position vertically next to portal 1 is a '4' then portal 1 has been placed on a left facing wall and the player must be placed on the right of portal 1.
louisberard 7:8e1111ab8a8c 636 else if(array[portal_1_xpos][portal_1_ypos - 1] == '4'){
louisberard 5:a33d791bd7fb 637 player_xpos = portal_1_xpos + 2;
louisberard 10:4f204c2ac16c 638 player_ypos = portal_1_ypos;
louisberard 10:4f204c2ac16c 639 }
louisberard 10:4f204c2ac16c 640 }
louisberard 9:b160a3de0d00 641 ///removes the old player char from the array and replaces it with zero
louisberard 4:8b75386f68ef 642 erase_old_sprites(player_xpos, player_ypos);
louisberard 9:b160a3de0d00 643 ///checks if the player has stepped on the button, if they have then the button and door are replaced by air and the route to the exit is open.
louisberard 4:8b75386f68ef 644 if(array[player_xpos][player_ypos+1] == 'B'){
louisberard 4:8b75386f68ef 645 for(int i = 0; i < 84; i++){
louisberard 4:8b75386f68ef 646 for(int j = 0; j < 48; j++){
louisberard 4:8b75386f68ef 647 if(array[i][j] == 'D' || array[i][j] == 'B'){
louisberard 10:4f204c2ac16c 648 array[i][j] = '0';
louisberard 10:4f204c2ac16c 649 }
louisberard 10:4f204c2ac16c 650 }
louisberard 10:4f204c2ac16c 651 }
louisberard 10:4f204c2ac16c 652 //printf("Doors and buttons removed!");
louisberard 10:4f204c2ac16c 653 }
louisberard 2:586409836de7 654 }
louisberard 9:b160a3de0d00 655 /// removes the old player character from the array.
louisberard 10:4f204c2ac16c 656 void erase_old_sprites(char,char){
louisberard 2:586409836de7 657 int old_player_xpos = player_xpos;
louisberard 2:586409836de7 658 array[old_player_xpos][player_ypos] = '0';
louisberard 2:586409836de7 659
louisberard 2:586409836de7 660 int old_player_ypos = player_ypos;
louisberard 2:586409836de7 661 array[player_xpos][old_player_ypos] = '0';
louisberard 10:4f204c2ac16c 662 }
louisberard 10:4f204c2ac16c 663 void jump(){ ///if the space beneath the player = floor, then increase ypos by 1. Apply move causes the player to fall again shortly after on the next loop.
louisberard 4:8b75386f68ef 664 if(array[player_xpos][player_ypos+1] == '2'){
louisberard 2:586409836de7 665 int old_player_ypos = player_ypos;
louisberard 2:586409836de7 666 player_ypos += -1;
louisberard 10:4f204c2ac16c 667 //printf("player has jumped!");
louisberard 9:b160a3de0d00 668 ///removes old player char from the array
louisberard 2:586409836de7 669 array[player_xpos][old_player_ypos] = '0';
louisberard 2:586409836de7 670 }
louisberard 2:586409836de7 671 }
louisberard 9:b160a3de0d00 672 /// next steps are to turn pot into degrees and make a function which chechks which pixel the pot is pointing at.
louisberard 9:b160a3de0d00 673 /// this function takes the pot(2) input range and converts it into 45 degree segments, after which the aim detector is sent out until it hits another object
louisberard 10:4f204c2ac16c 674 void get_portal_angle(){
louisberard 9:b160a3de0d00 675 ///take pot(2) val as a double to allow for more precise segments.
louisberard 3:2e2134c27c23 676 double angle_input = pad.read_pot2();
louisberard 9:b160a3de0d00 677 ///position the player is aiming at
louisberard 4:8b75386f68ef 678 aim_xpos = player_xpos;
louisberard 4:8b75386f68ef 679 aim_ypos = player_ypos;
louisberard 9:b160a3de0d00 680 /// if pot(2) is between 0 and 45 degrees, aim detection is projected at the floor,
louisberard 4:8b75386f68ef 681 if(angle_input > 0 && angle_input < 0.125){
louisberard 9:b160a3de0d00 682 /// The aim_ypos will increment until it is next to a surface that isnt the air.
louisberard 5:a33d791bd7fb 683 while(array[aim_xpos][aim_ypos + 1] == '0'){
louisberard 4:8b75386f68ef 684 aim_ypos = player_ypos + 1;
louisberard 4:8b75386f68ef 685 }
louisberard 9:b160a3de0d00 686 /// increment once more to place portal in the surface
louisberard 4:8b75386f68ef 687 aim_ypos = player_ypos + 1;
louisberard 10:4f204c2ac16c 688 }
louisberard 9:b160a3de0d00 689 /// if pot(2) is between 45 and 90 degrees, aim detection is diagonally down left
louisberard 4:8b75386f68ef 690 else if(angle_input > 0.125 && angle_input < 0.25){
louisberard 5:a33d791bd7fb 691 while(array[aim_xpos -1 ][aim_ypos + 1] == '0'){
louisberard 9:b160a3de0d00 692 /// performs relevant increments and decrements for downward diagonal left movement.
louisberard 3:2e2134c27c23 693 aim_xpos += - 1;
louisberard 4:8b75386f68ef 694 aim_ypos += 1;
louisberard 4:8b75386f68ef 695 }
louisberard 9:b160a3de0d00 696 /// performs increments and decrements once more to place portal in the surface
louisberard 4:8b75386f68ef 697 aim_xpos += - 1;
louisberard 4:8b75386f68ef 698 aim_ypos += 1;
louisberard 10:4f204c2ac16c 699 }
louisberard 9:b160a3de0d00 700 /// if pot(2) is between 90 and 135 degrees, aim detection is projected towards the left
louisberard 4:8b75386f68ef 701 else if(angle_input > 0.25 && angle_input < 0.375){
louisberard 5:a33d791bd7fb 702 while(array[aim_xpos -1 ][aim_ypos] == '0'){
louisberard 9:b160a3de0d00 703 /// The aim_xpos will decrement until it is next to a surface that isnt the air.
louisberard 4:8b75386f68ef 704 aim_xpos += - 1;
louisberard 4:8b75386f68ef 705 }
louisberard 9:b160a3de0d00 706 /// decrement once more to place portal in the surface
louisberard 4:8b75386f68ef 707 aim_xpos += - 1;
louisberard 10:4f204c2ac16c 708 }
louisberard 9:b160a3de0d00 709 /// if pot(2) is between 135 and 180 degrees, aim detection is diagonally up left
louisberard 4:8b75386f68ef 710 else if(angle_input > 0.375 && angle_input < 0.5){
louisberard 5:a33d791bd7fb 711 while(array[aim_xpos -1 ][aim_ypos-1] == '0'){
louisberard 9:b160a3de0d00 712 /// performs relevant decrements for upward diagonal left movement.
louisberard 4:8b75386f68ef 713 aim_xpos += - 1;
louisberard 4:8b75386f68ef 714 aim_ypos += - 1;
louisberard 4:8b75386f68ef 715 }
louisberard 9:b160a3de0d00 716 /// performs decrements once more to place portal in the surface
louisberard 3:2e2134c27c23 717 aim_xpos += - 1;
louisberard 4:8b75386f68ef 718 aim_ypos += -1;
louisberard 10:4f204c2ac16c 719 }
louisberard 9:b160a3de0d00 720 /// if pot(2) is between 180 and 225 degrees, aim detection is upwards
louisberard 4:8b75386f68ef 721 else if(angle_input > 0.5 && angle_input < 0.625){
louisberard 5:a33d791bd7fb 722 while(array[aim_xpos][aim_ypos-1] == '0'){
louisberard 9:b160a3de0d00 723 /// The aim_ypos will decrement until it is next to a surface that isnt the air.
louisberard 4:8b75386f68ef 724 aim_ypos += - 1;
louisberard 4:8b75386f68ef 725 }
louisberard 9:b160a3de0d00 726 /// decrement once more to place portal in the surface
louisberard 4:8b75386f68ef 727 aim_ypos += -1;
louisberard 10:4f204c2ac16c 728 }
louisberard 9:b160a3de0d00 729 /// if pot(2) is between 225 and 270 degrees, aim detection is diagonally up right
louisberard 4:8b75386f68ef 730 else if(angle_input > 0.625 && angle_input < 0.75){
louisberard 5:a33d791bd7fb 731 while(array[aim_xpos+1][aim_ypos-1] == '0'){
louisberard 9:b160a3de0d00 732 /// performs relevant increments and decrements for downward diagonal left movement.
louisberard 4:8b75386f68ef 733 aim_ypos += - 1;
louisberard 3:2e2134c27c23 734 aim_xpos += 1;
louisberard 4:8b75386f68ef 735 }
louisberard 9:b160a3de0d00 736 /// performs increments and decrements once more to place portal in the surface.
louisberard 4:8b75386f68ef 737 aim_ypos += -1;
louisberard 4:8b75386f68ef 738 aim_xpos += 1;
louisberard 10:4f204c2ac16c 739 }
louisberard 9:b160a3de0d00 740 /// if pot(2) is between 270 and 315 degrees, aim detection is to the right
louisberard 4:8b75386f68ef 741 else if(angle_input > 0.75 && angle_input < 0.875){
louisberard 5:a33d791bd7fb 742 while(array[aim_xpos+1][aim_ypos] == '0'){
louisberard 9:b160a3de0d00 743 /// The aim_xpos will increment until it is next to a surface that isnt the air.
louisberard 3:2e2134c27c23 744 aim_xpos += 1;
louisberard 4:8b75386f68ef 745 }
louisberard 9:b160a3de0d00 746 /// The aim_xpos will increment once more to place the portal in the surface.
louisberard 4:8b75386f68ef 747 aim_xpos += 1;
louisberard 10:4f204c2ac16c 748 }
louisberard 9:b160a3de0d00 749 /// if pot(2) is between 315 and 360 degrees, aim detection is diagonally down right
louisberard 4:8b75386f68ef 750 else if(angle_input > 0.875 && angle_input < 1){
louisberard 5:a33d791bd7fb 751 while(array[aim_xpos+1][aim_ypos + 1] == '0'){
louisberard 9:b160a3de0d00 752 /// performs relevant increments for downward diagonal left movement.
louisberard 4:8b75386f68ef 753 aim_xpos += 1;
louisberard 4:8b75386f68ef 754 aim_ypos += 1;
louisberard 4:8b75386f68ef 755 }
louisberard 9:b160a3de0d00 756 /// performs increments once more to place portal in the surface
louisberard 4:8b75386f68ef 757 aim_xpos += 1;
louisberard 4:8b75386f68ef 758 aim_ypos += 1;
louisberard 10:4f204c2ac16c 759 }
louisberard 9:b160a3de0d00 760 /// draw the aim assist dashed line to give a visual representation of where the player is aiming the portal gun
louisberard 9:b160a3de0d00 761 /// this code allows for dynamic drawing of the aim assist relevant to the players position and the aim direction given by the potentiometer
louisberard 4:8b75386f68ef 762 lcd.drawLine((player_xpos),(player_ypos), aim_xpos,aim_ypos,2);
louisberard 3:2e2134c27c23 763 lcd.refresh();
louisberard 10:4f204c2ac16c 764 }
louisberard 9:b160a3de0d00 765 ///removed the old portal 1 and places the new one where the aim assist is pointed.
louisberard 10:4f204c2ac16c 766 void place_portal_1(){
louisberard 4:8b75386f68ef 767 int old_p1_xpos = portal_1_xpos;
louisberard 4:8b75386f68ef 768 int old_p1_ypos = portal_1_ypos;
louisberard 4:8b75386f68ef 769 array[old_p1_xpos][old_p1_ypos] = '1';
louisberard 5:a33d791bd7fb 770 portal_1_xpos = aim_xpos;
louisberard 5:a33d791bd7fb 771 portal_1_ypos = aim_ypos;
louisberard 10:4f204c2ac16c 772 array[portal_1_xpos][portal_1_ypos] = 'P';
louisberard 10:4f204c2ac16c 773 }
louisberard 9:b160a3de0d00 774 ///removed the old portal 2 and places the new one where the aim assist is pointed.
louisberard 10:4f204c2ac16c 775 void place_portal_2(){
louisberard 4:8b75386f68ef 776 int old_p2_xpos = portal_2_xpos;
louisberard 4:8b75386f68ef 777 int old_p2_ypos = portal_2_ypos;
louisberard 4:8b75386f68ef 778 array[old_p2_xpos][old_p2_ypos] = '1';
louisberard 4:8b75386f68ef 779 portal_2_xpos = aim_xpos;
louisberard 4:8b75386f68ef 780 portal_2_ypos = aim_ypos;
louisberard 10:4f204c2ac16c 781 array[portal_2_xpos][portal_2_ypos] = 'Q';
louisberard 10:4f204c2ac16c 782 }
louisberard 4:8b75386f68ef 783
louisberard 3:2e2134c27c23 784
louisberard 3:2e2134c27c23 785
louisberard 3:2e2134c27c23 786
louisberard 3:2e2134c27c23 787
louisberard 3:2e2134c27c23 788
louisberard 3:2e2134c27c23 789
louisberard 3:2e2134c27c23 790
louisberard 3:2e2134c27c23 791
louisberard 3:2e2134c27c23 792