Wrapping Up

This chapter was arguably the most “rusty” of the chapters. There were a number of core lessons at the heart of this chapter and are the reason for the relatively large amount of code. If you only scratch the surface of Rust, you’ll never fully take advantage of its true power.

In this chapter, first and foremost, you saw an example of how to hide tremendous complexity behind a simple API—the host functions available to the robots in your virtual arena. Next, you saw how to manage complex, shared access to both mutable and immutable data. Finally, you explored some of Rust’s intrinsic support for threads. There are frameworks out there with simpler APIs, but knowing the standard library implementation is invaluable.

The code for this chapter also provides a foundation for further exploration. If you want, you can add things like obstacles in the arena, you can allow players to choose from a variety of weapons instead of giving them all the same gear, you can play with the motion system or convert the whole thing from robots to space ships or dragons.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.170.208