MakeCode Microbit 遊戲設計:貓追老鼠遊戲(Microbit Game: Cat Chasing Mouse Game)

若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。

If you like this post, please click the ads on the blog or buy me a coffee. Thank you very much.

本篇文章將講解如何製作一個簡易追逐遊戲:【貓追老鼠】。
In this post, we're going to create a a simple chasing game: "cat chasing mouse", where you tilt the microbit to control a cat which is chasing a blinking mouse on the LED screen.

一、遊戲功能如下(Game Design): 

  • 遊戲時間一分鐘。One minute game.
  • 遊戲開始時,貓在畫面正中央。The cat is at the screen center when the game on start.
  • 老鼠不停閃爍,老鼠跑到隨機位置。The mouse is blinking and at random position on the screen.
  • 板子往上傾斜時,貓往上移動。The cat move up when tilting the microbit front.
  • 板子往下傾斜時,貓往下移動。The cat move down when tilting the microbit back.
  • 板子往右傾斜時,貓往右移動。The cat move to right when tilting the microbit to the right.
  • 板子往左傾斜時,貓往左移動。The cat move to left when tilting the microbit to the left.
  • 貓捉到老鼠時,得一分,老鼠跑到隨機位置。 When the cat catches the mouse, the mouse runs to random position. The player scores 1 point.

二、積木程式(Blocks Code)

遊戲時間一分鐘。One minute game.
遊戲開始時,貓在畫面正中央。The cat is at the screen center when the game on start.
老鼠不停閃爍,老鼠跑到隨機位置。The mouse is blinking and at random position on the screen.

板子往上傾斜時,貓往上移動。The cat move up when tilting the microbit front.
板子往下傾斜時,貓往下移動。The cat move down when tilting the microbit back.

板子往右傾斜時,貓往右移動。The cat move to right when tilting the microbit to the right.
板子往左傾斜時,貓往左移動。The cat move to left when tilting the microbit to the left.


貓捉到老鼠時,得一分,老鼠跑到隨機位置。 When the cat catches the mouse, the mouse runs to random position. The player scores 1 point.


三、結果(The Results)
影片(Demo Video):



請自由發揮額外功能,例如雙人對戰等。
More Ideas examples: Two players game...etc. 

範例網址(Example Code):https://makecode.microbit.org/_3tkeiCJ79W7b

沒有留言: