bimap到大的记忆
我正在用java编写一个类似于《Among us》的游戏(目前该游戏的重要部分是玩家只能看到大地图的一部分),而我绘制地图的方式是使用大几倍的位图比屏幕更大,我移动了地图的位置,但是位图对于内存来说太大了,有人有办法帮助我解决这个问题吗? 或者加载地图的不同想法?
I am coding a game in java similar to Among us (A game where the important part, for now, is that players see only part of a big map) and the way I was drawing the map is with a bitmap that is several times larger than the screen, and I move the position of the map around, but the bitmap is too large for the memory, does anyone have an idea to help me fix this?
or a different idea for loading the map?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Afaik,大多数地图UI(无论是使用真实地图还是游戏地图)都使用瓷砖系统,将地图分为瓷砖,根据需要加载和卸载。请参阅经典 view system 和 compose ui 。
而且,如果您正在开发游戏,请查看您的游戏框架是否提供某种地图解决方案。
AFAIK, most map UIs (whether with real maps or game maps) use a tile system, where the map is divided into tiles that get loaded and unloaded as needed. See Peter Laurence's libraries for the classic
View
system and Compose UI.And, if you are developing a game, see if your game framework offers some sort of map solution.