Posts: 192
Threads: 21
Joined: Aug 2018
Reputation:
17
On page 88 of the book it describes creating an Objects class in a file but it does not state that a Objects.h needs to be created nor does it mention the Objects.cpp file. However, this and the associated Objects.cpp is already in the InvaderStart.zip BasicInvaders project.
Another issue is that on page 90, the description for the code that goes into Shooter.cpp shows it inheriting from Objects by passing f and fh to an Objects constructor but there is no associated constructor in the Objects files from BasicInvaders project. The Invader project from InvaderFin.zip does however have the proper Objects constructor "Objects(char*, MyFiles*)" needed to run the code from the book.
Posts: 693
Threads: 186
Joined: Jan 2018
Reputation:
1
i'll check this out.
Do you not think its clear from earlier text that files need to be created when you are told to make a new class?
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's
Posts: 192
Threads: 21
Joined: Aug 2018
Reputation:
17
The text is hit and miss with regards to informing the reader whether or not an associated file needs to be created or where to put the code in an existing file. With the first example, or even second, it might be best to give the reader a clue as to where to put the code, but perhaps not needed on examples that follow as long as the examples that follow are consistent with the previous ones.
In this particular case, the text instructs the reader to create the Objects class (assuming the reader creates the associated files for the class). However, these files are already present in the example starter project but not complete.
The other issue is with Shooter on page 90 where the code in the text shows a Shooter constructor with a reference to a Base Objects constructor that takes a 'char*' and 'MyFiles*' but this constructor is not mentioned in the book nor is it present in the existing Objects file for the starter code. The text does state to add Shooter.cpp and Shooter.h to the project which are not present in the Stater project.
Posts: 693
Threads: 186
Joined: Jan 2018
Reputation:
1
ok I'll add some comments ot the source and re-write the text a little.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's