Assignment13 Writeup
Assignment13 Writeup
As we can see I have updated the snake body with a texture and also the snake has a cockroach
object to eat now.
Above is my material file with the texture for the cockroach. If we needed to support multiple
textures for our game, I would have texture as an array of texture paths (lua table).
Show the binary version of the same material file (a screenshot from a hex editor is fine if it's
readable)
Tell us what changes you had to make to deal with having two paths (the effect path and the
texture path)
I had to extract the texture file name from the lua file. Once that is done I had to also change the
extension for the file to .dds also in case there is no texture found I used the default.dds texture.
Tell us what changes you would have to make if you had to support more than one texture
I would just add the new texture in a similar way as the old one. However there would now be
two default.dds textures in the file if there is no texture found. i.e only the texture that is found
would be present. Since I will be extracting the texture files in the same order as I am entering
them, this shouldnt be a problem.
Show us the run-time C++ code that extracts the material data from the binary file
I am using the above code. I just use the strlen() function to get the string length and add 1 to it
for the null terminator, then I advance my all_data pointer by that amount so I can access the
next string.
Left to doAdding a score system. Adding a pickup system, adding UI for score. Randomly spawning the
cockroach so the snake can pick it up. Also if possible I want to rotate the camera so I can get a
better 3D perspective.
I originally started with red for both the snake head and the snake body. Now I made two
materials to make the head darker and the body lighter. As seen above it is working.
Tell us what progress you have made on your final project game
Not yet sorry. This assignment took a long time.