- Hands-On Game Development with WebAssembly
- Rick Battagline
- 123字
- 2021-06-24 13:41:09
Summary
In this chapter, we learned how to get keyboard input for use with WebAssembly. There are two primary methods. We could either take in keyboard input on the JavaScript side and communicate with WebAssembly through a wrapper made with Module.cwrap, or by calling WebAssembly functions directly with Module.ccall. The other way to accept keyboard input in WebAssembly is by using SDL keyboard input events. When we use this method, we can use the default Emscripten shell. This second method, using SDL events, will be our preferred method throughout the rest of this book.
In the next chapter, we will learn more about the game loop and how we will use it in our game, as well as games in general.
推薦閱讀
- ATmega16單片機項目驅(qū)動教程
- 極簡Spring Cloud實戰(zhàn)
- 基于Proteus和Keil的C51程序設(shè)計項目教程(第2版):理論、仿真、實踐相融合
- 精選單片機設(shè)計與制作30例(第2版)
- Learning Game Physics with Bullet Physics and OpenGL
- Large Scale Machine Learning with Python
- 分布式系統(tǒng)與一致性
- Hands-On Machine Learning with C#
- OpenGL Game Development By Example
- 單片機原理及應(yīng)用:基于C51+Proteus仿真
- 新編電腦組裝與硬件維修從入門到精通
- 3D Printing Blueprints
- Spring Security 3.x Cookbook
- 嵌入式系統(tǒng)原理及應(yīng)用:基于ARM Cortex-M4體系結(jié)構(gòu)
- 零基礎(chǔ)輕松學(xué)修電腦主板