tile

C++ SDL2 how to color individual tiles

心已入冬 提交于 2021-02-10 16:29:25
问题 I'm learning C++ and SDL2 by programming a classic roguelike . Right now I build the map by rendering part of a tiles.png image like this one: I followed lazyfoo's tiling tutorial and it works, but I would like to be able to change each tile background and foreground colors. I can change the full texture colors doing something like this other tutorial, but what if I want, say, a brown door somewhere and a gray one somewhere else? What's the best approach here? Obviously I can't have hundreds

C++ SDL2 how to color individual tiles

亡梦爱人 提交于 2021-02-10 16:28:59
问题 I'm learning C++ and SDL2 by programming a classic roguelike . Right now I build the map by rendering part of a tiles.png image like this one: I followed lazyfoo's tiling tutorial and it works, but I would like to be able to change each tile background and foreground colors. I can change the full texture colors doing something like this other tutorial, but what if I want, say, a brown door somewhere and a gray one somewhere else? What's the best approach here? Obviously I can't have hundreds

Converting from world coordinates to tile location

心不动则不痛 提交于 2021-01-29 22:34:59
问题 me and a friend are trying to build an android app for class that uses google maps and we have been spending days on this one error. Ideally the app receives updates of the user's location, stores them, and paints over any stored coordinate. That turned out to be a nightmare to implement so right now we're just trying to paint over the entire tile if that tile contains a coordinate that the user has visited. However we think something's wrong with our conversion from coordinate to tile

libGDX change tilemap

半腔热情 提交于 2021-01-28 12:10:41
问题 I am making an 2d rpg game with box2d. So, I've got a problem. When one of my bodies(the character) collides with another(a door) the map needs to change, should I just create new screens for maps and change them? Or is there a more simple solution? 回答1: You can change your current map on the same screen only. What you have to do is, Let's say your map variable name is testMap . Now let's say your player just collided with a door. Now let's say you will call a method called changeMap() . Here

How to join two images into one with FFmpeg? [duplicate]

╄→尐↘猪︶ㄣ 提交于 2020-06-10 04:00:28
问题 This question already has answers here : Vertically or horizontally stack (mosaic) several videos using ffmpeg? (3 answers) Closed 2 years ago . There are two images: a.jpg and b.jpg . I just want to know how to join them into one image using ffmpeg . How should I finish the ffmpeg -i a.jpg -i b.jpg command to get a c.jpg output image? This is an example of what I am trying to achieve: a.jpg b.jpg c.jpg 回答1: I think that tile is your ffmpeg command. You can find more info on Superuser. Try:

How can you stitch multiple heightmaps together to remove seams?

僤鯓⒐⒋嵵緔 提交于 2020-02-06 00:49:20
问题 I am trying to write an algorithm (in c#) that will stitch two or more unrelated heightmaps together so there is no visible seam between the maps. Basically I want to mimic the functionality found on this page : http://www.bundysoft.com/wiki/doku.php?id=tutorials:l3dt:stitching_heightmaps (You can just look at the pictures to get the gist of what I'm talking about) I also want to be able to take a single heightmap and alter it so it can be tiled, in order to create an endless world (All of

How can you stitch multiple heightmaps together to remove seams?

蓝咒 提交于 2020-02-06 00:49:15
问题 I am trying to write an algorithm (in c#) that will stitch two or more unrelated heightmaps together so there is no visible seam between the maps. Basically I want to mimic the functionality found on this page : http://www.bundysoft.com/wiki/doku.php?id=tutorials:l3dt:stitching_heightmaps (You can just look at the pictures to get the gist of what I'm talking about) I also want to be able to take a single heightmap and alter it so it can be tiled, in order to create an endless world (All of

A* Algorithm 2D Game Pathing issues

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-24 11:22:06
问题 I have decided to pick up my old 2D game engine from back in the day and continue work on it This is my first attempt at trying to implement some basic AI for enemies and I am having some issues. Here is a run down on how I am treating the AI for enemies. If the player is within a certain range of the enemy, the enemy moves towards the player by just checking to see if he is up or down, left or right of the player and adjusting it's Coordinates accordingly. If the enemy hits an obstacle that