Advertisement
Kitomas

globals.hpp as of 2024-03-21

Mar 21st, 2024
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.27 KB | None | 0 0
  1. #ifndef _GLOBALS_HPP
  2. #define _GLOBALS_HPP
  3.  
  4. #include <kit/all.hpp>
  5. #include <kit/xmp_sfx.hpp>
  6.  
  7.  
  8.  
  9.  
  10. #define WINDOW_TITLE "platformer prototype"
  11. #define CANVSIZ_X 512
  12. #define CANVSIZ_Y 288
  13.  
  14.  
  15.  
  16. //gl_ as in global, not opengl
  17. extern kit::TimerSimple* gl_frameTimer;
  18. extern kit::SoundEngine* gl_snd;
  19. extern kit::Window*      gl_win;
  20. extern kit::BitmapFont*  gl_text;
  21. extern kit::FStr*       _gl_text_fstr;
  22. #define gl_textf(_x, _y, _fmt, _maxLen, ...) \
  23.     gl_text->print((_x), (_y), _gl_text_fstr->fmt(_fmt, __VA_ARGS__), (_maxLen))
  24. //
  25.  
  26.  
  27.  
  28. extern kit::Bitmap* gl_spritesheetPlayer;
  29.  
  30.  
  31.  
  32.  
  33. #define GRAVITY (0.0175f)
  34. #define PLAYER_JUMP_STRENGTH (2.0f)
  35. #define PLAYER_JUMP_CANCEL (0.33f) //multiplier of vel.y when canceling a jump while ascending
  36. #define PLAYER_SPEED (0.020f)
  37. #define PLAYER_SCALE (2.0f)
  38. #define PLAYER_HALF ( (s32)((8*PLAYER_SCALE)/2) ) //half of the character's size, in pixels
  39. #define PLAYER_NEUTRAL (0.1f) //'what +/- range should be considered neutral for vel/acc'
  40. #define PLAYER_AIR_FRICTION (0.5f) //multiplier for acc.x when in mid-air
  41. #define PLAYER_GND_FRICTION (1.0f) //multiplier of PLAYER_SPEED for on-ground deceleration
  42. #define PLAYER_RUN_MUL (0.075f) //vel.x's multiplier when adding to runningState
  43.  
  44.  
  45.  
  46.  
  47. #endif /* _GLOBALS_HPP */
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement