Thursday, January 9, 2014

Mini Ludum Dare 48: Day Zero Devlog

Alternate title for this post: "I FINALLY SQUASHED THE BUG!!!!!111!", or "I am so bad I have to resort to unconventional means".

I finally fixed the bug I was having with SpriteBatches, on my Mini Ludum Dare 48 game: Death Plot. See, I had a convoluted set up with a Sprite Class for general sprites doing the drawing for my player class. I then had the Player class call that drawing function, and then the Gameplay screen class, which is my main class, call the player one.

Much to my chagrin however, I was getting null exception errors, due to me supposedly not initializing the SpriteBatch using new. However, I was actually doing that.

Long story short, after trying multiple things to fix it, like initializing the SpriteBatch in the Game class, in LoadContent, in Draw, and pretty much everywhere, it didn't work. I then scoured the internet for help to no avail.

So, what did I do to fix this? I moved the player drawing to the Gamplay screen class. From there it called Player.Position as a parameter to the drawing. Everything related to the player is in Player, except the drawing. It seems to be working perfectly fine now.

Anyway, I am tired, and due to school, I haven't had much time. I got a movement system implemented, title screen art, game menus, and one of my two player controlled objects. I'll finish the rest, as well as a design post explaining this game, tomorrow.

The Title Screen.

Follow my Twitter (Kerinova_xeon) for more about my development process.

No comments:

Post a Comment