And, back to JAVA…
So tonight I pulled myself away from C# and stepped back in to the JAVA world. As I said previously, I’m actually trying to learn JAVA for business reasons and such. Along the way, I’ve been trying to learn MySQL as well. Well, tonight – thanks largely in part to my fooling around with the XNA tools, it all kind of clicked for me.
I sat down and wrote my first functional JAVA class (and test class) tonight in all of about 20 minutes. It’s nothing fancy, just a class that accepts some specific arguements and then writes them to a database. Really, it’s nothing big… but it’s my first. Wrapping my head around the object oriented functions on C# and the enjoyment of it through making a “game” really helped me grasp how this is all supposed to work. This is the first step for both my personal online media database and the mini-project I’m doing at work.
I’ve spent 2-3 months pouring over books and code, trying to sort things out. Between the beginnings of my XNA venture and now getting a JAVA class to write to a database… I feel like I’m starting to see some fruits from my labor. It feels good. Real good.
Aaron’s Head is now Animated
I’m learning that programming as a novice is a whole lot of trial and error, with an akward learning curve.
Today I managed to get my moving sprite animated; if it’s moving right it looks right. If it’s moving left, it looks left. I also got it open and close the mouth from a space bar press! The path to getting there however, was a long one…
The Joys of Vector2
So, like I’ve said before, I’m leaning this all from scratch, trying to figure things out here and there. In my last post, I was all kinds of excited because I had been able to get a sprite to move around the screen.
For this I used a simple solution of putting in an X and Y value and just doing some simple adds to them. It appears the better solution for this is using “Vector2″.
For example, declating Vector2 as such:
***
Vector2 SpritePos;
***
inherits some methods from Vector2. So now, you would just need to call SpritePos.X or SpritePos.Y. Huzzah! Much easier.
I figured this out from XNASpot’s Learning 2D tutorial. The XNA Spot guys have posted a bunch of tutorials already; be sure the check them out!
