要闻速览:
\n\n我的问题:
\n\n我没有创建 Pok\xc3\xa9mon。我的精灵大小为 60x20 像素,但我只希望底部 20x20 像素(我的脚)作为碰撞区域。
\n\n现在,拿一棵树,其底部为 20x20 像素,无法行走:
\n\n当我从底部过来时,我希望脚上方 40 像素显示在树的前面。这意味着底部前方 20 像素,实际树木前方上方 20 像素。但是,当我站在树底部上方时,我希望我的玩家完全被树后面覆盖。
\n\n当我在没有 LibGDX 的情况下进行编程时(对于桌面,低端低端),我只是首先渲染我位置上方的所有像素,然后检查是否有任何项目位于我上方/下方,然后渲染其他所有内容。
\n\n现在,我不知道当我使用OrthogonalTileMapRenderer.
我正在尝试使用 Tiled 创建一个平台游戏来创建我的地图。我制作了地图并将其导出为 .json 对象。我可以让地图出现在我的游戏中,但是我的精灵掉进了我的地板。
我已经学习了几个小时的教程,似乎在阳光下尝试了一切,但没有运气。我什至在 Tiled 中创建了一个新的“碰撞”层。这是我所有的相关代码:
JSON:
{ "height":20,
"layers":[
{
"data":[491, 492, 493, 494, 495, 496, 497, 498, 499, 491, 492, 493, 494, 495, 496, 497, 498, 499, 491, 492, 493, 494, 495, 496, 497, 526, 527, 528, 529, 530, 531, 532, 533, 534, 526, 527, 528, 529, 530, 531, 532, 533, 534, 526, 527, 528, 529, 530, 531, 532, 561, 562, 563, 564, 565, 566, 567, 568, 569, 561, 562, 563, 564, 565, 566, 567, 568, …Run Code Online (Sandbox Code Playgroud) 我正在为我的游戏使用移相器,并且使用具有数据数组的JSON文件,游戏正在运行,但是当我导出我在Tiled上制作的自定义地图时,数据就像这样出来了:
"compression":"zlib", "data":"eJxjYBgF9AZ5QJwPxAVUNLMOiOuBuIGKZvYBcT8QT6CimaNgFIyCUUBPAACmvgR4",
"encoding":"base64",
Run Code Online (Sandbox Code Playgroud)
我希望它就像这样:
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
Run Code Online (Sandbox Code Playgroud)
我不知道为什么它这样的导出,它是我使用的工作JSON文件和我所做的唯一不同的东西.
我正在为我的游戏使用平铺地图编辑器,我用 C++ 编程,在我使用原始 XML .tmx 文件(没有 base64 和 zlib 压缩)为我的关卡实现加载方法之后,我想现在用 base64 来做。
这是我的问题/问题:平铺地图编辑器如何转换这样的数据结构:
<tile gid="25"/>
<tile gid="25"/>
<tile gid="25"/>
<tile gid="25"/>
<tile gid="25"/>
Run Code Online (Sandbox Code Playgroud)
到像这样的 base64 编码字符串:
GQAAABkAAAAZAAAAGQAAABkAAAA=
Run Code Online (Sandbox Code Playgroud)
?
我想我需要了解这一点,以便为此实施加载方法。我想知道如何知道另一个磁贴的 ID 开始的位置以及为什么编码字符串与我将 ID 复制到https://www.base64encode.org/时得到的字符串不匹配。
我正在使用SKTilemapNode。如何在GameplayKit中正确使用寻路?
一些信息:墙壁都是瓷砖,没有瓷砖是“路”
我知道这个问题对那些熟悉平铺和单一游戏的人来说非常具体,所以我会尽量做到尽可能彻底.我已经在这个问题上工作了15个多小时,我很绝望.
我正在尝试使用Tiled的对象层将精灵绘制到屏幕上.我已经创建了一个新的对象图层,为它绘制了一些矩形,并添加了一个我在LoadContent方法中引用的自定义属性.
这是我的LoadContent方法:
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
mymap = Content.Load<TiledMap>("Misc/newmap");
enemyShip = Content.Load<Texture2D>("Enemies/enemyship");
//TiledMapObject[] islands = mymap.GetLayer<TiledMapObjectLayer>("Islands").Objects;
ship_sprite = Content.Load<Texture2D>("character/wooden_ship");
Texture2D texture = Content.Load<Texture2D>("character/anima2");
animatedSprite = new AnimatedSprite(texture, 1, 2);
font = Content.Load<SpriteFont>("Misc/londrinasolid");
Song song = Content.Load<Song>("Music/Chad_Crouch_-_Stellars_Jay");
MediaPlayer.Volume = 0.7F;
MediaPlayer.Play(song);
TiledMapObject[] littleBoats = mymap.GetLayer<TiledMapObjectLayer>("SmallBoats").Objects;
foreach (var en in littleBoats)
{
string type;
en.Properties.TryGetValue("type", out type);
if (type == "smallboat")
{
Enemy.enemies.Add(new SmallBoat(en.Position)); …Run Code Online (Sandbox Code Playgroud) tiled ×6
2d-games ×1
base64 ×1
c# ×1
dictionary ×1
editor ×1
encoding ×1
game-physics ×1
json ×1
libgdx ×1
monogame ×1
path-finding ×1
rendering ×1
sprite ×1
sprite-kit ×1
swift ×1
xna ×1