Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(GetKeyboard()->IsPressed(Keyboard::Up))
- SetVelocity(Vector2D(0,20));
- else if(GetKeyboard()->IsPressed(Keyboard::Down))
- SetVelocity(Vector2D(0,-20));
- else if(GetKeyboard()->IsPressed(Keyboard::Left))
- SetVelocity(Vector2D(-20,0));
- else if(GetKeyboard()->IsPressed(Keyboard::Right))
- SetVelocity(Vector2D(20,0));
- else if(GetKeyboard()->IsPressed(Keyboard::Up) && GetKeyboard()->IsPressed(Keyboard::Left))
- SetVelocity(Vector2D(-20,20));
- else if(GetKeyboard()->IsPressed(Keyboard::Up) && GetKeyboard()->IsPressed(Keyboard::Right))
- SetVelocity(Vector2D(20,20));
- else if(GetKeyboard()->IsPressed(Keyboard::Down) && GetKeyboard()->IsPressed(Keyboard::Left))
- SetVelocity(Vector2D(-20,-20));
- else if(GetKeyboard()->IsPressed(Keyboard::Down) && GetKeyboard()->IsPressed(Keyboard::Right))
- SetVelocity(Vector2D(20,-20));
- else
- SetVelocity(Vector2D(0,0));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement