- OpenGL Game Development By Example
- Robert Madsen Stephen Madsen
- 241字
- 2021-07-16 12:44:25
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, we also need a way to interact with the game. You will learn how to create an onscreen interface that allows you to control the game and choose the game options.
- Controlling the character: We want our robot to be able to walk, run, jump, and play! You will learn how to use the mouse and keyboard to control how your robot moves about on the screen.
推薦閱讀
- Linux KVM虛擬化架構(gòu)實(shí)戰(zhàn)指南
- 嵌入式技術(shù)基礎(chǔ)與實(shí)踐(第5版)
- INSTANT Wijmo Widgets How-to
- 計(jì)算機(jī)應(yīng)用與維護(hù)基礎(chǔ)教程
- 基于ARM的嵌入式系統(tǒng)和物聯(lián)網(wǎng)開發(fā)
- 計(jì)算機(jī)組裝與維護(hù)(第3版)
- CC2530單片機(jī)技術(shù)與應(yīng)用
- OpenGL Game Development By Example
- 單片機(jī)開發(fā)與典型工程項(xiàng)目實(shí)例詳解
- Neural Network Programming with Java(Second Edition)
- IP網(wǎng)絡(luò)視頻傳輸:技術(shù)、標(biāo)準(zhǔn)和應(yīng)用
- 計(jì)算機(jī)電路基礎(chǔ)(第2版)
- 微服務(wù)架構(gòu)基礎(chǔ)(Spring Boot+Spring Cloud+Docker)
- 從企業(yè)級(jí)開發(fā)到云原生微服務(wù):Spring Boot實(shí)戰(zhàn)
- Practical Artificial Intelligence and Blockchain