Atnaujinkite slapukų nuostatas

Hands-on Rust: Effective Learning through 2D Game Development and Play [Minkštas viršelis]

4.35/5 (160 ratings by Goodreads)
  • Formatas: Paperback / softback, 325 pages
  • Išleidimo metai: 16-Sep-2021
  • Leidėjas: The Pragmatic Programmers
  • ISBN-10: 1680508164
  • ISBN-13: 9781680508161
Kitos knygos pagal šią temą:
  • Formatas: Paperback / softback, 325 pages
  • Išleidimo metai: 16-Sep-2021
  • Leidėjas: The Pragmatic Programmers
  • ISBN-10: 1680508164
  • ISBN-13: 9781680508161
Kitos knygos pagal šią temą:

Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters - and what better way to learn than by making games. Each chapter in this book presents hands-on, practical projects ranging from "Hello, World" to building a full dungeon crawler game. With this book, you'll learn game development skills applicable to other engines, including Unity and Unreal.

Rust is an exciting programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters. With Rust, you have a shiny new playground where your game ideas can flourish.

Each chapter in this book presents hands-on, practical projects that take you on a journey from "Hello, World" to building a full dungeon crawler game. Start by setting up Rust and getting comfortable with your development environment. Learn the language basics with practical examples as you make your own version of Flappy Bird. Discover what it takes to randomly generate dungeons and populate them with monsters as you build a complete dungeon crawl game. Run game systems concurrently for high-performance and fast game-play, while retaining the ability to debug your program. Unleash your creativity with magical items, tougher monsters, and intricate dungeon design. Add layered graphics and polish your game with style.

What You Need:

  • A computer running Windows 10, Linux, or Mac OS X.
  • A text editor, such as Visual Studio Code.
  • A video card and drivers capable of running OpenGL 3.2.
  • Acknowledgments ix
    Preface xi
    Part I Getting Started with Rust
    1 Rust and Your Development Environment
    3(16)
    Installing Rust
    3(4)
    Installing and Configuring Your Development Environment
    7(1)
    Managing Projects with Cargo
    8(2)
    Creating Your First Rust Program
    10(3)
    Using Cargo to Build, Check, or Run Your Project
    13(1)
    Formatting Your Code
    14(1)
    Finding Common Mistakes with Clippy
    14(3)
    Package Management with Cargo
    17(1)
    Wrap-Up
    18(1)
    2 First Steps with Rust
    19(26)
    Creating a New Project
    19(1)
    Capturing User Input
    20(4)
    Moving Input to a Function
    24(1)
    Trimming Input
    25(1)
    Storing Strings in an Array
    26(3)
    Grouping Data with Structs
    29(5)
    Storing a Variable Amount of Data with Vectors
    34(4)
    Categorizing with Enumerations
    38(5)
    Wrap-Up
    43(2)
    3 Build Your First Game with Rust
    45(26)
    Understanding the Game Loop
    45(8)
    Creating Different Game Modes
    53(4)
    Adding the Player
    57(5)
    Creating Obstacles and Keeping Score
    62(6)
    Wrap-Up
    68(3)
    Part II Building a Dungeon Crawler
    4 Design a Dungeon Crawler
    71(4)
    Adding Headings to Your Design Document
    71(2)
    Wrap-Up
    73(2)
    5 Build a Dungeon Crawler
    75(28)
    Dividing Your Code Into Modules
    75(3)
    Organizing Your Imports With a Prelude
    78(1)
    Storing the Dungeon Map
    79(5)
    Adding the Adventurer
    84(4)
    Building a Dungeon
    88(6)
    Graphics, Camera, Action
    94(8)
    Wrap-Up
    102(1)
    6 Compose Dungeon Denizens
    103(24)
    Understanding Terminology
    103(2)
    Composing Entities
    105(1)
    Installing and Using Legion
    106(2)
    Composing the Player
    108(2)
    Managing Complexity with Systems
    110(12)
    Adding Monsters
    122(2)
    Collision Detection
    124(2)
    Wrap-Up
    126(1)
    7 Take Turns with the Monsters
    127(14)
    Making Monsters Wander Randomly
    127(3)
    Moving Entites in a Turn-Based Game
    130(5)
    Sending Messages of Intent
    135(5)
    Wrap-Up
    140(1)
    8 Health and Melee Combat
    141(20)
    Giving Entities Hit Points
    141(1)
    Adding a Heads-up Display
    142(9)
    Implementing Combat
    151(8)
    Waiting as a Strategy
    159(1)
    Wrap-Up
    160(1)
    9 Victory and Defeat
    161(24)
    Building a Smarter Monster
    162(11)
    Implementing a Game Over Screen
    173(4)
    Finding the Amulet of Yala
    177(7)
    Wrap-Up
    184(1)
    10 Fields of View
    185(18)
    Defining an Entity's Field of View
    186(10)
    Limiting Monsters' Fields of View
    196(2)
    Adding Spatial Memory
    198(4)
    Wrap-Up
    202(1)
    11 More Interesting Dungeons
    203(28)
    Creating Traits
    204(7)
    Creating Cellular Automata Maps
    211(7)
    Creating Drunkard's Walk Maps
    218(7)
    Prefabricating Map Sections
    225(5)
    Wrap-Up
    230(1)
    12 Map Themes
    231(10)
    Theming Your Dungeon
    231(3)
    Rendering with Themes
    234(4)
    Unleashing Your Imagination
    238(1)
    Wrap-Up
    239(2)
    13 Inventory and Power-Ups
    241(16)
    Designing Items
    241(3)
    Managing Inventory
    244(11)
    Wrap-Up
    255(2)
    14 Deeper Dungeons
    257(12)
    Adding Stairs to the Map
    257(4)
    Tracking Game Level
    261(6)
    Displaying the Current Level on the HUD
    267(1)
    Wrap-Up
    267(2)
    15 Combat Systems and Loot
    269(18)
    Designing Data-Driven Dungeons
    270(10)
    Extending the Combat System
    280(5)
    Adding More Swords
    285(1)
    Wrap-Up
    286(1)
    16 Final Steps and Finishing Touches
    287(150)
    Packaging Your Game for Distribution
    287(2)
    Making the Dungeon Crawler Your Own
    289(1)
    Additional Content
    290(1)
    Wrap-Up
    290(147)
    Part III Additional Resources
    A1 ASCn/Codepage 437 Chart
    295(2)
    A2 Short Game Design Documents
    297(8)
    Make a Note of Every Idea
    297(1)
    Why You Need a Design Document
    298(1)
    Design Document Headings
    299(2)
    You Aren't Gonna Need It
    301(2)
    Wrap-Up
    303(2)
    A3 Rust Cheat Sheet
    305(2)
    Bibliography 307(2)
    Index 309
    Herbert Wolverson has worked as a programmer and an indie game developer since the late 1990s. He's taught programming and IT skills at a variety of levels, contributes to multiple Open Source projects, and is active in the game development scene.