- SFML Game Development By Example
- Raimondas Pupius
- 227字
- 2021-07-23 14:55:09
Chapter 4. Grab That Joystick – Input and Event Management
Arguably, the most important aspect of any game ever made is actually being able to play it. Regardless of the purpose of input, ranging from simply hitting keys to navigating through menus to controlling when your character jumps and which direction he or she walks to, the lack of an application presenting a way for you to interact with it might as well leave you with a very fancy screensaver. We have very briefly looked at the primitive way of grabbing and using the keyboard input, however our motivation for this chapter is quite different than simply being content with a large nest of if/else statements that handle every single key being pressed. Instead, we want to look at a more robust way of handling not just the keyboard, but also the mouse and any events that happen between the frames, along with adding potential for processing input of additional peripherals, such as joysticks. With that in mind, let's take a look at what we will be covering in this chapter:
- Basic means of checking the states of keyboard and mouse buttons
- Understanding and processing different types of events
- Understanding and utilizing callbacks
- Designing and implementing an event manager
Let's not sit still like the character of your game without input and get on coding!
- GeoServer Cookbook
- Web開發(fā)的貴族:ASP.NET 3.5+SQL Server 2008
- Python機器學習實戰(zhàn)
- 重學Java設(shè)計模式
- Haxe Game Development Essentials
- Mastering JBoss Enterprise Application Platform 7
- 學習正則表達式
- 零基礎(chǔ)學C語言第2版
- Android嵌入式系統(tǒng)程序開發(fā):基于Cortex-A8(第2版)
- Qlik Sense? Cookbook
- QPanda量子計算編程
- Visual Basic程序設(shè)計全程指南
- 監(jiān)控的藝術(shù):云原生時代的監(jiān)控框架
- Java高手是怎樣煉成的:原理、方法與實踐
- TypeScript全棧開發(fā)