Beating your head against a brick wall
It’s been a week now, and pretty much every day I’ve been busy trying to learn Java and libGDX. Tuesday was a really horrible day for morale, nothing seemed to go right and once I thought I “got it”, I was proven wrong and ended up even more confused. The topic that confused the hell out of me, was how to extend a class and being able to grab the information from that class. In other words, Inheritance (Definition: A class that is derived from another class is called a subclass (also a derived class, extended class, or child class). The class from which the subclass is derived is called a superclass (also a base class or a parent class).
Some things made sense, others didn’t and trying to put what I had learned into practice constantly made me bump my head against a brick wall. In the end something has got to give though, and in this case it was the brick wall!
This video on youtube, helped a lot but my biggest problem was still that I was putting different shape types in an array, and I didn’t know how to access the different types in that array. Type casting ended up being my solution for that, and eventually I got things working. Now I won’t go much deeper into type casting, since it’s still a very new subject to me, that I have yet to fully understand.
So where am I now, well I’ve gotten a basic viewport going with a grid that is made up of the the shape type Line, only the needed amount of grid lines are drawn at any given time, so there is no limit to how big a world I can build in this editor I’m trying to do, of course there will be a limit due to limitations of the platform I’m making this for, but visually there is no limit. I can also add basic shapes at rendertime, which means the first big step forward has been taken, now I just need to expand a lot on that.
I got to say, it feels great to get past this point, and while I know that I will most likely run into far bigger problems in the future once things get more complicated, it’s still a learning experience for me and this will be a very long process.
Once I get a little more functionality in the tool I am currently making, I’ll post a more interesting screenshot, but for now. Big smiley face!