8 decided to look how long I could keep my game open using a release version of the native build before it would crap itself.
The game runs at a tps of 60 and every fifth tick a new object gets spawned that will run my basic pathfinding function. Which it will run EVERY tick.
The game started to crap itself only after 3 minutes. Or if my math is correct it took 2160 of those objects. Also, I accidentally left in a print statement inside of the calc_path function, meaning that I probably could've gotten better performance out of it.
Now, just replace my simple pathfinding thing for a real one and also put in some sort of cache so it doesn't have to run every update tick. After that, I don't think I need to fear pathfinding being a source of lag.
7 I... need to think of a better way to implement guis/huds into arena_keeper.
ITS SO MUCH BOILERPLATE JUST FOR A SINGLE BUTTON!
First, you need this piece of code:
This basically sets up an object that will act as the button. It will render the text as an image using the provided font when you create the object.
However, we need to load it together with the font using this piece of code: (Here ImmiExample is an earlier provided struct that will just be used as a container)
Here, we load font.ttf, make a style for it and then pass it all to Buttonstate so it can do its pre-render magic.
However, we are not there yet as we still haven't actually drawn anything. To do that we need this piece of code:
And all we have done now is create some text in the middle of the screen that says "normal button" when nothing is happening and "Hovered button" or "Clicked button" if you hover or clicked on it. It will also print "Test!" to the console when you click on it.
Also, if you want your assets to load before running the game you will need to implement that yourself. Luckily there is the "execute_or" method that takes 2 functions. One will run when its done loading when you call it and the other if you call it while it is still busy.
6 I finally got the results of the F# exam. These are the results for the practicum part:
Total number of people : 130
Amount of people who passed: 11 (8.5%)
average grade: 1.72
My grade: 7
5% of people scored my grade or higher
Note, the scale is from 1 to 10 with 10 being the best sore possible.
6 and I just watched an MTG Arena match where the amount of triggers got so out of hand that it took seconds for the game to actually calculate what the triggers where and several minutes for them all to happen.