阅读背景:

如何使用c ++在SFML中正确生成随机地形

来源:互联网 

Recently I've been trying to develop a 2D Terraria style game using SFML and c++. Everything has been working perfectly expect for the random terrain generation. Currently, I have a for loop that assigns the position and texture to an array of sprites (ex:int grass[150]) which are then drawn to the screen using a for loop. The terrain generates and looks okay but, the multiple arrays of sprites are being drawn to the screen every time my program loops. This is causing some serious performance issues, because currently around 1400 sprites (only a fraction of number of the amount I want when the game is finished) are being drawn every time my program loops.Recently I've been trying to develop a 2D Terra




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: