官术网_书友最值得收藏!

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.
主站蜘蛛池模板: 临泽县| 莱芜市| 宿迁市| 昌乐县| 新干县| 莱阳市| 嵊州市| 民乐县| 平潭县| 洛隆县| 建德市| 青河县| 鲁山县| 金川县| 新河县| 哈尔滨市| 枞阳县| 衡南县| 大邑县| 石阡县| 安岳县| 崇信县| 五峰| 青冈县| 新干县| 阿拉善右旗| 汉沽区| 宽甸| 特克斯县| 祁阳县| 萍乡市| 额尔古纳市| 石家庄市| 娱乐| 汉沽区| 秦安县| 随州市| 佛学| 红河县| 鹤山市| 泰安市|