Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Player.h"
- Player::Player(const LoaderParams* pParams) :
- SDLGameObject(pParams)
- {
- }
- void Player::draw(SDL_Renderer* pRenderer)
- {
- SDLGameObject::draw(pRenderer);
- }
- void Player::update()
- {
- m_velocity.setX(0);
- m_velocity.setY(0);
- handleInput();
- m_currentFrame = int (((SDL_GetTicks() / 100) % 6));
- SDLGameObject::update();
- if(TheInputHandler::Instance()->xvalue(0, 1) > 0 ||
- TheInputHandler::Instance()->xvalue(0, 1) < 0)
- {
- m_velocity.setX(1 * TheInputHandler::Instance()->xvalue(0, 1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement