ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19tb

Dependencies:   mbed

Committer:
el19tb
Date:
Mon May 25 16:58:50 2020 +0000
Revision:
51:4c1f49729d88
Parent:
47:29c4796a49e5
Child:
53:b6bb4dab7823
setup level progression, level two is properly loaded now

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el19tb 13:cd6d2f999057 1 #ifndef VEHICLE_H
el19tb 13:cd6d2f999057 2 #define VEHICLE_H
el19tb 13:cd6d2f999057 3
el19tb 13:cd6d2f999057 4 // size of grid of the game
el19tb 13:cd6d2f999057 5 // three states of the frog
el19tb 13:cd6d2f999057 6 // still, movement 1 , movement two
el19tb 38:a6e040bf0e35 7
el19tb 47:29c4796a49e5 8 const int frog_state_up[4][6] = {
el19tb 47:29c4796a49e5 9 //final and initial state of frog
el19tb 47:29c4796a49e5 10 { 1, 0, 1, 1, 0, 1 },
el19tb 47:29c4796a49e5 11 { 0, 1, 1, 1, 1, 0 },
el19tb 47:29c4796a49e5 12 { 0, 1, 1, 1, 1, 0 },
el19tb 47:29c4796a49e5 13 { 1, 0, 0, 0, 0, 1 },
el19tb 47:29c4796a49e5 14
el19tb 13:cd6d2f999057 15 };
el19tb 13:cd6d2f999057 16
el19tb 47:29c4796a49e5 17 const int frog_state_left[4][6] = {
el19tb 47:29c4796a49e5 18
el19tb 47:29c4796a49e5 19 // middle state of frog
el19tb 47:29c4796a49e5 20 { 1, 1, 0, 0, 1, 0 },
el19tb 47:29c4796a49e5 21 { 0, 1, 1, 1, 1, 1 },
el19tb 47:29c4796a49e5 22 { 0, 1, 1, 1, 1, 1 },
el19tb 47:29c4796a49e5 23 { 1, 1, 0, 0, 1, 0 },
el19tb 13:cd6d2f999057 24 };
el19tb 13:cd6d2f999057 25
el19tb 47:29c4796a49e5 26 const int frog_state_right[4][6] = {
el19tb 47:29c4796a49e5 27
el19tb 47:29c4796a49e5 28 // middle state of frog
el19tb 47:29c4796a49e5 29 { 0, 1, 0, 0, 1, 1 },
el19tb 47:29c4796a49e5 30 { 1, 1, 1, 1, 1, 0 },
el19tb 47:29c4796a49e5 31 { 1, 1, 1, 1, 1, 0 },
el19tb 47:29c4796a49e5 32 { 0, 1, 0, 0, 1, 1 },
el19tb 47:29c4796a49e5 33 };
el19tb 38:a6e040bf0e35 34
el19tb 47:29c4796a49e5 35 const int frog_state_down[4][6] = {
el19tb 47:29c4796a49e5 36
el19tb 47:29c4796a49e5 37 // middle state of frog
el19tb 38:a6e040bf0e35 38 { 1, 0, 0, 0, 0, 1 },
el19tb 38:a6e040bf0e35 39 { 0, 1, 1, 1, 1, 0 },
el19tb 38:a6e040bf0e35 40 { 0, 1, 1, 1, 1, 0 },
el19tb 47:29c4796a49e5 41 { 1, 0, 1, 1, 0, 1 },
el19tb 47:29c4796a49e5 42 };
el19tb 38:a6e040bf0e35 43
el19tb 44:f02510eeb165 44
el19tb 44:f02510eeb165 45 // B
el19tb 46:e39abe665271 46 const int bus[4][16] = {
el19tb 44:f02510eeb165 47
el19tb 44:f02510eeb165 48 // bus has a longer width
el19tb 46:e39abe665271 49 { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
el19tb 46:e39abe665271 50 { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 },
el19tb 46:e39abe665271 51 { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
el19tb 46:e39abe665271 52 { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0 },
el19tb 44:f02510eeb165 53
el19tb 44:f02510eeb165 54 };
el19tb 38:a6e040bf0e35 55
el19tb 51:4c1f49729d88 56 // B
el19tb 51:4c1f49729d88 57 const int snake[4][16] = {
el19tb 51:4c1f49729d88 58
el19tb 51:4c1f49729d88 59 // bus has a longer width
el19tb 51:4c1f49729d88 60 { 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0 },
el19tb 51:4c1f49729d88 61 { 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1 },
el19tb 51:4c1f49729d88 62 { 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1 },
el19tb 51:4c1f49729d88 63 { 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0 },
el19tb 51:4c1f49729d88 64
el19tb 51:4c1f49729d88 65 };
el19tb 51:4c1f49729d88 66
el19tb 38:a6e040bf0e35 67 // R
el19tb 46:e39abe665271 68 const int right_racer[4][12] = {
el19tb 38:a6e040bf0e35 69
el19tb 46:e39abe665271 70 { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 },
el19tb 46:e39abe665271 71 { 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1 },
el19tb 46:e39abe665271 72 { 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1 },
el19tb 46:e39abe665271 73 { 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0 },
el19tb 38:a6e040bf0e35 74
el19tb 38:a6e040bf0e35 75 };
el19tb 38:a6e040bf0e35 76
el19tb 38:a6e040bf0e35 77 // L
el19tb 46:e39abe665271 78 const int left_racer[4][12] = {
el19tb 45:e40c4f89ed7c 79
el19tb 46:e39abe665271 80 { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1 },
el19tb 46:e39abe665271 81 { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1 },
el19tb 46:e39abe665271 82 { 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1 },
el19tb 46:e39abe665271 83 { 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0 },
el19tb 38:a6e040bf0e35 84
el19tb 38:a6e040bf0e35 85 };
el19tb 38:a6e040bf0e35 86
el19tb 38:a6e040bf0e35 87 // N
el19tb 46:e39abe665271 88 const int right_normal[4][10] = {
el19tb 45:e40c4f89ed7c 89
el19tb 46:e39abe665271 90 { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0 },
el19tb 46:e39abe665271 91 { 1, 0, 0, 0, 0, 0, 0, 1, 1, 1 },
el19tb 46:e39abe665271 92 { 1, 1, 0, 1, 1, 0, 1, 1, 1, 1 },
el19tb 46:e39abe665271 93 { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0 },
el19tb 38:a6e040bf0e35 94
el19tb 38:a6e040bf0e35 95 };
el19tb 38:a6e040bf0e35 96
el19tb 38:a6e040bf0e35 97 // X
el19tb 46:e39abe665271 98 const int left_normal[4][10] = {
el19tb 38:a6e040bf0e35 99
el19tb 46:e39abe665271 100 { 0, 0, 0, 1, 1, 1, 1, 1, 1, 0 },
el19tb 46:e39abe665271 101 { 1, 1, 1, 0, 0, 0, 0, 0, 0, 1 },
el19tb 46:e39abe665271 102 { 1, 1, 1, 0, 1, 1, 1, 0, 1, 1 },
el19tb 46:e39abe665271 103 { 0, 0, 1, 1, 0, 0, 1, 1, 0, 0 },
el19tb 38:a6e040bf0e35 104
el19tb 38:a6e040bf0e35 105 };
el19tb 38:a6e040bf0e35 106
el19tb 13:cd6d2f999057 107 #endif