Trabajando en las colisiones con los enemigos
This commit is contained in:
@@ -8,7 +8,7 @@ Input::Input(std::string file)
|
||||
dbPath = file;
|
||||
|
||||
// Inicializa las variables
|
||||
for (int i = 0; i < 17; i++)
|
||||
for (int i = 0; i < 17; ++i)
|
||||
{
|
||||
keyBindings[i].scancode = 0;
|
||||
keyBindings[i].active = false;
|
||||
@@ -23,7 +23,7 @@ Input::Input(std::string file)
|
||||
// Destructor
|
||||
Input::~Input()
|
||||
{
|
||||
for (int i = 0; i < numGamepads; i++)
|
||||
for (int i = 0; i < numGamepads; ++i)
|
||||
connectedControllers[i] = nullptr;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ bool Input::checkAnyInput(int device, int index)
|
||||
{
|
||||
const Uint8 *mKeystates = SDL_GetKeyboardState(NULL);
|
||||
|
||||
for (int i = 0; i < 17; i++)
|
||||
for (int i = 0; i < 17; ++i)
|
||||
{
|
||||
if (mKeystates[keyBindings[i].scancode] != 0)
|
||||
{
|
||||
@@ -155,7 +155,7 @@ bool Input::checkAnyInput(int device, int index)
|
||||
if (gameControllerFound())
|
||||
if ((device == INPUT_USE_GAMECONTROLLER) || (device == INPUT_USE_ANY))
|
||||
{
|
||||
for (int i = 0; i < 17; i++)
|
||||
for (int i = 0; i < 17; ++i)
|
||||
{
|
||||
if (SDL_GameControllerGetButton(connectedControllers[index], gameControllerBindings[i].button) != 0)
|
||||
{
|
||||
@@ -182,7 +182,7 @@ bool Input::discoverGameController()
|
||||
numGamepads = 0;
|
||||
|
||||
// Cuenta el numero de mandos
|
||||
for (int i = 0; i < nJoysticks; i++)
|
||||
for (int i = 0; i < nJoysticks; ++i)
|
||||
if (SDL_IsGameController(i))
|
||||
numGamepads++;
|
||||
|
||||
@@ -193,7 +193,7 @@ bool Input::discoverGameController()
|
||||
{
|
||||
found = true;
|
||||
|
||||
for (int i = 0; i < numGamepads; i++)
|
||||
for (int i = 0; i < numGamepads; ++i)
|
||||
{
|
||||
// Abre el mando y lo añade a la lista
|
||||
SDL_GameController *pad = SDL_GameControllerOpen(i);
|
||||
|
||||
Reference in New Issue
Block a user