Summary
The next thirteen chapters each represent their own signpost denoting the progress of our journey, and there is much yet to see and accomplish. Pulling onto the Space-Highway, it can appear like the space-road ahead is stretching out toward infinity. The truth is every road seems that way at the start of a trip. By keeping the focus on what’s immediately ahead, the infinite can become finite, and overwhelming complexity becomes manageable tasks.
Much like this book is separated into sections and chapters, Space-Truckers is separated into distinct phases or states. The Landing Page is the launchpad (pun intended) for starting the game, while the Splash Screen prepares the audience and sets the mood. Meanwhile, the Main Menu Screen serves as a navigation hub between the main gameplay states and the others.
There are two(ish) phases to the gameplay. Route Planning is where players use an orbital mechanics simulation to plot a course for their Space-Cargo to get from the origin to the destination planets. The direction and force of the launch are set by the player prior to launch, with the timing of the launch also a major factor in how players dictate their route.
Having planned a route, the next game phase sees that route being used to create a tunnel filled with obstacles (random encounters) that the player now must navigate their Space-Truck through to reach the end point. Time matters, but so does bringing the cargo to its destination in as good a condition as possible. Once the destination has been reached, a third, pseudo-game phase enters the stage.
Scoring is done using several factors that will be outlined in detail as part of Chapter 9, Calculating and Displaying Scoring Results. Players’ decisions from Route Planning impact the final scores in multiple ways ranging from time goals to fuel costs. Only the top scores get persisted into the High Score Screen, a feature available in both the web and PWA versions of the application.
The place where all the work around Space-Truckers is tracked and managed is in Space-Truckers: The GitHub Repository. Additionally, each chapter of the book (with a few exceptions) has its own branch in the source code. This allows you to view the state of the overall application in context with the content of the corresponding chapter. Additional assistance can be found by posting in either Space-Truckers: The Discussion Boards or on the BJS official community forums.
Next, we’ll start by gradually building some momentum through a back-to-basics review of the BJS framework and ecosystem. We’ll look at some of the tools, resources, and techniques and if necessary (re)introduce ourselves to how rendering in BJS works. We’ll learn about the Playground and begin the process of building our application by creating a simple loading animation. Buckle up, Space-Trucker – we’re hitting the road!