We'll be using one of the very convenient features of Notepad++, Find and Replace, to fix some of the file paths in our files.
C:
drive and name it SuicideJockeys
. SuicideJockeys
folder in Notepad++. Fonts, Images
, and Sound
folders. WorldClass.py
remove the line that imports DirectStart
.import direct.directbase.DirectStart from WorldClass import * w = World() run()
SuicideJockeys
folder with the name main.py
. Images, Fonts, Models
, and Sound
folders from the BGP3D
folder to the SuicideJockeys
folder. BGP3D/Extras
folder copy installer.bmp
and icon.ico
to the SuicideJockeys
folder. C:\Panda3D-1.6.2\etc
and open the file config.prc
. Look for a line with the word fullscreen, and change that line to look like this. That will cause the game to load in fullscreen mode by default.fullscreen 1
C:\Panda3D-1.6.2\bin
. Type this line into the command prompt and hit enter.Note that the hyphens in front of dir
and name
are double hyphens.
Packpanda.exe --dir C:\SuicideJockeys --name "Suicide Jockeys
"
The packpanda utility will take a bit of time to create the installer for the game. When it's finished, it can be found in the same folder as the packpanda utility itself, C:\Panda3D-1.6.2\bin
. Go ahead and install the game to see the fruits of our labor.
The --dir
flag we supplied to packpanda.exe
told the utility where to find our game. The files main.py, installer.bmp, icon.ico
, and license.txt
must be located in the folder that we specify with --dir
, not in any subfolders, or packpanda.exe
won't be able to find them. The --name
flag allows us to tell packpanda.exe
what the name of the game is. If we don't specify it, the name of the folder is used. The installer window will use the name of the game, and the name of the game will also be used as the default installation directory. There are other flags that can be used with packpanda.exe
to automate certain tasks related to packing the game, but typically it's a better idea to handle those things manually so we can be sure they're done properly and double check the results.
To improve the loading times in the game, it would be a good idea to ship with .pyc
and .bam
files instead of .py
and .egg
files. To create .pyc
files, simply run the game in the folder that will be packed up with packpanda.exe
and Python will automatically create them for you. Then, just remove the .py
files. We talked about creating .bam
files using the writeBamFile
method earlier, so use that to create .bam
files to replace all of the .egg
files. Use Notepad++'s Find and Replace window to change all of the model files in our code to use the .bam
files. There is one .egg
that shouldn't be changed, however. Markers.egg
is loaded as raw egg data, so it should be left in the .egg
format. Once all that is done, repack the game into a new installer.
It's time now for our last Pop Quiz. Answer these questions to make sure we have a handle on how to use packpanda.exe:
packpanda.exe
to run, and where must it be found?