Open planetixin opened 3 years ago
FillRect((fPlayerPosX - fOffsetX) nTileWidth, (fPlayerPosY - fOffsetY) nTileHeight, nTileWidth, nTileHeight, olc::GREEN);
Your rectangle width and height just need to be tileWidth and tileHeight, no need to multiply with position etc
Also when you load your sprite images in OnUserCreate one of them has a relative path and the other one has no path The sprites need to be in the same folder as your cpp file generally
now it's working path wasn't wrong but ox and oy was wrong. also I have some glitches on upper and left part of the screen
Send me messages on the discord please 👍🏼
On Tue, 17 Aug 2021 at 9:16 pm, planetixin @.***> wrote:
[image: obraz] https://user-images.githubusercontent.com/47472488/129716860-f8ecbfbe-a225-4d23-af46-e2d9ae0c6f5d.PNG
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OneLoneCoder/olcPixelGameEngine/issues/255#issuecomment-900208888, or unsubscribe https://github.com/notifications/unsubscribe-auth/APZQCXZNLR5O7W2Q7TOIBHLT5JAKRANCNFSM5CJLO55Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
I've followed the tutorial how to make tile-based platformed and for some reason sprites doesn't want to appear and also when I've changed the engine to olcPixelGameEngine.h the rectangle player changes its size based on its position. also there are some bugs with displaying on the left side of the screen. I don't know how to solve it
`#include
define OLC_PGE_APPLICATION
using namespace std;
include "olcPixelGameEngine.h"
class Platformer : public olc::PixelGameEngine { public: Platformer() { sAppName = "platformer"; }
private: wstring sLevel; int nLevelWidth; int nLevelHeight;
protected:
};
int main() { Platformer game; if (game.Construct(256, 200, 4, 4)) game.Start();
} `