
pragmoose
Hands-on Rust: not all monsters destroyed on collision (page 140)
After finishing the code at the end of Chapter 7 and running it, monsters sometimes don’t get destroyed on collision. Instead, the player disappears and only the monster displays until the two are at different locations again.
If I revert the code at the end of the “Moving Entities in a Turn-Based Game” section, I don’t see this behaviour.
I ran the downloaded sample code for that chapter and found the same thing.
Most Liked

herbert
Thank you! That’s not one I remember running into, but I’ll take a look. I’ve added it to the issue tracker, so if there’s another edition - it will be included in the “to fix” list. When I return from vacation, I’ll see if I can find the issue - if I can, I’ll put a bug-fix up on hands-on-rust.com.

frenchy64
I believe the problem is that on p138, build_monster_scheduler()
is missing:
.add_system(collisions::collisions_system())
.flush()
Popular Prag Prog topics










Other popular topics









Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /sublime-text
- /textmate
- /react-native
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /julia
- /slackware
- /c
- /neovim