ebook img

Invent Your Own Computer Games with Python, 4E PDF

452 Pages·2016·5.44 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Invent Your Own Computer Games with Python, 4E

INVENT YOUR OWN COMPUTER GAMES WITH PYTHON 4TH EDITION Al Sweigart San Francisco INVENT YOUR OWN COMPUTER GAMES WITH PYTHON, 4TH EDITION. Copyright © 2017 by Al Sweigart. Some rights reserved. This work is licensed under the Creative Commons Attribution- NonCommercial-ShareAlike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/us/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Printed in USA First printing 20 19 18 17 16 1 2 3 4 5 6 7 8 9 ISBN-10: 1-59327-795-4 ISBN-13: 978-1-59327795-6 Publisher: William Pollock Production Editor: Laurel Chun Cover Illustration: Josh Ellingson Interior Design: Octopod Studios Developmental Editor: Jan Cash Technical Reviewer: Ari Lacenski Copyeditor: Rachel Monaghan Compositor: Susan Glinert Stevens Proofreader: Paula L. Fleming Indexer: Nancy Guenther The sprite images in Figure 20-1 on page 302, from left to right, were created by fsvieira, przemek.sz, LordNeo, and Suppercut. The grass sprite image in Figure 20-2 on page 302 was created by txturs. These images have been dedicated to the public domain with a CC0 1.0 Public Domain Dedication. For information on distribution, translations, or bulk sales, please contact No Starch Press, Inc. directly: No Starch Press, Inc. 245 8th Street, San Francisco, CA 94103 phone: 1.415.863.9900; [email protected] www.nostarch.com Library of Congress Cataloging-in-Publication Data Names: Sweigart, Al, author. Title: Invent your own computer games with Python / by Al Sweigart. Description: San Francisco : No Starch Press, Inc., [2017] Identifiers: LCCN 2016037817 (print) | LCCN 2016044807 (ebook) | ISBN 9781593277956 | ISBN 1593277954 | ISBN 9781593278113 (epub) | ISBN 159327811X (epub) | ISBN 9781593278120 (mobi) | ISBN 1593278128 (mobi) Subjects: LCSH: Computer games--Programming. | Python (Computer program language) Classification: LCC QA76.76.C672 S785 2017 (print) | LCC QA76.76.C672 (ebook) | DDC 794.8/1526--dc23 LC record available at https://lccn.loc.gov/2016037817 No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other product and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it. To Caro About the Author Al Sweigart is a software developer, tech book author, and hoopy frood who really knows where his towel is. He has written several programming books for beginners, including Automate the Boring Stuff with Python and Scratch Programming Playground, also from No Starch Press. His books are freely available under a Creative Commons license at his website https://inventwithpython.com/. About the Technical Reviewer Ari Lacenski is a developer of Android applications and Python software. She lives in the Bay Area, where she writes about Android programming at http://gradlewhy.ghost.io/ and mentors with Women Who Code. BRIEF CONTENTS Acknowledgments Introduction Chapter 1: The Interactive Shell Chapter 2: Writing Programs Chapter 3: Guess the Number Chapter 4: A Joke-Telling Program Chapter 5: Dragon Realm Chapter 6: Using the Debugger Chapter 7: Designing Hangman with Flowcharts Chapter 8: Writing the Hangman Code Chapter 9: Extending Hangman Chapter 10: Tic-Tac-Toe Chapter 11: The Bagels Deduction Game Chapter 12: The Cartesian Coordinate System Chapter 13: Sonar Treasure Hunt Chapter 14: Caesar Cipher Chapter 15: The Reversegam Game Chapter 16: Reversegam AI Simulation Chapter 17: Creating Graphics Chapter 18: Animating Graphics Chapter 19: Collision Detection Chapter 20: Using Sounds and Images Chapter 21: A Dodger Game with Sounds and Images Index CONTENTS IN DETAIL ACKNOWLEDGMENTS INTRODUCTION Who Is This Book For? About This Book How to Use This Book Line Numbers and Indentation Long Code Lines Downloading and Installing Python Starting IDLE Finding Help Online 1 THE INTERACTIVE SHELL Some Simple Math Integers and Floating-Point Numbers Expressions Evaluating Expressions Syntax Errors Storing Values in Variables Summary 2 WRITING PROGRAMS String Values String Concatenation Writing Programs in IDLE’s File Editor Creating the Hello World Program Saving Your Program

Description:
Invent Your Own Computer Games with Python will teach you how to make computer games using the popular Python programming language—even if you’ve never programmed before!Begin by building classic games like Hangman, Guess the Number, and Tic-Tac-Toe, and then work your way up to more advanced ga
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.