2 #include "usereventtype.h"
4 Controle::Controle(Player
&p
) : jogador( p
) {
10 void Controle::handleEvents() {
12 jogador
.bypass
= false;
13 while( SDL_PollEvent( &e
) ) {
16 switch (e
.user
.code
) {
18 void (*p
) (void*) = (void (*)(void*))e
.user
.data1
;
22 default: handleEvent(e
); break;
29 switch (e
.key
.keysym
.sym
) {
31 jogador
.equip(game
->weaponManager
->getWeapon("Shotgun"));
34 jogador
.equip(game
->weaponManager
->getWeapon("Flamethrower"));
40 jogador
.setPosition(game
->getSpawn().x
, game
->getSpawn().y
);
42 default: handleEvent(e
);break;
46 jogador
.game
->resize(e
.resize
.w
, e
.resize
.h
);