Friday, April 19, 2013

Pirates Jewels II : two new alpha screenshots achieved using vectors

So after learning about vectors recently I modified my game code to use vectors rather than traditional arrays.

This made the process of creating the game boards in these two screenshots very simple for me as I can pass the setup for a board of any size as an object to the function and have initialize all the values and then draw the gems on the screen according to a fairly simple formula based on the size of the gems and size of the array.

So we have here two separate screens, one uses a single large board, and the other uses two smaller side-by-side boards.

All 3 are done with the same functions, just passing a different vector when the are each set up.



Naturally I'm not claiming to be a code-scientist or a pioneer here, just sharing my progress in learning new things and making my indie games better!

I believe always pushing yourself to learn new techniques is extremely valuable. In this case it has made my code leaner, meaner, easier to use and much more modular.

punchy out!

No comments:

Post a Comment