加速度センサーで投げを検知
モーターが3回動く(本家で3回揺れるのを真似。モーターをバイブレーションとして使用)
70%の確率で成功、30%の確率で失敗分岐
(失敗の場合は、LINEに「逃げられてしまった...」を送信し、ブブーという音を出す)
成功の場合は、PokeAPIからポケモン名の取得を試行する (成功率が悪く3回失敗すると、獲得失敗となる)
成功した場合は、ポケモンゲットの効果音とともに、LINEに「やった!〇〇(ポケモン名)をゲットした!」と送信する
1に戻る
Detect throwing with an accelerometer sensor
The motor moves three times (imitating the original where it shakes three times; using the motor as a vibrator)
70% chance of success, 30% chance of failure branching (In case of failure, send "It got away..." to LINE and play a buzzer sound)
In case of success, attempt to retrieve the Pokémon name from the PokeAPI (if it fails three times, the capture fails)
If successful, play the Pokémon capture sound effect and send "Got it! I caught [Pokémon name]!" to LINE
Return to step 1