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"));
37 jogador
.setPosition(game
->getSpawn().x
, game
->getSpawn().y
);
43 game
->reloadMap(true);
49 game
->reloadMap(false);
51 default: handleEvent(e
); break;
55 game
->resize(e
.resize
.w
, e
.resize
.h
);