3. Whats inside a Game?
• Multidisciplinary Process
• Graphics
• Input Control
• Game Logic / AI
• Sound effects / Music
• Communication
• Physics, etc
• Frameworks ^ Libraries ^^
4. Basics - Drawing
• Drawing primitives
• Pixels, Square, Rect, Ellipse, etc
• Provided by development env
5. Basics - Animation
• Draw things
• Change their positon
• Draw them again
• Repeat
6. Basics - Animation
• Draw things
• Change their positon
• Draw them again
• Repeat
7. Basics - Animation
• Draw things
• Change their positon
• Draw them again
• Repeat
8. Basics - Animation
• Draw things
• Change their positon
• Draw them again
• Repeat
9. Basics - Animation
• Draw things
• Change their positon
• Draw them again
• Repeat
10. Basics - Surfaces
• Drawing primitives use algorithms
• Slow for repetitive work
11. Basics - Surfaces
• Drawing primitives use algorithms
• Slow for repetitive work
29. Ah! So many things to do?
Enter Frameworks /
Engines/ Libraries
& other angels
30. Programming
• Lot of repetitive tasks
• Lot of things you don’t wish to figure out
• Technologies - OpenGL, DirectX, SDL
• Interfacing Libraries
• Generic set of solutions - frameworks
• Complete solutions - Game Engines,
toolsets
33. A Basic Game Loop
Start While player is alive
take input
find collisions
draw on buffer
put everything on screen
34. A Basic Game Loop
Start While player is alive
take input
find collisions
draw on buffer
put everything on screen
35. A Basic Game Loop
Start While player is alive
take input
find collisions
draw on buffer
put everything on screen
36. A Basic Game Loop
Start While player is alive
take input
find collisions
draw on buffer
put everything on screen
37. A Basic Game Loop
Start While player is alive
take input
find collisions
draw on buffer
put everything on screen
38. A Basic Game Loop
Start While player is alive
take input
find collisions
draw on buffer
put everything on screen
39. A Basic Game Loop
Start While player is alive
take input
find collisions
draw on buffer
put everything on screen
40. What now?
• An entertaining idea
• A Programming Language
• A Game programming framework
• Some bells, whistles & decorations
41. Python
• Dynamic, Interpreted, Interactive
• Object Oriented
• Easy to write, easy to read
• Popular - education, prototyping, quick
hacks, research, unlimited
• Batteries included
• From web to standalones
42. Python
• Free
• On many platforms (Unix, Linux, Windows,
OS X, Symbian S60, Java, BeOS)
• Lacks type declaration
• Huge library of modules
43. Python
• printf (“Hi %s”, name);
print “Hi %s” % name
• int x = 45; float y = 1.01
x = 45 y = 1.01
• int a[4] = {1,2,3,4}
a = [1,2,3,4]
a = [1,2,‘abhishek’, 4, 4.5]
45. Python
Strings
fruit = “Apple”
fruit = ‘Apple’
fruit = “““ Apple and ‘apple” ”””
fruit = ‘‘‘ foo bar ’’’
message = “Hello %s. Total is %d” % (name, total)
53. • Based on SDL (Simple Directmedia Layer)
• Works on Windows, OSX, Linux, N900, etc
• Big array of modules, does a lot to save
time
• http://pygame.org
• $ sudo easy_install pygame