Run away from the cat! - Revenge of the mouse - * Mouse The mouse walks towards the tilt direction of micro:bit. If you tilt the micro:bit larger, the mouse walks faster. * Aim Keep pressing the B button on micro:bit. The aim moves towards the tilt direction of micro:bit. If you tilt the micro:bit larger, the aim moves faster. * Baseball If you release the B button on micro:bit, the mouse throws a baseball to the aim. And, if the baseball hits the cat, the score increases. ---- 「ネコからにげろ!」をベースにmicro:bitの傾きでネズミを操作するように変更しています。 ・ネズミの操作 micro:bitを傾けた方向にネズミが歩きます。micro:bitの傾きの大きさに比例して歩く速さが変わります。 ・照準の操作 micro:bitのBボタンを押したままにします。micro:bitを傾けた方向に照準が移動します。micro:bitの傾きの大きさに比例して移動する速さが変わります。 ・ボールの発射 micro:bitのBボタンを放すと、ネズミが照準に向かってボールを発射します。ボールがネコに当たるとスコアが加算されます。
「ネコからにげろ!」はCoderDojo広島のプログラミング入門のスライド(下記リンク)を参考にしています。 https://www.coderdojo-hiroshima.com/wp-content/uploads/2019/01/coderdojo-kamiyacho-beginner.pdf