door (20)

This commit is contained in:
2024-10-20 14:52:24 +02:00
parent 704f2dfd2c
commit eb93c527d3
54 changed files with 2605 additions and 174 deletions

View File

@@ -8,19 +8,24 @@ public partial class Door : Node2D
[Export] string answerA;
[Export] string answerB;
[Export] bool answerA_good;
[Export] bool shot;
[Export] bool caniche;
[Export] AudioStream audio;
[ExportGroup("image")]
[Export] Texture2D image_mob;
bool player_in = false;
CharacterBody2D player;
bool open = false;
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
if(player_in && Input.IsActionPressed("interact"))
if(player_in && Input.IsActionPressed("interact") && open == false)
{
open = true;
Control view = player.GetNode<Control>("Camera2D/door_view");
view.Set("text_char", text_char);
@@ -28,6 +33,8 @@ public partial class Door : Node2D
view.Set("answerB", answerB);
view.Set("answerA_good", answerA_good);
view.Set("mobTex", image_mob);
view.Set("shot", shot);
view.Set("caniche", caniche);
view.Call("start");
}
}