SuperMarioOnlyChild

SuperMarioOnlyChild

Advanced Hands-on Rust: Flappy dimensions are wrong (height should be 45)

The actual height of the flappy image is 45 pixels:

$ file assets/flappy_dragon.png assets/flappy_sprite_sheet.png
assets/flappy_dragon.png:       PNG image data, 65 x 45, 8-bit/color RGBA, non-interlaced
assets/flappy_sprite_sheet.png: PNG image data, 249 x 45, 8-bit/color RGBA, non-interlaced

However, the height is listed as 65 for both the asset loading and collision detection for the entirety of the book. Here’s the asset loading code starting in chapter 7 (FlappyAnimation directory):

      .add_sprite_sheet("flappy", "flappy_sprite_sheet.png", 
        62.0, 65.0, 4, 1)?

And here’s the collision detection code starting in chapter 8 (FlappyCollision):

spawn_animated_sprite!(
    assets, commands, "flappy", -490.0, 0.0, 10.0, "Straight and Level",
    Flappy { gravity: 0.0 }, FlappyElement, Velocity::default(), ApplyGravity,
    AxisAlignedBoundingBox::new(62.0, 65.0)
);

I noticed this because you can make Flappy crash without touching the wall if you try to nose dive right after clearing the wall.

Popular Prag Prog topics Top

jimschubert
In Chapter 3, the source for index introduces Config on page 31, followed by more code including tests; Config isn’t introduced until pag...
New
kuroneko
Whilst the author has been careful to provide exact results for the tests elsewhere in the book (such as surds with the transformation te...
New
johnp
Hi Brian, Looks like the api for tinydb has changed a little. Noticed while working on chapter 7 that the .purge() call to the db throws...
New
jamis
The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
New
lirux
Hi Jamis, I think there’s an issue with a test on chapter 6. I own the ebook, version P1.0 Feb. 2019. This test doesn’t pass for me: ...
New
mikecargal
Title: Hands-on Rust: question about get_component (page 295) (feel free to respond. “You dug you’re own hole… good luck”) I have somet...
New
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
dsmith42
Hey there, I’m enjoying this book and have learned a few things alredayd. However, in Chapter 4 I believe we are meant to see the “>...
New
rainforest
Hi, I’ve got a question about the implementation of PubSub when using a Phoenix.Socket.Transport behaviour rather than channels. Before ...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
New

Latest in PragProg

View all threads ❯