Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Hi, I was wondering if it is possible to flip both the X and Y axis of a tile in GBDK. I've found that set_sprite_prop(0,S_FLIPX); works except adding both
set_sprite_prop(0,S_FLIPX);
set_sprite_prop(0,S_FLIPY);
next to each other flips the tile on the Y axis and then occasionally reverting the Y flip and flipping the X axis. The ability to flip both axis is crucial for my game and I would loathe to have to make multiple tiles.
Offline
Try set_sprite_prop(0,S_FLIPX|S_FLIPY);
| is the logical "or" operator which will combine any bits that are set to one in the two numbers you give to it. For these constants, individual bits are used to turn features on or off. What you did will overwrite the old value and only flip the sprite in the Y direction.
00100000 S_FLIPX | 01000000 S_FLIPY ------------------- 01100000 Result
Offline
Awesome that worked! Thanks!
Offline