Game Development Reference
In-Depth Information
Topics Covered In This Chapter:
— The pygame.FULLSCREEN flag
— Pygame Constant Variables for Keyboard Keys
— The move_ip() Method for Rect objects
— The pygame.mouse.set_pos() Function
— Implementing Cheat Codes in Your Games
— Modifying the Dodger Game
The last three chapters have gone over the Pygame software library and demonstrated
how to use its many features. (You don't need to read those chapters before reading this
chapter, though it may make this chapter easier to understand.) In this chapter, we will use
that knowledge to create a graphical game with sound that receives input from the keyboard
and mouse.
The Dodger game has the player control a small man (which we call the player's
character) who must dodge a whole bunch of baddies that fall from the top of the screen.
The longer the player can keep dodging the baddies, the higher the score they will get.
Just for fun, we will also add some cheat modes to the game. If the player holds down
the "x" key, every baddie's speed will be reduced to a super slow rate. If the player holds
down the "z" key, the baddies will reverse their direction and travel up the screen instead of
downwards.
Search WWH ::




Custom Search