Skip to main content

Knowing What the Player Is Doing

  • Chapter
  • First Online:
Building JavaScript Games
  • 2166 Accesses

Abstract

In this chapter, you start to create a game called Painter. In this game, you need to show sprites that move on the screen. You’ve already seen a few examples of loading and displaying sprites. Also, you’ve seen that it’s possible to use the current time information to change the position of a sprite. You build on these examples to begin creating Painter. Furthermore, you learn how to deal with player input in your game. You see how to retrieve what the player is doing and how the game world changes depending on that information. You start with a simple extension of the FlyingSprite program that draws a balloon at the position of the mouse pointer. The next chapter examines other types of input, such as keyboard and touch input.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 69.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 89.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Arjan Egges

About this chapter

Cite this chapter

Egges, A. (2014). Knowing What the Player Is Doing. In: Building JavaScript Games. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-6539-9_5

Download citation

Publish with us

Policies and ethics