BenEklundCS / The-Land-of-Boars

A platformer game in C++ and Raylib!
1 stars 0 forks source link

Scale Game Objects to "any" screen size #14

Closed BenEklundCS closed 3 weeks ago

BenEklundCS commented 3 weeks ago

Game Object sizes should be based on the scale of the Window.

A few routes are available:

  1. Scale every object as they are rendered in a loop
    • not my favorite, requires adding methods to all objects for updating state that up until now has been fairly self-contained
  2. Add a global scaling factor variable
    • This seems more promising, globals can cause problems... but this one seems reasonable. SCALE_FACTOR_X/Y would allow me to multiply the size of an object by the scale factor. This allows me to base scaling on the fact I've developed the current object sizes on 2560x1440p.
BenEklundCS commented 3 weeks ago

https://github.com/BenEklundCS/The-Land-of-Boars/commit/54b9dbeb87fa5ef14923aa89829e3e82a1c2cf00