~pygame/pygame/main

« back to all changes in this revision

Viewing changes to docs/reST/tut/PygameIntro.rst

  • Committer: GitHub
  • Author(s): Thomas Kluyver
  • Date: 2017-11-29 10:42:58 UTC
  • mfrom: (47.1.1)
  • Revision ID: git-v1:ea0a7bc2b5a0d5c72fbaa7a5cea7a177cd8b4a10
Merge pull request #363 from donkirkby/intro-typos

Fix several typos, and improve grammar in the introduction.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
an introduction to SDL, which is the Simple DirectMedia Layer.
35
35
Created by Sam Lantinga, SDL is a cross-platform C library for
36
36
controlling multimedia, comparable to DirectX. It has been used for
37
 
hundreds commercial and open source games. I was impressed at how clean
 
37
hundreds of commercial and open source games. I was impressed at how clean
38
38
and straightforward both projects were and it wasn't long before I
39
39
realized mixing Python and SDL was an interesting proposal.
40
40
 
140
140
worked with animations this may seem strange. You may be asking "Why do
141
141
we need to erase anything, why don't we just move the ball on the
142
142
screen?" That is not quite the way computer animation works. Animation
143
 
is nothing more than a series of single images, when displayed in
144
 
sequence does a very good job of fooling the human eye into seeing
 
143
is nothing more than a series of single images, which when displayed in
 
144
sequence do a very good job of fooling the human eye into seeing
145
145
motion. The screen is just a single image that the user sees. If we did
146
146
not take the time to erase the ball from the screen, we would actually
147
147
see a "trail" of the ball as we continuously draw the ball in its new
166
166
modules to do things like input handling for the keyboard, mouse, and
167
167
joystick. It can mix audio and decode streaming music.
168
168
With the *Surfaces* you can draw simple
169
 
shapes, rotate, scale, the picture. Even manipulate the pixels of
 
169
shapes, rotate and scale the picture, and even manipulate the pixels of
170
170
an image in realtime as numpy arrays.
171
171
Pygame also has the ability to act as a
172
172
cross platform display layer for PyOpenGL. Most of the pygame modules
196
196
the move towards higher level languages. Usually a game is split into
197
197
two major parts. The game engine, which must be as fast as possible,
198
198
and the game logic, which makes the engine actually do something. It
199
 
wasn't long ago when the engine of game was written in assembly, with
 
199
wasn't long ago when the engine of a game was written in assembly, with
200
200
portions written in C. Nowadays, C has moved to the game engine, while
201
201
often the game itself is written in higher level scripting languages.
202
202
Games like Quake3 and Unreal run these scripts as portable bytecode.
209
209
castles. You can download third party add-ons for this game, and find
210
210
they are nothing more than Python source files.
211
211
 
212
 
More recently, Python has been used a variety of games like Freedom
 
212
More recently, Python has been used in a variety of games like Freedom
213
213
Force, and Humungous' Backyard Sports Series.
214
214
 
215
215
.. image:: intro_freedom.jpg
238
238
all platforms. When a game gets more complex, it often must commit to
239
239
one or the other. SDL has some other design limitations, things like
240
240
full screen scrolling graphics can quickly bring your game down to
241
 
unplayable speeds. While SDL is not suitable all types of games,
 
241
unplayable speeds. While SDL is not suitable for all types of games,
242
242
remember companies like Loki have used SDL to run a wide variety of
243
243
retail quality titles.
244
244
 
268
268
pygame tutorials for people new to these concepts.
269
269
 
270
270
In the end, my advice is to keep it simple. I cannot stress this
271
 
enough. If you are planning to create your first game, there is a 
 
271
enough. If you are planning to create your first game, there is a
272
272
lot to learn. Even a simpler game will challenge your designs, and
273
273
complex games don't necessarily mean fun games. When you understand
274
274
Python, you can use pygame to create a simple game in only one or two
275
 
weeks. From there you'll need a surprising amount of time needed to add
 
275
weeks. From there you'll need a surprising amount of time to add
276
276
the polish to make that into a full presentable game.
277
277
 
278
278
Pygame Modules Overview