diff --git a/Assets/Game.cs b/Assets/Game.cs index ae74d6a..14ea4bd 100644 --- a/Assets/Game.cs +++ b/Assets/Game.cs @@ -11,7 +11,8 @@ public sealed class Game : GameBase { // 変数の宣言 - int sec = 0; + int time = 600; + int score = 0; /// /// 初期化処理 @@ -19,16 +20,25 @@ public sealed class Game : GameBase public override void InitGame() { // キャンバスの大きさを設定します - gc.ChangeCanvasSize(720, 1280); + gc.ChangeCanvasSize(360, 640); } /// /// 動きなどの更新処理 /// public override void UpdateGame() - { - // 起動からの経過時間を取得します - sec = (int)gc.TimeSinceStartup; + {time -= 1; + +if (time >= 0) +{ + score += gc.PointerBeginCount; +} + +if (gc.GetPointerDuration(0) >= 2) +{ + time = 600; + score = 0; +} } /// @@ -36,19 +46,15 @@ public override void UpdateGame() /// public override void DrawGame() { - // 画面を白で塗りつぶします gc.ClearScreen(); - // 青空の画像を描画します - gc.DrawImage(GcImage.BlueSky, 0, 0); - - // 黒の文字を描画します - gc.SetColor(0, 0, 0); - gc.SetFontSize(48); - gc.SetStringAnchor(GcAnchor.UpperLeft); - gc.DrawString("この文字と青空の画像が", 40, 160); - gc.DrawString("見えていれば成功です", 40, 270); - gc.SetStringAnchor(GcAnchor.UpperRight); - gc.DrawString($"{sec}s", 630, 10); +if(time >= 0 ){ + gc.DrawString("time:"+time,60,0); +} +else { + gc.DrawString("finished!!",60,0); +} + +gc.DrawString("score:"+score,60,60); } }