【发布时间】:2015-09-09 12:30:00
【问题描述】:
我正在尝试为我正在使用 slick 类的平铺地图制作的游戏渲染地图,但我在理解参数 x 和 y 之间的区别时遇到了很多麻烦。以下是谷歌搜索的解释,但我不明白它
public void render(int x,
int y,
int sx,
int sy,
int width,
int height)
Render a section of the tile map
Parameters:
x - The x location to render at
y - The y location to render at
sx - The x tile location to start rendering
sy - The y tile location to start rendering
width - The width of the section to render (in tiles)
height - The height of the secton to render (in tiles)
我的游戏由一辆汽车和一个锁定在其上的摄像头组成,该摄像头将在地图上跟随汽车四处走动。随着汽车的移动,地图开始渲染。有人可以解释一下 x 和 y 以及 sx 和 sy 如何适用于此。
【问题讨论】: