Drag and drop works

This commit is contained in:
Senad Uka
2022-12-31 05:51:34 +01:00
parent f7b7035bf2
commit 90fd7e1ef5
19 changed files with 381 additions and 312 deletions

View File

@@ -1,28 +1,33 @@
using Godot;
using System;
public class Letterbox : Node2D
namespace lettergodot
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
// assign random letters to all the child nodes of type Letter
foreach (var letter in GetChildren())
{
if (letter is Letter)
{
((Letter)letter).Value = RandomLetterAsAString();
}
}
}
// method that returns a string with a random capital letter inside
private string RandomLetterAsAString()
{
var random = new Random();
var randomLetter = (char)random.Next('A', 'Z' + 1);
return randomLetter.ToString();
}
}
public class Letterbox : Node2D
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
// assign random letters to all the child nodes of type Letter
foreach (var letter in GetChildren())
{
if (letter is Letter)
{
((Letter)letter).Value = RandomLetterAsAString();
}
}
}
// method that returns a string with a random capital letter inside
private string RandomLetterAsAString()
{
var random = new Random();
var randomLetter = (char)random.Next('A', 'Z' + 1);
return randomLetter.ToString();
}
}
}