binaryeye [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=12505 Back Buffer Flashing? <p>I'm having trouble getting rid of a graphical glitch in a game I'm working on.</p> <p>When the player dies, the game state switches from the main gameplay screen to an intermediate screen that waits for a keypress before returning to the main gameplay screen. If that doesn't make sense, it's similar to Super Mario Bros.; when Mario dies, the main gameplay screen is replaced by a black screen that shows lives remaining, then after a short time returns to the main gameplay screen.</p> <p>The glitch happens at this return to the main gameplay screen. Before the first frame is drawn, the screen flashes with what appears to be the last frame drawn to the main gameplay screen before it changed to the intermediate screen. Is this the back buffer? It seems like it shouldn't be, because I'm drawing other stuff on the intermediate screen. Is there something else that could be saving the last frame drawn?</p> <p>I'm running at 60fps and using cls() at the beginning of each _draw() call. The draw operations for each game state are called from within _draw() based on the current game state.</p> <p>I found the following in the manual: &quot;If your program does not call flip before a frame is up, and a _draw() callback is not in progress, the current contents of the back buffer are copied to screen.&quot; Might this have something to do with it?</p> https://www.lexaloffle.com/bbs/?tid=32108 https://www.lexaloffle.com/bbs/?tid=32108 Tue, 23 Oct 2018 11:57:08 UTC Flipped Sprites in Maps <p>To allow more room for maps in my current project, I'm planning to use many of the sprites flipped to achieve more visual variety. While I can easily do this for sprites representing the player or enemies, I'm not sure how to implement it for the maps. I don't believe I can use the map() function, even with the flexibility of its layer flags option. I could of course store a table representing the map, with additional flags to indicate whether or not a cell should be flipped, and draw each individual sprite instead of using map(), but I'm worried this will be too slow and generally cumbersome.</p> <p>Is there a good way to go about this or am I stuck using no flipped sprites for maps? Or should I instead be looking at ways to compress the map data so I can use more room for sprites?</p> https://www.lexaloffle.com/bbs/?tid=3247 https://www.lexaloffle.com/bbs/?tid=3247 Tue, 19 Apr 2016 12:49:34 UTC