47 lines
910 B
C#
47 lines
910 B
C#
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;
|
|
}
|
|
|
|
}
|