Files
Nockin_On_Hells_Door/scene/remplissage.cs
2024-10-23 17:37:49 +02:00

94 lines
2.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Godot;
using Godot.Collections;
using System;
using System.Collections.Generic;
public partial class remplissage : Node2D
{
[Export] Array<Texture2D> _textures;
List<string> questions = new List<string>
{
"Why should I give you a candy ?",
"Is SAO a good anime ?",
"Is the earth flat ?",
"Whats the answer to 1+1 ?",
"Whats the answer to life ?",
"I dont like your cosplay",
"Man or bear ?",
"Is it Spooky Month already ?",
"Do people always smile when they see a dead body ?",
"Why did the girl fall off the swing ?",
"▯▉▓◢▍▯▓▓▌▯▓▯▍▯▌▯▯▕◢",
"What do you taste like ?",
"With the lights out, is it less dangerous ?",
"Are you my lover ?",
"I want your teeth.",
"Theres so many monsters tonight ! Its creepy !",
"Tell me your best villain line !",
"Is it Christmas ?",
"Where is my grandma ?",
"Be honest with me… Am I ugly ?",
"The sky is so pretty !",
"Did you have a good day ? Mine was the worst ever.",
"Can you show me your house ?",
"Do you believe in ghosts ?",
"I like going to the cemetery a lot. We can go there together !",
"Do you know Bob ? I saw him last night going somewhere with a knife.",
"That guy Bob, I saw him running near the park last night.",
"I was at the park last night and I heard someone screaming !",
"My friend Bob asked me two days ago if he could borrow my shovel, but he didn't give it back to me !",
"I saw a new flower bed in the park this morning. But it was very ugly and there was a flower that looked like a hand.",
"I discovered this morning that someone stole my car ! There was just a shovel left on the floor !",
"I heard that the little Georgie is dead. Its sad to die at this age. No one is safe nowadays.",
"You know, sometimes I feel like I shouldnt be here",
"This book is not good ! I should have known when I saw the creepy face on the cover. Do you want it ?",
"A weird guy with a mask stalks me everyday ! Can you help me ?",
"Do you think the sun is black ?",
"I ate my family. Would you like to taste them ?",
"I dont have a good memory. What day is it ?"
};
List<Node2D> _nodes;
private int RandSeed = 69;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
int i = 0;
_nodes = new List<Node2D>();
foreach (Node2D node in this.GetChildren())
{
_nodes.Add(node);
}
shuffle(_nodes, RandSeed);
foreach (Node2D node in _nodes)
{
if (i < _textures.Count) node.Set("image_mob", _textures[i]);
i++;
}
}
private void shuffle(List<Node2D> nodes, int seed)
{
Random rnd = new Random(seed);
int n = nodes.Count;
while(n > 1)
{
n--;
int k = rnd.Next(n + 1);
Node2D value = nodes[k];
nodes[k] = nodes[n];
nodes[n] = value;
}
}
}