My simple maze program with UniGraphic library version.

Dependencies:   MMA8451Q UniGraphic mbed

This is basically a same program with my maze_vt100_MMA8451Q
but this time I used UniGraphic library and Adafruit 2.8" TFT (with touch).

http://developer.mbed.org/users/Rhyme/code/maze_vt100_MMA8451Q/

You can tailor the maze by editing "maze.h."

先にパブリッシュした簡単な迷路プログラムで UniGraphic ライブラリを使用してみました。

“maze.h” を編集することで独自の迷路を作成していただけます。

/media/uploads/Rhyme/maze_tft_1.jpg

After download and reset, a green circle is located at the start point.
Goal is the red circle.

ダウンロードしてリセットすると、画面のスタート位置に緑の●が置かれます。
ゴールは赤色の●です。

Move the FRDM-KL25Z board to let the green circle go.

FRDM-KL25Z を動かして、緑●を移動させます。

/media/uploads/Rhyme/maze_tft_2.jpg

When the green circle arrives at the goal with the "goal" banner, game ends.

緑●がゴールにたどり着くと“goal”というバナーが出てゲーム終了です。

/media/uploads/Rhyme/maze_tft_3.jpg

Since I did not use TSC (Touch Sensor) in this proram,
it should be easy to use other TFT panel(s), thanks for the "UniGraphic" library.
(let me know when you succeed with other TFT panel ;-)

このプログラムではタッチセンサーは使用していませんので、
“UniGraphic” ライブラリの恩恵として、他のTFTパネルへの移植も
容易だと思います。 (上手く行った人いたら知らせてくださいね・・・)

Committer:
Rhyme
Date:
Sat Mar 07 00:11:50 2015 +0000
Revision:
0:572a79c1c040
First commit for UniGraphic version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:572a79c1c040 1 #ifndef _MAZE_H_
Rhyme 0:572a79c1c040 2 #define _MAZE_H_ defined
Rhyme 0:572a79c1c040 3
Rhyme 0:572a79c1c040 4 #define MAZE_W 20
Rhyme 0:572a79c1c040 5 #define MAZE_H 20
Rhyme 0:572a79c1c040 6
Rhyme 0:572a79c1c040 7 #define POS_PATH 0
Rhyme 0:572a79c1c040 8 #define POS_WALL 1
Rhyme 0:572a79c1c040 9 #define POS_START 2
Rhyme 0:572a79c1c040 10 #define POS_GOAL 3
Rhyme 0:572a79c1c040 11
Rhyme 0:572a79c1c040 12 uint8_t maze[MAZE_H][MAZE_W] = {
Rhyme 0:572a79c1c040 13 {1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
Rhyme 0:572a79c1c040 14 {1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
Rhyme 0:572a79c1c040 15 {1,0,1,0,1,0,1,1,1,1,0,1,1,1,1,1,1,1,0,1},
Rhyme 0:572a79c1c040 16 {1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,1,0,1},
Rhyme 0:572a79c1c040 17 {1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,0,1,1,0,1},
Rhyme 0:572a79c1c040 18 {1,0,0,0,1,0,1,0,1,0,0,0,0,0,1,0,1,1,0,1},
Rhyme 0:572a79c1c040 19 {1,0,1,1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1},
Rhyme 0:572a79c1c040 20 {1,0,1,0,0,0,1,0,1,1,0,1,0,1,0,0,1,1,0,1},
Rhyme 0:572a79c1c040 21 {1,0,1,0,1,1,1,0,0,1,0,1,0,1,0,1,1,1,0,1},
Rhyme 0:572a79c1c040 22 {1,0,1,0,1,1,1,1,1,1,0,1,0,1,0,0,0,1,0,1},
Rhyme 0:572a79c1c040 23 {1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1},
Rhyme 0:572a79c1c040 24 {1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1},
Rhyme 0:572a79c1c040 25 {1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1},
Rhyme 0:572a79c1c040 26 {1,0,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1},
Rhyme 0:572a79c1c040 27 {1,0,1,0,1,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1},
Rhyme 0:572a79c1c040 28 {1,0,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1},
Rhyme 0:572a79c1c040 29 {1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1},
Rhyme 0:572a79c1c040 30 {1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1},
Rhyme 0:572a79c1c040 31 {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1},
Rhyme 0:572a79c1c040 32 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1}
Rhyme 0:572a79c1c040 33 } ;
Rhyme 0:572a79c1c040 34 #endif // _MAZE_H_