Week 5
I’m missing an important feature to add to my game: the ability to easily add objects and create the code for their interactions.
The idea was as follows: I want to dynamically add Events to my interactive GameObjects using reflection. I simply build a string with the object’s name followed by the type of action.
I create an InGameEvent partial class, so I can make a copy for each interaction. Essentially, a large part of the gameplay will be contained in this class. And, thanks to ChatGPT, I learned that the [Preserve] attribute tells the compiler to keep methods in the generated MSIL (Intermediate Language) even if no code directly references them—which is my case, since I retrieve a method by its name as a string and call it via Invoke().
InGameEvent
[Preserve]
Invoke()
I’ll then spend a few days adding events for various objects, as well as writing a bit of code for:
Finally, I’ll revisit the grass rendering, and after some research, I find a solution that is both prettier and more efficient.
And I’ll add the logo, to have a slightly more presentable build.