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?

GDScriptで落下判定

Posted at

概要

ACTION GAME MAKERでGDScriptでの落下判定を作る
※ヴィジュアルスクリプトでも当然できる

作り方

エリア.png

  1. Area2Dノードを作成
  2. CollisionShape2DノードをArea2Dの下に作成する(すり抜けれる壁のようなイメージ)
  3. Area2Dに対してGDスクリプトをアタッチさせる
  4. body_enteredを追加する
  5. 処理を以下の処理を書く(Playerと衝突したらシーンをリセットする)

body.png

extends Area2D

# プレイヤーがこのエリアに入ったときの処理
func _on_body_entered(body: Node2D) -> void:
	if body.name == "Player":
		get_tree().reload_current_scene() # 現在のシーンをリロード

サンプル

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?