Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

player.cpp 741B

1234567891011121314151617181920212223242526272829303132
  1. #include "player.h"
  2. #include "debuggers.h"
  3. #include "olcPGEX_Sound.h"
  4. #include <iostream>
  5. namespace pabloader {
  6. Player::Player(Debuggers* game)
  7. : Programmer(game)
  8. {
  9. #ifdef _DEBUG
  10. DEBUG_COLOR = olc::BLUE;
  11. #endif
  12. }
  13. void Player::Think()
  14. {
  15. doJump = game->GetKey(olc::SPACE).bHeld;
  16. walkLeft = game->GetKey(olc::A).bHeld;
  17. walkRight = game->GetKey(olc::D).bHeld;
  18. moveDown = game->GetKey(olc::S).bHeld;
  19. #ifdef _DEBUG
  20. if (game->debug) {
  21. // game->DrawString(1, 19, std::to_string(x) + " " + std::to_string(y));
  22. // game->DrawString(1, 28, std::to_string(xv) + " " + std::to_string(yv));
  23. if (game->GetKey(olc::J).bPressed) {
  24. tile.x = (tile.x + 1) % tileDim.x;
  25. }
  26. }
  27. #endif
  28. }
  29. }