• Advertisement
Sign in to follow this  

measure once, cut many times (?)

This topic is 4430 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've spent awhile trying to fix this, i just dont get it.
#include "Input.h"
#include "SDL.h"


void Input::HandleInput()
{
	if (SDL_PollEvent(&m_event))
		if(m_event.type == SDL_QUIT) QUIT = true;//checks for window closing
}

keystate = SDL_GetKeyState(NULL);

if(keystate[SDLK_RIGHT]){
	if(PADDLEx < 500){paddleVelx = PADDLE_VELOCITYx; return;}// CONDITIONAL MOVE RIGHT
}
else {paddleVelx = 0;}

if(keystate[SDLK_LEFT]){
	if(PADDLEx > 0){paddleVelx = -PADDLE_VELOCITYx; return;}//CONDITIONAL MOVE LEFT
}
else{paddleVelx = 0; return;}

.\Input.cpp(12) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\Input.cpp(12) : error C2440: 'initializing' : cannot convert from 'Uint8 *' to 'int'
        There is no context in which this conversion is possible
.\Input.cpp(14) : error C2059: syntax error : 'if'
.\Input.cpp(14) : error C2143: syntax error : missing ';' before '{'
.\Input.cpp(14) : error C2447: '{' : missing function header (old-style formal list?)
.\Input.cpp(17) : error C2059: syntax error : 'else'
.\Input.cpp(17) : error C2143: syntax error : missing ';' before '{'
.\Input.cpp(17) : error C2447: '{' : missing function header (old-style formal list?)
.\Input.cpp(19) : error C2059: syntax error : 'if'
.\Input.cpp(19) : error C2143: syntax error : missing ';' before '{'
.\Input.cpp(19) : error C2447: '{' : missing function header (old-style formal list?)
.\Input.cpp(22) : error C2059: syntax error : 'else'
.\Input.cpp(22) : error C2143: syntax error : missing ';' before '{'
.\Input.cpp(22) : error C2447: '{' : missing function header (old-style formal list?)

Share this post


Link to post
Share on other sites
Advertisement
You've got a bunch of code outside the function.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement