More Python Programming for the Absolute Beginner

所需积分/C币:9 2014-04-14 21:41:00 5.35MB PDF
收藏 收藏 2
举报

What better way is there to learn a programming language than with a game-oriented approach? If you ask the many readers that have made this book's prequel, PYTHON PROGRAMMING FOR THE ABSOLUTE BEGINNER, a bestseller, they'll tell you - there isn't one. MORE PYTHON PROGRAMMING FOR THE ABSOLUTE BEGINN
e COURSE TECHNOLOGY ° CENGAGE Learning More Python@Programming for the O 2012 Course Technology, a part of Cengage Learning Absolute Beginner: Jonathan S ALL RIGHTS RESERVED. No part of this work covered by the copyrigh herein may be reproduced, transmitted, stored, or used in any form or by Publisher and General Manager, Course ly means graphic, electronic, or mechanical, including but not limited to Technology PtR: Stacy L. hiqu photocopying, recording, scanning, digitizing. taping, Web distribution, in- Assoclate Director of Marketing: formation networks, or information storage and retrieval systems,except as permitted under Section 107 or 108 of the 1976 United States Copyright Act. without the prior written permission of the publisher Manager of Editorial Se For product information and tec assistance, contact us at Marketing Manager: Mark Hughes Support,1-800-3549706 Senior Acquisitions Editor: Mitzi Koontz or permission to use material from this text or praduct, submit all requests online at cengage. com/permissions further permissions questions can be emailed to permissi echnical Reviewer: Keith Davenport Interior Layout Tech: value Chain Software All other trademarks are the property of their respective owners Cover Designer: Mike Tanamachi All mages6Cengage Leaning unless otherwise noted. Library af Congress Control Number. 201193324 eSBN-10:14354-5981 Course Technology, a part of Cengage Learning 20 angage Leaming is a leading provider of customized learning solutions ith office locations around the globe, including singapore, the United Cengage Learning products are represented in Canada by Nelson Printed in the united states of americ 234567131211 This book is dedicated to lone game developers on forums like Thegameprogrammingwikiwww.gpwiki.orgwhoput enormous passion into their creative works of interactive fiction, often without recognition. Do what you love and share it with the world ACKNOWLEDGmENTS 工 offer my gratitude to those involved in getting this book finished and into print, especially Mitzi Koontz, Jenny Davidson, Keith Davenport, Mik Tanamachi, and Michael Beady. I would like to say, I hope it sells a million copies so i never have to work with any of you again, but that sentiment might be misunderstood and considered rudel So i will just say thanks! ABOUT THE AUTHOR onathan S Harbour has been programming since the 1980s. His first game system was an Atari 2600, which he disassembled on the floor of his room as a kid. He has written on C++, C#, Basic, Java, Directx, Allegro, Lua, Dark Basic, Game Boy Advance, Pocket PC, and game consoles. His other recent books include Beginning java se 6 Game Programming, Third Edition; XNA Game Studio 4.0 for Xbox 360 Developers, Multi-Threaded Gumme Engine Design; and an earlier book in this series, Visual Basic NET Programming for the Absolute Beginner(2003). He holds a mas- ter'sdegreeininformationsystensVisithinonthewebatwwwjharbour.com andwww.facebook.com/jharbourcom This page intentionally left blank TABLE OF CONTENTS Chapter1 PYTHON HAS CLASS,……1 E Getting Started with Python. Python tools Python Language Objects in Python OOP: The Python way... Multiple Inheritance Summary… Chapter 2 GETTING STARTED WITH PY GAME: THE PIE GAME 2 Examining The Pie game Printing Text Drawing rectangles.. Drawing Arcs The pie game Summary …34 Chapter 3 FILE 1/O, DATA, AND FoNTS: THE TRIVIA GAME...35 Examining The Trivia game Python Data Types Getting User Input….,,… Handling Exceptio The mad Lib gaIne File Input Output forking with Text File More Python Programming for the Absolute Beginner Working with Binary Files Printing Te The trivia class Loading the Trivia Data Displa n al 50 Re to user int Going Main code Chapter 4 USER IN PUT: THE BoMB CATCHER GAME Examining The bomb catcher game Pygame Events Real-Time Event Loop Mouse events 61 Device polling Polling the Keyboard Polling the mouse 65 The bob catcher gae Chapter 5 MATH AND GRAPHICS: THE ANALOG CLOCK DEMO.....73 Examining The Analog Clock Deo... Basic trigonometry 74 Circle Theory.……… Traversing a Circle's Perimeter he analog clock demo Getting the time Drawing the Clock 84 Chapter b BITMAP GRAPHICS: THE ORBITING SPACESHIP DEMO.93 Examining The Orbiting Spaceship Demo. Bitm Drawing the background... Drawing the Planet Contents Drawing the spaceship………… Rotating Summary............ 107 Chapter 7 ANIMATION WITH SPRITES: THE ESCAPE THE Dragon GAME …………………l。9 Examining The Escape The Dragon Game Custom animation 110 Loading a Sprite Sheet 112 Cha the f 112 Drawing One Frame MySprite Class prite Animation to the Test The escape the dragon game 119 Jumping 120 Colliding… 121 Source code 124 Chapter 8 SPRITE CoLLIsIOn DETECTIoN: THE ZoMBIE MoB AME Examining The Zombie Mob game.…… 127 Collision Detection Techniques ectangle Collision Between Two Sprites.. Circle Collision Between Two Sprites Pixel-Perfect Masked Collision Between Two Sprites Rectangle Collision Between a Sprite and a Group Rectangle Collision Between Two Groups The Zombie mob game 131 Creating Your Own module dvanced directional Animation Colliding with Zombies Game source co …141

...展开详情
试读 127P More Python Programming for the Absolute Beginner
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    一个资源只可评论一次,评论内容不能少于5个字
    zlj10001 这本书不好找,感谢分享
    2017-07-04
    回复
    yuhouren 十分不错的一本书!
    2017-04-14
    回复
    zhaomidairen 不错的入门书
    2015-12-28
    回复
    nkmicrosoft 找了好久的书终于在这里发现了,赞
    2015-11-09
    回复
    关注 私信 TA的资源
    上传资源赚积分,得勋章
    最新推荐
    More Python Programming for the Absolute Beginner 9积分/C币 立即下载
    1/127
    More Python Programming for the Absolute Beginner第1页
    More Python Programming for the Absolute Beginner第2页
    More Python Programming for the Absolute Beginner第3页
    More Python Programming for the Absolute Beginner第4页
    More Python Programming for the Absolute Beginner第5页
    More Python Programming for the Absolute Beginner第6页
    More Python Programming for the Absolute Beginner第7页
    More Python Programming for the Absolute Beginner第8页
    More Python Programming for the Absolute Beginner第9页
    More Python Programming for the Absolute Beginner第10页
    More Python Programming for the Absolute Beginner第11页
    More Python Programming for the Absolute Beginner第12页
    More Python Programming for the Absolute Beginner第13页
    More Python Programming for the Absolute Beginner第14页
    More Python Programming for the Absolute Beginner第15页
    More Python Programming for the Absolute Beginner第16页
    More Python Programming for the Absolute Beginner第17页
    More Python Programming for the Absolute Beginner第18页
    More Python Programming for the Absolute Beginner第19页
    More Python Programming for the Absolute Beginner第20页

    试读已结束,剩余107页未读...

    9积分/C币 立即下载 >