Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Title Page
Copyright
Dedication
Contents at a Glance
Contents
About the Authors
About the Technical Reviewer
Introduction
1: Introducing Python
Your First Look at Python
Numbers
Strings
Lists and Tuples
Unpacking
Loops
Python in Practice
Summary
2: Exploring Python
Creating Scripts
Working with Logic
Understanding Booleans
if Statement
and Operator
Or Operator
Not Operator
else Statement
elif Statement
Understanding Functions
Defining Functions
Default Values
Introducing Object-Oriented Programming
Using Classes
Creating an Object
Adding to our Class
Python in Practice
Using the Standard Library
Introducing import
Useful Modules for Games
Math Module
Summary
3: Introducing Pygame
History of Pygame
Installing Pygame
Using Pygame
Hello World Revisited
Understanding Events
Retrieving Events
Handling Mouse Motion Events
Handling Mouse Button Events
Handling Keyboard Events
Filtering Events
Posting Events
Opening a Display
Full-Screen Displays
Windows with No Borders
Additional Display Flags
Using the Font Module
Pygame in Action
Summary
4: Creating Visuals
Using Pixel Power
Working with Color
Representing Color in Pygame
Scaling Colors
Blending Colors
Using Images
Creating Images with an Alpha Channel
Storing Images
Working with Surface Objects
Creating Surfaces
Filling Surfaces
Getting Pixels in a Surface
Blitting
Drawing with Pygame
pygame.draw.rect
pygame.draw.polygon
pygame.draw.circle
pygame.draw.ellipse
pygame.draw.arc
pygame.draw.line
pygame.draw.lines
pygame.draw.aaline
pygame.draw.aalines
Summary
5: Making Things Move
Understanding Frame Rate
Moving in a Straight Line
It’s About Time
Diagonal Movement
Exploring Vectors
Creating Vectors
Storing Vectors
Vector Magnitude
Unit Vectors
Vector Addition
Vector Subtraction
Vector Negation
Vector Multiplication and Division
Using Vectors to Create Movement
Diagonal Movement
Game Objects Vector Class
Summary
6: Accepting User Input
Controlling the Game
Understanding Keyboard Control
Detecting Key Presses
Directional Movement with Keys
Rotational Movement with Keys
Implementing Mouse Control
Rotational Movement with the Mouse
Mouse Gameplay
Implementing Joystick Control
Joystick Basics
Joystick Buttons
Joystick Direction Controls
Joystick Objects
Seeing Joysticks in Action
Summary
7: Take Me to Your Leader
Creating Ar?tificial Intelligence for Games
What Is Intelligence?
Exploring AI
Implementing State Machines
Game Entities
Building Worlds
Ant Entity Class
Building the Brains
Summary
8: Moving into the Third Dimension
Creating the Illusion of Depth
Understanding 3D Space
Using 3D Vectors
Time-Based Movement in 3D
Projecting 3D Points
Parallel Projections
Perspective Projections
Field of View
A 3D World
Summary
9: Exploring the Third Dimension
What Is a Matrix?
Using the Matrix Class
Matrix Components
Translation Matrix
Scale Matrix
Rotation Matrix
Matrix Multiplication
Matrices in Action
Introducing OpenGL
Installing PyOpenGL
Initializing OpenGL
OpenGL Primer
Seeing OpenGL in Action
Summary
10: Making Things Go Boom
What Is Sound?
Storing Sound
Sound Formats
Creating Sound Effects
Stock Sound Effects
Playing Sounds with Pygame
Sound Objects
Sound Channels
Mixer Functions
Hearing the Mixer in Action
Playing Music with Pygame
Obtaining Music
Playing Music
Hearing Music in Action
Summary
11: Lights, Camera, Action!
Working with Textures
Uploading Textures with OpenGL
Texture Coordinates
Rendering Textures
Deleting Textures
Seeing Textures in Action
Mip Mapping
Texture Parameters
Min and Max Filters
Texture Wrapping
Working with Models
Storing Models
OBJ Format for 3D Models
Parsing OBJ Files
Material Library Files
Seeing Models in Action
Using the Model3D Class
Summary
12: Setting the Scene with OpenGL
Understanding Lighting
Enabling Lighting
Setting Light Parameters
Working with Materials
Tweaking Parameters
Managing Lights
Understanding Blending
Using Blending
Alpha Blending
Additive Blending
Subtractive Blending
Seeing Blending in Action
Blending Issues
Understanding Fog
Fog Parameters
Seeing Fog in Action
Rendering the Backdrop
Skyboxes
Seeing Skyboxes in Action
Skybox Enhancements
Where to Go for Help
Summary
Appendix A: Game Object Reference
Importing
Contributing
gameobjects.color.Color
Constructor
Attributes
Methods
Class Methods
gameobjects.matrix44.Matrix44
Constructor
Attributes
Methods
Class Methods
gameobjects.vector2.Vector2
Constructor
Attributes
Methods
Class Methods
gameobjects.vector3.Vector3
Constructor
Attributes
Methods
Class Methods
Appendix B: Packaging Your Game
Creating Windows Packages
Using cx_Freeze
Building the Installer
Creating Packages for Linux
Creating Packages for the Mac
Index
← Prev
Back
Next →
← Prev
Back
Next →