xxbokusu / til

for tutorial
0 stars 0 forks source link

[Godot Engine]お試ししよう:first 2D gameを動かすくらいには #102

Open xxbokusu opened 10 months ago

xxbokusu commented 10 months ago

https://godotplayer.com/gamejams ↑2023/10/29からゲームジャムがあるのを聞きつけたので先行して触ってみるだけでもしてみよう。

https://docs.godotengine.org/en/stable/getting_started/first_2d_game/index.html ↑を遂行するのが目標

xxbokusu commented 10 months ago

https://github.com/godotengine/godot

https://godotengine.org/download 公式のReadmeに従って↑からDL。 「Windows - .NET - Standard (x86_64)」を。

解凍して「Godot_v4.1.2-stable_mono_win64.exe」を実行するとEditorが開く。 初期状態だとprojectがないのでなんも開かない。 image

Document類は全部英語だったけどエディタは日本語あるんだ。

xxbokusu commented 10 months ago

専用?のGDScriptを避けてUnityとスキルを兼用できるC#を選んだら外部エディタでエラーを出されてしまった。 image 多分、連携の問題なんだけどな

Warningで指示がある通り、Buildをしたら時間差あって解消した…?

xxbokusu commented 10 months ago

playerのscriptを一通り写経してF6で実行。 アレ、動かない… image

can_instance: Cannot instance script because the class could not be found.

https://ask.godotengine.org/91410/can_instance-cannot-instance-script-because-class-could-found なる。 ファイル名が大文字小文字含めて完全一致しないといかんやつだった

xxbokusu commented 10 months ago

CSファイルで変数をエクスポートしても選択窓が無いけど…

// Don't forget to rebuild the project so the editor knows about the new export variable.

コメントに全部書いてあったわ。。。

xxbokusu commented 10 months ago

敵にぶつかっても何も起こらんけど。。。 image

CSで作った場合はConnectをBuild後に設定した方が良さそう。 Nodeで関数をPickして選んだ方が確実に接続してくれるので

xxbokusu commented 10 months ago

sample codeで述べている関数がないけど image

ここがエラーになってるから、PlayerのHit判定がbuildできてない

https://ask.godotengine.org/76506/game-everything-works-error-persists-error-calling-method bugか?bugなんか?

image

oioi 既定のメッセージじゃないとダメなんかい

https://ask.godotengine.org/152105/dont-know-how-to-fix-this-tutorial-error fix依頼出とるわ。

そして、シグナルも大文字小文字の問題やったね… image

xxbokusu commented 10 months ago

mobs。。。消せる?

// Note that for calling Godot-provided methods with strings, // we have to use the original Godot snake_case name. GetTree().CallGroup("mobs", Node.MethodName.QueueFree);

この名前のnode作ってないから消えない気がするんだけど。というか消えない。