jQuery Game Development Essentials

jQuery Game Development Essentials
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
save 6%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Discover how you can create a fantastic RPG, arcade game, or platformer using jQuery!
  • Learn how you can integrate your game with various social networks, creating multiplayer experiences and also ensuring compatibility with mobile devices.
  • Create your very own framework, harnessing the very best design patterns and proven techniques along the way.
  • The updated code files can be found here.

Book Details

Language : English
Paperback : 244 pages [ 235mm x 191mm ]
Release Date : April 2013
ISBN : 1849695067
ISBN 13 : 9781849695060
Author(s) : Selim Arsever
Topics and Technologies : All Books, Game Development, Games, jQuery

Table of Contents

Chapter 1: jQuery for Games
Chapter 2: Creating Our First Game
Chapter 3: Better, Faster, but not Harder
Chapter 4: Looking Sideways
Chapter 5: Putting Things into Perspective
Chapter 6: Adding Levels to Your Games
Chapter 7: Making a Multiplayer Game
Chapter 8: Let's Get Social
Chapter 9: Making Your Game Mobile
Chapter 10: Making Some Noise
  • Chapter 1: jQuery for Games
    • The way of jQuery
      • Chaining
      • Polymorphism
    • Moving things around
      • Chaining animations
      • Managing the queue
        • .stop()
        • .clearQueue()
        • .dequeue()
        • .delay()
      • Other usages of queues
    • Handling of events
      • .bind()
      • .delegate()
      • Removing event handlers
      • jQuery 1.7
  • Associating data with DOM elements
  • Manipulating the DOM
    • .append()
    • .prepend()
    • .html()
    • .remove()
    • .detach()
  • Stay curious my friend!
  • Summary
    • Chapter 2: Creating Our First Game
      • How does this book work?
      • Let's get serious – the game
      • Learning the basics
        • Framework
        • Sprites
          • Implementing animations
          • Adding animations to our framework
        • Moving sprites around
        • Preloading
      • Initializing the game
      • Main loop
        • Main loop implementation
      • Collision detection
      • Summary
      • Chapter 3: Better, Faster, but not Harder
        • Intervals and timeouts
          • One interval to rule them all
            • Code
        • Keyboard polling
          • Keeping track of the keys' state
        • HTML fragments
        • Avoiding reflow
        • Moving your sprite around using CSS Transforms
        • Using requestAnimationFrame instead of timeouts
        • Summary
        • Chapter 4: Looking Sideways
          • Offline divs
          • Groups
          • Sprite transformation
            • CSS transform
            • Adding transform to the framework
          • Tile maps
            • Naive implementation
          • Collision detection
            • Colliding with tile maps
              • Finding the colliding tiles
            • Sprite versus sprite collision
          • Coding the game
          • Basic setup of the game screen
          • Object-oriented code for the player
            • Updating the player's position
            • Controlling the player's avatar
          • Player control
          • Parallax scrolling
          • Creating enemies
          • Summary
          • Chapter 5: Putting Things into Perspective
            • Optimizing tile maps for top-down games
              • Finding the visible tiles
              • Moving the tile map
            • Sorting the occlusion
              • Sprite occlusion
              • Level versus sprite occlusion
            • Collision detection
              • Player versus environment collisions
                • Using a tile map editor
              • Player versus sprite collision
                • Talking to NPCs
                • Fighting enemies
            • The complete game
            • Isometric tiles
              • Drawing an isometric tile map
              • Occlusion for isometric games
            • Summary
            • Chapter 6: Adding Levels to Your Games
              • Implementing a multi-file game
                • Loading tile maps
                • Loading sprites and their behavior
                • Using $.ajax
                • Loading a JSON file
                • Loading a remote script
                • Debugging calls to $.ajax
                  • .done()
                  • .fail()
              • Modifying our platform game
              • Summary
              • Chapter 7: Making a Multiplayer Game
                • World of Ar'PiGi
                • Managing the player's account
                  • Searching elements in the database
                  • Creating a new player in the database
                  • Keeping the player connected
                  • Logging the user into the game
                • Keeping the players in sync
                  • Retrieving all the other players
                  • Updating the current player position
                  • Client-side code
                • Taking care of monsters
                  • Implementing server-side combat
                • Summary
                • Chapter 8: Let's Get Social
                  • Creating a simple leaderboard
                    • Saving highscores
                    • Retrieving highscores
                    • Displaying the highscores
                  • Making cheating harder
                    • Server-side verification
                    • Making your variables less readable
                    • Obfuscating your code
                    • Making your network protocol less readable
                      • Encoding values
                      • Randomly naming the variables
                      • Adding random variables
                  • Integrating with Twitter
                    • Twitter for dummies
                    • Full access to Twitter's API
                      • Registering your game with Twitter
                      • Server-side helper library
                      • Authentication
                      • Publishing high scores on Twitter
                  • Integrating with Facebook
                    • Authenticating with Facebook
                    • Creating achievements
                    • Publishing the achievements
                  • Summary
                  • Chapter 9: Making Your Game Mobile
                    • Making your game run well on mobile devices
                      • Detecting mobile browsers
                        • Client-side browser detection
                        • Server-side detection
                        • Should you really detect the browser?
                      • Performance limitation – memory
                      • Performance limitation – speed
                        • Specifying the page's visible area
                        • Level of details
                    • Touch control
                      • D-pad
                      • Analog joystick
                        • Event handlers
                    • Integrating our game with the springboard
                      • Making your game installable
                      • Configuring the status bar
                      • Specifying the application icon
                      • Specifying a splash screen
                    • Using device orientation
                    • Using the offline application cache
                    • Using web storage
                    • Summary
                    • Chapter 10: Making Some Noise
                      • Abstracting audio
                        • Using our small library
                      • Embedding sound
                        • Implementation
                        • Supported format
                      • HTML5 Audio element
                        • Preloading a sound
                        • Playing and stopping sounds
                      • Web Audio API
                        • Basic usage
                        • Connecting more nodes
                        • Loading more than one sound
                        • So many nodes, so little time
                          • Delay node
                          • ScriptProcessor node
                          • Panner node
                          • Convolver node
                          • Analyser node
                          • DynamicCompressor node
                          • BiquadFilter node
                          • WaveShaper node
                      • Flash fallbacks
                        • SoundManager 2
                        • Alternatives to SoundManager
                      • Generating sound effects
                      • Summary

                      Selim Arsever

                      Selim Arsever is a Senior Software Engineer working as a consultant in Switzerland. Over the last 4 years, he has been developing gameQuery (http://gamequeryjs.com), an open source game engine based on jQuery, as well as other JavaScript games and demos. He has been giving several talks on the subject and thinks that there is nothing more interesting than using tools beyond what they were initially intended for. You can follow him on twitter at @SelimArsever.

                      Code Downloads

                      Download the code and support files for this book.

                      Submit Errata

                      Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                      - 2 submitted: last submission 12 Aug 2013

                      Errata type: Others | Page number: 138 | Errata date: 8-5-2013


                      The diagram for the server side workflow says "send coNbat result" instead of  
                      "send combat result".



                      Errata type: Code| Page number: 23 | Errata date: 19-3-2013


                      On line 5, there is a misspelling in .css("bakgroundPosition", … ).
                      It should be  .css("backgroundPosition", … ).



                      Sample chapters

                      You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                      Frequently bought together

                      jQuery Game Development Essentials +    PhoneGap 3.x Mobile Application Development Hotshot =
                      50% Off
                      the second eBook
                      Price for both: $41.55

                      Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                      What you will learn from this book

                      • Create sprite-based, multi-platform games using the latest web standards and jQuery
                      • Use powerful techniques directly from the games industry to make your own games harness stunning visual effects without compromising on performance
                      • Learn how you can develop real-time multiplayer games and integrate them with social networks
                      • Overcome the limitations of mobile browsers allowing you to take full advantage of their various features with minimum hassle
                      • Develop a platformer, an arcade game, or even your very own RPG with jQuery at the core
                      • Discover how you can easily implement features like parallax scrolling
                      • Utilize your existing skills in jQuery in a fun and exciting new context

                      In Detail

                      jQuery is a leading multi-browser JavaScript library that developers across the world utilize on a daily basis to help simplify client-side scripting. Using the friendly and powerful jQuery to create games based on DOM manipulations and CSS transforms allows you to target a vast array of browsers and devices without having to worry about individual peculiarities.

                      "jQuery Game Development Essentials" will teach you how to use the environment, language, and framework that you’re familiar with in an entirely new way so that you can create beautiful and addictive games. With concrete examples and detailed technical explanations you will learn how to apply game development techniques in a highly practical context.

                      This essential reference explains classic game development techniques like sprite animations, tile-maps, collision detection, and parallax scrolling in a context specific to jQuery. In addition, there is coverage of advanced topics specific to creating games with the popular JavaScript library, such as integration with social networks alongside multiplayer and mobile support. jQuery Game Development Essentials will take you on a journey that will utilize your existing skills as a web developer so that you can create fantastic, addictive games that run right in the browser.


                      Written as a concise yet practical guide with an explicit focus on utilizing jQuery for game development, you'll learn how to create stunning games that look great - without the hassle of learning about a complex game engine in the process.

                      Who this book is for

                      Knowledge of JavaScript and jQuery as well as basic experience with frontend development is all you need to start making games in a matter of hours with this essential guide. Whilst also suitable for those who simply want to start making games with jQuery, it's specifically targeted at web developers that want to experiment with and utilize their existing skills.

                      Code Download and Errata
                      Packt Anytime, Anywhere
                      Register Books
                      Print Upgrades
                      eBook Downloads
                      Video Support
                      Contact Us
                      Awards Voting Nominations Previous Winners
                      Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                      Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software