Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | quangtran |
I draw line2d connect to two sprite and I want after short time about 3 second call another funtion will hide two sprite and remove line2d but the timer is not work
public override void _Input(InputEvent @event)
{
// Mouse in viewport coordinates.
if (@event is InputEventMouseButton eventMouseButton)
{
int x = (int)eventMouseButton.Position.x;
int y = (int)eventMouseButton.Position.y;
if (eventMouseButton.ButtonIndex == 1)
{
this.square = u.find_quare(x, y);
string square_name = this.get_square_name(this.square);
Square sq = new Square();
this.array_square_name = sq.save_square_name(this.array_square_name, this.square, square_name);
this.draw_selected_square(this.array_square_name);
bool rs = sq.match(array_square_name);
if (rs) {
string[,] b = this.init_board();
this.sprite1_pos = this.get_sprite_pos(array_square_name[0,0]);
this.sprite2_pos = this.get_sprite_pos(array_square_name[1,0]);
this.result = true;
this.Draw();
var t = (Timer)GetNode("timer_clear_line");
t.WaitTime = 3;
t.Start();
this.Hide_Square_And_ClearLine();
}
}
}
}