GameProgramming 1 – week 5

Continued with arkanoid and learned some basic collision also finding out how to load different images than bmp.

So starting the week with creating blocks blocks for arkanoid, it would be weird without them one could say they play a central part in the game, lots of purple blocks where loaded from a sprite sheet. After that we sat down to learn how to place them on the screen without hard-coding the positions of each block, instead having an algorithm that makes it possible to have different number of blocks as well as different size on blocks and window (Hard-coding should be avoided at all cost, much better to create dynamic coding). Another thing that very important that we had not entered into the game was the ball. So we were told to go and create it, well create a class that describes a ball and that holds a sprite for it, so abandoned and alone we went to get this mission of ours done. All in all I would say that we managed to do a pretty great job as far as I know all managed to do it.

The very next day we got to download the new version of the project that the teacher had done and continue with the game, it is at this stage still quite incomplete. What is the point to have just pictures of a paddle(the thing the user controls), ball and blocks they do not do anything so we need some interaction like when the ball moves it can bounce on the walls, paddle and blocks(could be useful if it destroys the blocks as well). So we got to do some basic collision handling for the objects.

Thursday and Friday we went to do something different. Learning to load more than just  bmp files to image which requires a new library SDL_image, linking to it and making picture background transparent so it is not visible (do not want a sprite with its background it looks strange). Then we went on with textures that also needed a special library to include, it is a bit tricky to get text on the screen, we used it to change the paddle sprite to a texture so instead of having a block that you move it was a text.

As an ending on the week we had a short presentation of different ways to work as a team. Using either git repository or SourceTree to host your project files and check version history.

Leave a comment