SlideShare a Scribd company logo
1 of 10
Python games
• Python is a computer programming language. We chose Python for
this tutorial because it’s a simple language to start out with, and is
fun and easy to learn.
• While you can run short bits of Python code at the Python prompt, if
you want to work on a bigger program (like a game), you probably
want to SAVE your code to a file so that you don’t have to type it in
over and over again.
• There are several ways to run a Python program as a file. One way is
to use a plain text editor like Notepad (Windows), or TextEdit (Mac).
Open a new text file, type in your Python code (like print 1+1).
• Then on Windows, double-click this file to run it. On Mac, open
Terminal and type python, then drag the file that you SAVED onto the
Terminal window and press Enter.
• The other way is to type in your code using the IDLE editor, which is
what you’re going to do in this tutorial. To run idle, simply type idle
from Terminal. Then choose FileNew Window from the IDLE menu
and you should have a text editor window where you can type in
Python code. You can SAVE your code changes via FileSave and even
run the code via RunRun Module (F5).
• You are almost ready to create your game. But what’s a game without
some great graphics and sound effects? I’ve put together all the
graphics and sound effects you’ll need for your game into a ZIP
archive. You can download it here.
• Once you’ve downloaded the file, create a folder for your game on
your hard disk and extract the resources folder into that folder so that
your game folder has a subfolder named resources, with the various
resources grouped in additional folders inside it
• The first if statement checks if the time is up. The second one checks
if the castle is destroyed. The third one calculates your accuracy ratio.
After that, a quick if statement checks if you won or lost and displays
the correct image.
• Done by : Fahd Khan
• 12 BB

More Related Content

Viewers also liked

Viewers also liked (13)

попередження насильства
попередження насильствапопередження насильства
попередження насильства
 
Mapa mental
Mapa mentalMapa mental
Mapa mental
 
Erasmus
ErasmusErasmus
Erasmus
 
Happy Familyy Pvt Ltd - A new age Gujarati film4
Happy Familyy Pvt Ltd - A new age Gujarati film4Happy Familyy Pvt Ltd - A new age Gujarati film4
Happy Familyy Pvt Ltd - A new age Gujarati film4
 
Chaco aut part2
Chaco aut part2Chaco aut part2
Chaco aut part2
 
15-05-17Resume_JSB
15-05-17Resume_JSB15-05-17Resume_JSB
15-05-17Resume_JSB
 
Dia da alimentação 2014/15
Dia da alimentação 2014/15Dia da alimentação 2014/15
Dia da alimentação 2014/15
 
Médias2015
Médias2015Médias2015
Médias2015
 
SAP_Award_News
SAP_Award_NewsSAP_Award_News
SAP_Award_News
 
Industrie du futur / Nouvelle France Industrielle - Phase 2
Industrie du futur / Nouvelle France Industrielle - Phase 2Industrie du futur / Nouvelle France Industrielle - Phase 2
Industrie du futur / Nouvelle France Industrielle - Phase 2
 
Design Portfolio [Taloza, K.S.]
Design Portfolio [Taloza, K.S.]Design Portfolio [Taloza, K.S.]
Design Portfolio [Taloza, K.S.]
 
Cariograma , d. bratthall
Cariograma , d. bratthallCariograma , d. bratthall
Cariograma , d. bratthall
 
Transport of oxygen and carbon dioxide
Transport of oxygen and carbon dioxideTransport of oxygen and carbon dioxide
Transport of oxygen and carbon dioxide
 

Similar to Python games

GUIDE TO PROGRAMMING WITH PYTHON
GUIDE TO PROGRAMMING WITH PYTHONGUIDE TO PROGRAMMING WITH PYTHON
GUIDE TO PROGRAMMING WITH PYTHONLebogang Modise
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptxHaythamBarakeh1
 
Easy coding a multi device game with FireMonkey
Easy coding a multi device game with FireMonkeyEasy coding a multi device game with FireMonkey
Easy coding a multi device game with FireMonkeypprem
 
Get Starte with MicroPython ESP32
Get Starte with MicroPython ESP32Get Starte with MicroPython ESP32
Get Starte with MicroPython ESP32fanghe22
 
Get Started with MicroPython ESP32
Get Started with MicroPython ESP32Get Started with MicroPython ESP32
Get Started with MicroPython ESP32fanghe22
 
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.Niraj Bharambe
 
python intro and installation.pptx
python intro and installation.pptxpython intro and installation.pptx
python intro and installation.pptxadityakumawat625
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfVaibhavKumarSinghkal
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptxBharathYusha1
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptxMaheShiva
 
Python games
Python gamesPython games
Python gamesmolw
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of pythonBijuAugustian
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonmckennadglyn
 
Intro to Python Programming
Intro to Python ProgrammingIntro to Python Programming
Intro to Python Programmingssuser65af26
 
Programming in python
Programming in python Programming in python
Programming in python Priya Nayak
 

Similar to Python games (20)

Python Programming
Python ProgrammingPython Programming
Python Programming
 
GUIDE TO PROGRAMMING WITH PYTHON
GUIDE TO PROGRAMMING WITH PYTHONGUIDE TO PROGRAMMING WITH PYTHON
GUIDE TO PROGRAMMING WITH PYTHON
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
 
Easy coding a multi device game with FireMonkey
Easy coding a multi device game with FireMonkeyEasy coding a multi device game with FireMonkey
Easy coding a multi device game with FireMonkey
 
Get Starte with MicroPython ESP32
Get Starte with MicroPython ESP32Get Starte with MicroPython ESP32
Get Starte with MicroPython ESP32
 
Get Started with MicroPython ESP32
Get Started with MicroPython ESP32Get Started with MicroPython ESP32
Get Started with MicroPython ESP32
 
Cs2 Ch1
Cs2 Ch1Cs2 Ch1
Cs2 Ch1
 
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
 
python intro and installation.pptx
python intro and installation.pptxpython intro and installation.pptx
python intro and installation.pptx
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptx
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptx
 
Python games
Python gamesPython games
Python games
 
Welcome_to_Python.pptx
Welcome_to_Python.pptxWelcome_to_Python.pptx
Welcome_to_Python.pptx
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Intro to Python Programming
Intro to Python ProgrammingIntro to Python Programming
Intro to Python Programming
 
Programming in python
Programming in python Programming in python
Programming in python
 

Recently uploaded

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Recently uploaded (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

Python games

  • 2. • Python is a computer programming language. We chose Python for this tutorial because it’s a simple language to start out with, and is fun and easy to learn.
  • 3. • While you can run short bits of Python code at the Python prompt, if you want to work on a bigger program (like a game), you probably want to SAVE your code to a file so that you don’t have to type it in over and over again.
  • 4. • There are several ways to run a Python program as a file. One way is to use a plain text editor like Notepad (Windows), or TextEdit (Mac). Open a new text file, type in your Python code (like print 1+1).
  • 5. • Then on Windows, double-click this file to run it. On Mac, open Terminal and type python, then drag the file that you SAVED onto the Terminal window and press Enter.
  • 6. • The other way is to type in your code using the IDLE editor, which is what you’re going to do in this tutorial. To run idle, simply type idle from Terminal. Then choose FileNew Window from the IDLE menu and you should have a text editor window where you can type in Python code. You can SAVE your code changes via FileSave and even run the code via RunRun Module (F5).
  • 7. • You are almost ready to create your game. But what’s a game without some great graphics and sound effects? I’ve put together all the graphics and sound effects you’ll need for your game into a ZIP archive. You can download it here.
  • 8. • Once you’ve downloaded the file, create a folder for your game on your hard disk and extract the resources folder into that folder so that your game folder has a subfolder named resources, with the various resources grouped in additional folders inside it
  • 9. • The first if statement checks if the time is up. The second one checks if the castle is destroyed. The third one calculates your accuracy ratio. After that, a quick if statement checks if you won or lost and displays the correct image.
  • 10. • Done by : Fahd Khan • 12 BB