Forums
C++ Coding MagPi #69 - Printable Version

+- Forums (http://www.scratchpadgames.net/forums)
+-- Forum: MagPi articles (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=7)
+--- Forum: General Chat (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=8)
+--- Thread: C++ Coding MagPi #69 (/showthread.php?tid=64)



C++ Coding MagPi #69 - Brian Beuken - 04-13-2018

A bit of a leap this month as we finally get a game (of sorts) up and running. Most of the explanations for what is happening are in the source code as the article needs to describe what we're doing rather than spell out the code.

Using what we learned previously about creating objects and giving them graphics we can arrange for a playfield to be displayed and populate it with items which we set up at the beginning and also create as the game is in progress.

This is our first proper use of inheritance and creating objects in the free space memory using the new keyword. It also means we need to take responsibility for removing items we make when we are done with them which brings us to the delete keyword. These 2 keywords should always balance up.

We will also see that even though we are making a game, it clearly suffers from some issues, especially speed. Next month we need to look into why a project that is working fine, isn't working fast and what we can do about that.