je sais pas trop mais bcp
This commit is contained in:
46
script/DoorView.cs
Normal file
46
script/DoorView.cs
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user