je sais pas trop mais bcp

This commit is contained in:
2024-10-19 17:51:07 +02:00
parent 1594b25ffc
commit 585d6d787e
31 changed files with 1410 additions and 14 deletions

46
script/DoorView.cs Normal file
View File

@@ -0,0 +1,46 @@
using Godot;
using System;
using System.Diagnostics;
public partial class DoorView : Control
{
[Export] Sprite2D mob;
[Export] AnimationPlayer anim;
Texture2D mobTex {get; set;}
string text_char{get; set;}
string answerA{get; set;}
string answerB{get; set;}
bool answerA_good {get; set;}
[Export] Label text_mob;
[Export] Button butA;
[Export] Button butB;
// Called when the node enters the scene tree for the first time.
public void start()
{
GetParent<Camera2D>().PositionSmoothingEnabled = false;
GetTree().Paused = true;
Visible = true;
mob.Texture = mobTex;
anim.Play("enter");
}
public void stop()
{
GetParent<Camera2D>().PositionSmoothingEnabled = false;
GetTree().Paused = false;
Visible = false;
anim.Play("RESET");
}
public void TreatPressed()
{
anim.Play("question");
text_mob.Text = text_char;
butA.Text = answerA;
butB.Text = answerB;
}
}