toutGlobalement

This commit is contained in:
2024-10-19 15:17:39 +02:00
parent 93a468a604
commit dbad63f3b0
19 changed files with 1464 additions and 47 deletions

40
script/Door.cs Normal file
View File

@@ -0,0 +1,40 @@
using Godot;
using System;
public partial class Door : Node2D
{
[ExportGroup("text")]
[Export] string text_char;
[Export] string answerA;
[Export] string answerB;
[Export] bool answerA_good;
bool player_in = false;
public override void _Ready()
{
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
if(player_in && Input.IsActionPressed("interact"))
{
}
}
public void BodyEntered(Node body)
{
if(body is CharacterBody2D)
{
player_in = true;
}
}
public void BodyExited(Node body)
{
if(body is CharacterBody2D)
{
player_in = false;
}
}
}