’
Did I miss it whily reading?
By Developers, For Developers
| PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
|---|---|---|---|---|---|
| 47 | ERROR | Without require_relative ‘player’ in sector_five.rb, the game will not start but throw the error sector_five.rb:10:in `initialize’: uninitialized constant SectorFive::Player (NameError) ’ Did I miss it whily reading? | 2015-04-21 | ||
| 19 | SUGGEST | In general, Rubyists like to add spaces between parameters. It is better readable. So I suggest to change super 800,600,false to super 800, 600, false Or
to
| 2015-05-09 | ||
| 48 | ERROR | sorry - last one should be page 42 | 2015-04-21 | ||
| 35 | SUGGEST | I think the more Ruby like syntax for if not @playing is unless @playing | 2015-05-09 | ||
| 34 | SUGGEST | Basically using the operators ‘or’, ‘and’, ‘not’ is absolutely correct, in my experience more often ‘||’, ‘&&’, ‘unless …’ is used. Furthermore the precedence is higher compared to the ‘words’. But this could also be seen as ‘code style’. | 2015-05-09 | ||
| 51 | SUGGEST | @enemy = Enemy.new(self) was not discussed yet at this point so I think it could lead to confusion | 2015-04-21 | ||
| 50 | ERROR | You ask the reader to start the program. If I did not oversee anything, the ship will fly out of the window. I think this will decrease the joy of the reader when trying out the programmed code. I am not sure if this is by intention and if it will be discussed later. At least an info should be given here (maybe declaring this as a technical error is not entirely correct but I think it is more than a suggestion) | 2015-04-21 | ||
| 51 | ERROR | ok - there is the explanation for flying out of the window. I still think that it is confusing and an info should be added on page 50 … | 2015-04-21 | ||
| 52 | ERROR | what is | 2015-04-21 | ||
| 54 | ERROR | when asked to run the game at the end of the page it will fail because SectorFive does not know anything about Enemy. It has to be required with require_relative ‘enemy’ | 2015-04-21 | ||
| 52 | OK | The method for hitting the top edge is missing. That means the space ship is flying out of the window. Adding if will fix this. | 2015-07-21 | The text states that if you fly off the top you're destroyed by the mother ship. | |
| 32 | TYPO | “In Whack-A-Ruby, we start with zero point” -> should be “points”. | 2015-04-20 | ||
| 65 | SUGGEST | Anywhere that we are iterating through the
I did this in mine and it works perfectly. It uses less lines and is more compact. | 2015-07-21 | ||
| 65 | TYPO | A more Rubyist way of writing conditionals that only have one line would be to put the `if` on the same line as the action that is fired after the conditional like so:
It works fine the way it is in the book, but since this is a book on Ruby, it may make sense to use the conventions commonly used in the community. | 2015-05-09 | ||
| 61 | SUGGEST | “The each() method of the Array class goes through the array.” Maybe us the word iterates instead of goes through? | 2015-05-09 | ||
| 61 | SUGGEST | Rubyists love oneliner. So you may want to change @enemies.each do |enemy| to @enemies.each { |enemy| enemy.move } Same for the draw method. | 2015-07-21 | In quite a few places, though not in the one you cited, the statement begins as a one command iteration but later in the project another line or two gets added. For consistency, and to address my less experienced audience I decided to stick with do ... end. | |
| 66 | TYPO | There is an extra space before @player.x
| 2015-05-10 | ||
| 72 | TYPO | the variable was called @image_number but is now written as @image_index = 0 | 2015-05-10 | ||
| 75 | SUGGEST | more the Ruby way would be @bullets.delete bullet unless bullet.onscreen? instead of @bullets.delete bullet if not bullet.onscreen? | 2015-05-09 | ||
| 105 | TYPO | When calculating where to draw the number | 2015-07-21 | Both ways work on my system. The documentation for text_width say that the first parameter is a string. So I send a string, even though it is more verbose. | |
| 32 | TYPO | “zero point” should be “zero points” | 2015-05-09 | ||
| 90 | SUGGEST | For the code snippet: if @enemies_appeared > MAX_ENEMIES It isn’t explicitly stated where this code should be placed. Presumably it goes in update_game, after new enemies are created, but it would help to explicitly say where this code should go. | 2015-05-09 | ||
| 89 | TYPO | “ | 2015-05-10 | ||
| 93 | TYPO | “ise” should be “is” | 2015-05-09 | ||
| 83 | SUGGEST | you already discussed filling the draw_game method on page #81 so it’s duplicated content. I suggest to remove it on page #81 | 2015-05-09 | ||
| 86 | SUGGEST | It’s not clear where this code has to go to: if @enemies_appeared > MAX_ENEMIES initialize_end(:count_reached) | 2015-05-09 | ||
| 89 | SUGGEST | opengameart.com should be openclipart.org | 2015-07-21 | The "Whack-A-Ruby" game uses art from openclipart.org \nSector Five uses art from opengameart.org \n \nSince its all CC0 stuff it could well be on both sites, but I listed the site where I found it. \n \nThey are both great sites for finding game art. | |
| 91 | ERROR | The reader should be aware, that he has to require the Credit class with require_relative ‘credit’ | 2015-05-09 | ||
| 40 | TYPO | • Move a sprite by pressing the keys the keys. | 2015-05-09 | ||
| 28 | ERROR | So I’m not sure what i’ve done wrong. I’m building the whack a ruby game. When I miss the ruby everything goes red as expected but when I get a hit it throws and exception and closes. This is my button down method (its the same as the one shown in the book ) def button_down(id) and the exception is here whack_a_ruby.rb:46:in `button_down’: undefined method `>=’ for nil:NilClass (NoMethodError) ’ I dont think I have any typos. Im running | 2015-08-01 | It looks like @visible is maybe not initialized in your initialize method. Make sure you have a line that creates and sets the @visible variable there. Make sure '@visible' is spelled the same in both places, too! \n \n | |
| 59 | SUGGEST | The footnote that reads “You can see all the methods of the Array class by looking in the Ruby documentation at | |||
| 33 | TYPO | Example code near the top is missing a line from the previous example, specifically the | |||
| 12 | SUGGEST | For anyone using Gosu 0.10.0 or later, there is no longer a requirement to install libogg or libvorbis, i.e. only sdl2 needs to be installed using homebrew. | |||
| 13 | SUGGEST | Regarding the note on running ruby programs from within Sublime Text, this can be a bit buggy if the computer contains several versions of ruby (e.g. through use of a ruby version manager). Particularly using RVM can cause the code to error if run inside Sublime Text. If you are using RVM, running the code through your terminal “$ruby filename.rb” will work perfectly i.e. you won’t get the errors you see if using Sublime. | |||
| 46 | TYPO | The third sentence in the second paragraph incorrectly reads, “One method of the SectorFive class, accelerate()…”. This method actually belongs in the Player class (as per the Player class diagram and rest of the code in the book), i.e. “SectorFive” needs to be replaced with “Player” in this sentence. | |||
| 72 | TYPO | In the Explosion class diagram, one of the instance variables in incorrectly written as “ | |||
| 131+ | ERROR | On the enlarged boulder image, one of the vertices marked does not match the x and y co-ordinates provided for it. The affected vertex is the top left most one, labelled as (–13,–6) when it should really be (–13, –10) as per the book image and the sprite available from this website. The rest of the code in the book incorrectly follows this misplaced vertex, which means that the physics engine is viewing the boulder as having a cut-off flat side in the top-left corner. | |||
| 65 | TYPO | The second paragraph says: | |||
| 106 | TYPO | The diagram with the large ‘3’ text has incorrect code written next to it to determine the top left corner x value, where it says “text+width/2” it should be “text.width/2”. | |||
| 128 | SUGGEST | The code segment on this page is missing the marker on the line “attr_reader :space” to say that this is a new piece of code. Also, this same line of code is missing from the provided source code on your website. | |||
| 142/3 | ERROR | There are 8 sprites in the Chip sprite sheet. The last paragraph on page 142 says to rotate through 7 images, and the draw method of the Chip class on the following page also uses %7 twice. All of these should be changed to 8 to use the last sprite from the Chip spritesheet. | |||
| 146 | TYPO | Within the jump method definition, the second nested conditional which checks the @action instance variable is checking equality to an incorrect symbol name. Where it says “:left” it should be “:run_left” in order to be consistent with the rest of the code. | |||
| 154 | ERROR | The new lines of code make a call to the x method of the Chip class “ | |||
| 161-9 | TYPO | The markup of which lines of code are new gets a bit messed up for 10 pages in the escape2.rb code snippets: - p161: “require_relative ‘camera’” should be marked as new - p162: “#END HIGHLIGHT” appears as text instead of markup - p163: The only new line is “draw_credits” the rest should be unmarked | |||
| 170 | TYPO | The paragraph beginning with, “Finally, you write”, contains the sentence, “Note that you read just the camera…” which I believe should be “readjust the camera” i.e. a space has crept into the middle of the word. | |||
| 145 | TYPO | On pages 145 the book describes the #check_footing method. The book never tells the reader to implement the #check_footing method within the Escape#update method. Users following along with the book and testing the game on pg 146, as instructed, will notice that Chip does not “run and jump” as the book suggests Chip should at this point. This is because the book never tells the user to add the following line to Escape#update: \t | |||
| 11 | SUGGEST | The sentence “Who wants to give screens full of painfully handwritten code?”, while perfectly fine English, doesn’t seem to go with the previous sentences in the paragraph. I think a word was deleted, as in: “Who wants to give [up] screens full of painfully handwritten code?” This might be even better: “Who wants to just give up screens full of painfully handwritten code?” (Note to PragProg’s Webmaster: Does this box support Markdown? If not, why not?) | |||
| 125 | SUGGEST | Each time the book says to “test”, it would be helpful if there was a version of the game’s code at that particular moment for the reader to reference. This might be overkill for the first three games, But it would be very helpful for the Escape game where I ran into the most difficulty. There are so many code changes between and around Escape_1 and Escape_2, that it is not easy for the user to reference those versions because the reader may not have coded his/her way to that part of the book yet. | |||
| 65 | ERROR | I don’t think running the project (ie, “ruby sector_five.rb”) will show any bullet.rb errors until after the next section, when you require it in the sector_five.rb file. |