Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OpenGL Game Development By Example

You're reading from   OpenGL Game Development By Example Design and code your own 2D and 3D games efficiently using OpenGL and C++

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher
ISBN-13 9781783288199
Length 340 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Robert Madsen Robert Madsen
Author Profile Icon Robert Madsen
Robert Madsen
Stephen Madsen Stephen Madsen
Author Profile Icon Stephen Madsen
Stephen Madsen
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Chapter 4. Control Freak

Most games are designed to be interactive. This means that the player must have some way to control what happens during the game. In the last chapter, you wrote code that displayed the robot and moved him across the screen. Now, you will control the robot!

This chapter will explain how to implement an input system to control the game's character, and interact with the game. Topics will include:

  • Types of input: There are many ways to interact with your game. Typically, games written for the PC depended on the mouse and keyboard. Direct touch input has now become the standard for mobile and tablet devices, and soon every PC will also have a touch-enabled display. We will cover the most common methods to receive input in your game.
  • Using the mouse and keyboard: In this section, you will write code to receive input from the mouse and keyboard to control both the game and our friendly robot.
  • Creating the user interface: In addition to controlling our robot...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime