A few weeks before Halloween we decided to create a minigame to polish and learn new tricks (and treats, ha!). With not much time left for the game, we came up with simple mechanics: pumpkins fall from the top of the screen and must land safely. If pumpkins fall too fast they… How to create collidable curves (trail, lines, whatever) in Unity3DRead more
Tag: C#
Autómata finito en C# para Unity3D
Este artículo es una traducción del que escribimos originalmente en Inglés. Los Autómatas Finitos o Máquinas de Estado Finito (FSMs en sus siglas en Inglés) son bastante útiles en contextos muy diversos, como probablemente ya sabrás si estás leyendo ésto. Desde el menú al comportamiento complejo de las entidades de… Autómata finito en C# para Unity3DRead more
Shuffling C# generic lists
Just a quick hack for shuffling generic lists in C# like this one: List<T> list You may use proper solutions like those in this StackOverflow thread, if you need it for something serious, or simply do this: list.Sort ((x, y) => Random.value < 0.5f ? -1 : 1) which simply defines a… Shuffling C# generic listsRead more
Simple FSM-like structure using Coroutines in C# (Unity3D)
The previous post got a funny comment in Reddit: “Yawn. Hang on, inheritance, singletons? Bletch”. So I thought… “I may be getting rusty… let’s give those coroutines a try”. At first, coroutines seemed like a sure way of leaving behind all my (humble) OOP practices. I though they were some… Simple FSM-like structure using Coroutines in C# (Unity3D)Read more
A Finite State Machine in C# for Unity3D
Finite State Machines (FSMs) are pretty useful in many different contexts, as you may know if you are reading this. From a game menu to the complex behaviour of game entities, a nice FSM may improve your code’s readability and simplify its design. Or turn it into a hell of… A Finite State Machine in C# for Unity3DRead more