Search code examples
pythongame-enginepyxel

Pyxel rotating image


I am using Pyxel to create a small 2d game, I am very new to game programming.

As far as I can see, there is a pyxel.blt that is a blit, it draws an image on the screen, now this image can be moved changing the X and Y but how would I rotate the image if I can only move it up/down/left/right? Am i missing something here?

What I want is to rotate the image around it's origin.


Solution

  • There is no actually a rotation.

    But some people draw few versions of game character (like player turn to left as one image, turn to right it’s another image, up down same). PyXel engine admit only 256x256 as I remember so You may draw many positions for many characters.

    If not enough space there a ways to cheat PyXel by loading another draw-map in the already used index.

    As well You may use not a drawn models of character, but line drawing. Look at this game. Here developer draw just a lines and use math and many formulas to achieve vision like rotation. But I think it’s pretty hard. Anyway good luck!