0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

親子対話:GodotでPWAを作れるぞ(2)ゲーム作成編

0
Last updated at Posted at 2026-06-03

父「さあ作るぞ。何を作るんだ」

娘「簡単なやつ。ボタンを押すとスコアが増えるゲーム」

父「それだけ?」

娘「まずは動くものを作るのが大事」

父「で、どうやって作るんだ」

娘「Scene(シーン)とNode(ノード)が基本。シーンにノードを配置して、スクリプトで動かす」

父「シーンとノード?」

娘「シーンが部屋で、ノードが家具。組み合わせて一つのゲームにする」

父「なるほど。今回の部屋は?」

娘「Controlノードをルートにして、ButtonとLabelを置く」

父「ボタンとラベルか」

娘「Buttonを押したらLabelの数字が増える。それだけ」

父「スクリプトはどう書くんだ」

娘「GDScriptっていう言語。Pythonに似てる」

extends Button

func _on_pressed():
    var label = get_node("../Label")
    label.text = str(int(label.text) + 1)

父「思ったより短いな」

娘「そう。これで動く。F5で実行」

父「ほんとだ。カチカチ増える」

娘「これでゲームの完成。次はPWAにして公開するよ」

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?