A downloadable game

About the Assignment

This assignment is about starting a new project from the scratch, figuring out what needs to referenced and build dependencies. It also teaches how to read files using Lua. Usage of static managers and handles instead of pointers.

Controls for movement

Shift – moves camera left

Ctrl – moves camera right

Del- moves camera towards the object

Backspace – moves camera away from the object

Arrow Keys – move the square in corresponding arrow direction

Screenshots


Screenshot of my game

How I finished the assignment

I started off by making a human readable lua script for defining a geometry object. Once I made my decision, I understood the lua interface by looking at the Using Lua solution. It took a while to figure out what exactly needs to be done. Using different functions for each level of stack as we go deeper in the lua stack is something I found very useful and made it less confusing when I’m actually writing the code. Spending a lot of time on this made it so much easier when writing the code and didn’t take much time. The next part was modifying the Geometry Object class so that it has a static manager and a handle. This was a little confusing at first. The linker error for not finding the non const static object of a header file left me clueless for about an hour. After figuring this out, I finished the handle part of the assignment.

Advantages of having human-readable asset files

Since, the asset file can be or may be modified by any person in the development team, it is very helpful if any person can read and understand it event without technical expertise. It also helps in figuring out what the problem is, if in any case, an error may occur while loading or using the asset. If the file is intuitive, then any person (who has the right to) can change the data accordingly.

Here is the representation of my Geometry asset


One thing I learnt over whatever little time I’ve been coding is that the naming of the variables matters. More than anything, even than multiple lines of comments, the name of the variable can help understand the context and meaning of the data being used or modified. I followed the same approach here, by naming the data (like SetOfVertices, OrderOfIndicesToBeDrawn) appropriately (even though its lengthy), it gives an understanding of what the data represents.  To add more meaning to the vertex data, I added the variables x,y and z which anyone can easily associate with.

 Here is the screenshot of debugging the GeometryBuilder project

 

 

Download

Download
Download Executable here 178 kB

Leave a comment

Log in with itch.io to leave a comment.