SlideShare a Scribd company logo
Email tim.yellow@gmail.com
          tim hsu
Game in my mind
n   機械工業強的地方,才有
     汽車工業

n   資   工業強的地方,才有
     遊戲工業
Examples


   n   http://goo.gl/2qNU2
Introduction PyGame


n   Game Engine!!
n   All we love feature of python
跨平台!
PyGame 為你做什麼
PyGame 為你做什麼
PyGame 為你做什麼
PyGame 為你做什麼
PyGame 為你做什麼
PyGame 為你做什麼
Main Flow of Game
                            Main Loop




initial   prepare   input    simulate   draw   end
pygame_base_template


     na static ball on the
       screen
Initial Pygame
nimport   pygame
npygame.init()

nclock=pygame.time.Clock()
Prepare Screen, Ball
screen=pygame.display.set_mode([700,500])

ball = pygame.image.load("ball.gif")
ballrect = ball.get_rect()
ballrect.left, ballrect.top = 300,300
Main Loop
done=False
while done==False:
 input
 Draw
Input
        for event in pygame.event.get():
          if event.type == pygame.QUIT:
             done=True
Draw
                              screen 是代表整個畫布
screen.fill(black)
screen.blit(ball, ballrect)
                              ball 是圖像
clock.tick(20)
                              ball rect 是座標
Simulate
                              IF you don’t draw
screen.fill(black)             background first....
screen.blit(ball, ballrect)

clock.tick(20)
Simulate

screen.fill(black)
screen.blit(ball, ballrect)

clock.tick(20)
A Moving Ball

n   ball_move.py
n   ball = pygame.image.load("ball.gif")
n   ballrect = ball.get_rect()
n   ballrect = ballrect.move(speed)
pygame_input.py
Dive In!!

n   Screen, Font, Pictures are all called Surface.
n   Rect represent a coordination of a surface
n   Sprite, ( combination of Picture and Rect
n   Group !! control a lot of Sprite together!
Distribute Your Game


n   Py2Exe !!
n
Reference
n   特訓99 https://bitbucket.org/timtan/my99

n   PyGame http://www.pygame.org
n   PGU http://www.imitationpickles.org/pgu
n   PyGame for Android http://pygame.renpy.org/
     android-packaging.html

More Related Content

PDF
Pygame presentation
PDF
PyGame Tutorial | PyGame Python Tutorial For Beginners | Python Certification...
PPTX
Game Development with Pygame
PDF
Introduction to Game programming with PyGame Part 1
PDF
Game Development With Python and Pygame
PDF
The Ring programming language version 1.7 book - Part 53 of 196
PDF
The Ring programming language version 1.6 book - Part 51 of 189
PDF
The Ring programming language version 1.7 book - Part 50 of 196
Pygame presentation
PyGame Tutorial | PyGame Python Tutorial For Beginners | Python Certification...
Game Development with Pygame
Introduction to Game programming with PyGame Part 1
Game Development With Python and Pygame
The Ring programming language version 1.7 book - Part 53 of 196
The Ring programming language version 1.6 book - Part 51 of 189
The Ring programming language version 1.7 book - Part 50 of 196

What's hot (12)

PDF
The Ring programming language version 1.5.4 book - Part 49 of 185
PDF
The Ring programming language version 1.3 book - Part 39 of 88
PDF
The Ring programming language version 1.9 book - Part 59 of 210
PDF
The Ring programming language version 1.5.1 book - Part 48 of 180
PDF
The Ring programming language version 1.5.2 book - Part 48 of 181
PDF
The Ring programming language version 1.5.4 book - Part 50 of 185
PDF
The Ring programming language version 1.5.3 book - Part 49 of 184
PDF
The Ring programming language version 1.5.1 book - Part 47 of 180
PDF
The Ring programming language version 1.7 book - Part 54 of 196
PDF
The Ring programming language version 1.6 book - Part 52 of 189
DOCX
Snake report ROHIT MALAV
PPTX
Game maker objects
The Ring programming language version 1.5.4 book - Part 49 of 185
The Ring programming language version 1.3 book - Part 39 of 88
The Ring programming language version 1.9 book - Part 59 of 210
The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.2 book - Part 48 of 181
The Ring programming language version 1.5.4 book - Part 50 of 185
The Ring programming language version 1.5.3 book - Part 49 of 184
The Ring programming language version 1.5.1 book - Part 47 of 180
The Ring programming language version 1.7 book - Part 54 of 196
The Ring programming language version 1.6 book - Part 52 of 189
Snake report ROHIT MALAV
Game maker objects
Ad

Viewers also liked (8)

PDF
Introduction to Computer Science Using Python and Pygame
PPTX
Introduction to Python
PDF
Python (práctica 4)
PDF
Introduction to OpenCV (with Java)
PPTX
Raspberry Pi 3 + UART/Bluetooth issues
ODP
Image Processing with OpenCV
PDF
OpenCV Introduction
PPT
Raspberry pi 3
Introduction to Computer Science Using Python and Pygame
Introduction to Python
Python (práctica 4)
Introduction to OpenCV (with Java)
Raspberry Pi 3 + UART/Bluetooth issues
Image Processing with OpenCV
OpenCV Introduction
Raspberry pi 3
Ad

Similar to pygame sharing pyhug (19)

PPTX
Vanmathy python
PPT
"Pemrograman Python untuk Pemula dan Ahli"
PPT
Pygame : créer des jeux interactifs en Python.
PDF
Introduction to Pygame (Lecture 7 Python Game Development)
PDF
Денис Ковалев «Python в игровой индустрии»
PDF
Let's make a game for the Playdate
PDF
The Ring programming language version 1.10 book - Part 71 of 212
PDF
[EN] Ada Lovelace Day 2014 - Tampon run
PDF
L08 Using Frameworks
PDF
The Ring programming language version 1.2 book - Part 37 of 84
PDF
Teaching Python to 9 Year Old Girl - map mover
PDF
The following GUI is displayed once the application startsThe sug.pdf
PDF
The Ring programming language version 1.3 book - Part 52 of 88
PDF
Seaborn graphing present
PDF
The Ring programming language version 1.8 book - Part 56 of 202
DOCX
Java term project final report
PDF
The Ring programming language version 1.5 book - Part 9 of 31
PPTX
L10 Using Frameworks
PDF
The Ring programming language version 1.5.3 book - Part 79 of 184
Vanmathy python
"Pemrograman Python untuk Pemula dan Ahli"
Pygame : créer des jeux interactifs en Python.
Introduction to Pygame (Lecture 7 Python Game Development)
Денис Ковалев «Python в игровой индустрии»
Let's make a game for the Playdate
The Ring programming language version 1.10 book - Part 71 of 212
[EN] Ada Lovelace Day 2014 - Tampon run
L08 Using Frameworks
The Ring programming language version 1.2 book - Part 37 of 84
Teaching Python to 9 Year Old Girl - map mover
The following GUI is displayed once the application startsThe sug.pdf
The Ring programming language version 1.3 book - Part 52 of 88
Seaborn graphing present
The Ring programming language version 1.8 book - Part 56 of 202
Java term project final report
The Ring programming language version 1.5 book - Part 9 of 31
L10 Using Frameworks
The Ring programming language version 1.5.3 book - Part 79 of 184

More from Tim (文昌) (9)

PDF
Python的50道陰影
PDF
Frontend django, Django Web 前端探索
PDF
Profile django
PDF
Introduction to protocol buffer
PDF
PDF
Mock Introduction
PDF
Ml weka
PDF
Tainan.py, Experience about package
PPTX
Performance Enhancement Tips
Python的50道陰影
Frontend django, Django Web 前端探索
Profile django
Introduction to protocol buffer
Mock Introduction
Ml weka
Tainan.py, Experience about package
Performance Enhancement Tips

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
KodekX | Application Modernization Development
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation_ Review paper, used for researhc scholars
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
KodekX | Application Modernization Development
The AUB Centre for AI in Media Proposal.docx
NewMind AI Weekly Chronicles - August'25 Week I
20250228 LYD VKU AI Blended-Learning.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Big Data Technologies - Introduction.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Understanding_Digital_Forensics_Presentation.pptx
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
Spectroscopy.pptx food analysis technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Advanced methodologies resolving dimensionality complications for autism neur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

pygame sharing pyhug

Editor's Notes

  • #2: \n
  • #3: \n
  • #4: \n
  • #5: \n
  • #6: \n
  • #7: input gamepad, keyboard, mouse\ncollision. overlap\ndrawing of surface, coordinate system, fonts\ntimer, sounds...\n
  • #8: input gamepad, keyboard, mouse\ncollision. overlap\ndrawing of surface, coordinate system, fonts\ntimer, sounds...\n
  • #9: input gamepad, keyboard, mouse\ncollision. overlap\ndrawing of surface, coordinate system, fonts\ntimer, sounds...\n
  • #10: input gamepad, keyboard, mouse\ncollision. overlap\ndrawing of surface, coordinate system, fonts\ntimer, sounds...\n
  • #11: input gamepad, keyboard, mouse\ncollision. overlap\ndrawing of surface, coordinate system, fonts\ntimer, sounds...\n
  • #12: \n
  • #13: \n
  • #14: all the facilities is in pygame module. \nexplicitly, \n
  • #15: \n
  • #16: \n
  • #17: pygame 的event model, \n
  • #18: \n
  • #19: \n
  • #20: \n
  • #21: \n
  • #22: \n
  • #23: \n
  • #24: \n
  • #25: \n