1. 首页
  2. 编程语言
  3. Javascript
  4. Making Games With JavaScript 无水印pdf

Making Games With JavaScript 无水印pdf

上传者: 2018-12-25 17:03:57上传 PDF文件 1.45MB 热度 33次
Making Games With JavaScript 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除Making games: With JavascriptChristopher PittCape Town, Western Cape South africaISBN-13(pbk):978-1-4842-24922ISBN-13( electronic:978-1-4842-2493-9DOI10.1007/978-1-4842-24939Library of Congress Control Number: 2016961803Copyright o 2016 by Christopher PittThis work is subject to copyright All rights are reserved by the Publisher, whether the wholeor part of the material is concerned, specifically the rights of translation, reprinting, reuse ofillustrations, recitation, broadcasting, reproduction on microfilms or in any other physicalway, and transmission or information storage and retrieval, electronic adaptation, computersoftware, or by similar or dissimilar methodology now known or hereafter developedTrademarked names, logos, and images may appear in this book. Rather than use a trademarksymbol with every occurrence of a trademarked name, logo, or image we use the names, logos,and images only in an editorial fashion and to the benefit of the trademark owner, with nointention of infringement of the trademarkThe use in this publication of trade names, trademarks, service marks, and similar terms, evenif they are not identified as such, is not to be taken as an expression of opinion as to whether ornot they are subject to proprietary rightsWhile the advice and information in this book are believed to be true and accurate at thedate of publication, neither the authors nor the editors nor the publisher can accept any legalresponsibility for any errors or omissions that may be made. The publisher makes no warranty,express or implied, with respect to the material contained hereinManaging Director: Welmoed SpahrLead Editor Steve anglinEditorial Board: Steve Anglin, Pramila Balan, Laura Berendson, Aaron blackLouise Corrigan, Jonathan Gennick, Robert Hutchinson, Celestin Suresh JohnNikhil Karkal, James Markham, Susan McDermott, Matthew Moodie, Natalie PaoGwenan SpearingCoordinating editor: Mark PowersCopy editor: rebecca RiderCompositor: SPi GlobalIndexer: SPi GlobalArtist: SPi GlobalCover image: Designed by FreepikDistributed to the book trade worldwide by Springer Science+Business Media New York,233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax(201)348-4505e-mailorders-nyospringer-sbm.comorvisitwww.springeronline.comApressMedia,LlcisaCalifornia LLC and the sole member(owner )is Springer Science Business Media Finance Inc(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporationForinformationontranslationspleasee-mailrights@apress.comorvisitwww.apress.comApress and friends of ed books may be purchased in bulk for academic, corporate, or promotionaluse eBook versions and licenses are also available for most titles. for more information referenceourSpecialBulkSales-ebooklicensingwebpageatwww.apress.com/bulk-salesAny source code or other supplementary materials referenced by the author in this text areavailabletoreadersatwww.apress.com.fordetailedinformationabouthowtolocateyourbookssourcecodegotowww.apress.com/source-code/.ReaderscanalsoaccesssourcecodeatSpringerLink in the Supplementary Material section for each chapter.Printed on acid-free paperFor Sam, nicole, eva, and simonContents at a glanceAbout the authorChapter 1: Introduction aa.■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■Chapter 2: The Game LoopChapter 3: Player Input.man.■■■9Chapter 4: Collision Detectionn Detection15Chapter 5: Gravityraaaaaan■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■23Chapter 6: Ladders■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■35Chapter 7 stairs■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■Chapter8: Camera Locking…,,,,,,,,,…,,,……,47Chapter 9: Projectiles a■■■53Chapter 10: Mobs mmmm. 61Chapter 11: Health■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■65Chapter 12: Animation■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■69Chapter 13: Sounds mmmmmtammmammammammmmmnmmmanamma 73Chapter 14: Gamepads mammea■■■■■75ndex■■■■■■■■81ContentsAbout the authorXIChapter 1: Introduction■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■Chapter 2: The Game LoopSetting the stage for our game1334Creating sprites,…The game l00p…468Summary…Chapter 3: Player Input.■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■Detecting input……99Natural player movement12Summary…13Chapter 4: Collision Detection mmmmm 15Creating boxes15Detecting circle Co‖ lesions...,.,.,.,.,.,………,17Detecting rectangle collisions m.mm.m..m....m.. 19Summary21Chapter 5: Gravity. amamaanananannmanamnmnmnn 23Cleaning up our existing code23Adding gravity to the world8Allowing players to jump32Summary34CONTENTSChapter6: Ladders…,,,,,,,,,,,,,,,…,,35Creating our first ladder...,.,.,.,.,,…….35Allowing players to climb ladders37Summary40Chapter 7: Stairsu41Building a slope…,41Walking up slopes,44Staying above the floor6Summary…Chapter 8: Camera Locking ata.■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■47Wrapping with a camera47Growing levels49Summary51Chapter 9: Projectiles mmmmaammmmanmmmammmma 53Custom crosshairs53Custom keys…56Shooting58Summary…60Chapter 10: Mobs ant■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■61Patrolling blobs. ....................................................61Shooting mobs .Summary64Chapter 11: Healthg65Takⅰ ng damage..…65Showing health66Summary68VIllCONTENTSChapter 12: Animationamama mammmammmmaam 69Animating the player.Swapping animationsSummary72Chapter 13: Sounds A ammannAdding background music.33Adding action and event sounds74Summary■■■■74Chapter 14: Gamepads■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■Handling events55riggers and joysticksSummary……,…,,Index81About the authorChristopher Pitt is a developer and writer working at Silver Stripe. He usually works onapplication architecture, though sometimes you'll find him building compilers or robotsI've written this short book with Javascript developers in mind For it to be valuableto you, you'll need to understand how to use JavaScript. Where possible, Ive explainednewer syntax and difficult concepts. But this is not the best book to learn Javascript fromIf you're new to JavaScript, I recommend reading Learning Java Script(http://a.co/1mwoufl)first.Itwillhelpyouunderstandsomeofthetrickypartsand put you in the right mindset to learn what this book teachesIf you have questions, dont hesitate to lask me questionsChttps://twitter.com/assertchris)CHAPTER 1IntroductionI'm a gamer. I've been a gamer since before I was a programmer. And yet I've never triedto build a game. until now. A few weeks ago, a coworker sketched a simple, beautifulplatform game. The moment I saw it; I knew I wanted to build itKnowing where to begin is always hard. Many books and tutorials about makinggames are often written in Java, C++, or some other language you havent learned yet. sothe complexity of making games increases when you also need to learn new languagesInstead I'm going to use modern Java Script to make games for web browsersThey re effortless to use and they work everywhere. If you ve ever wanted to make a gamejoin me. Well start with nothing and build fun games in no time at allIfyouhavequestionsfeelfreetoaskmeonTwitterhttps://twitter.com/assertchrisElectronic supplementary material The online version of this chapter(doi: 10.10071978-1-4842-2493-9_1)contains supplementary material, which isavailable to authorized usersC Christopher Pitt 2016C.Pi, Making games,DOI10.1007/978-1-4842-2493-91
下载地址
用户评论