Tag Info

New answers tagged

1

Depending on which random number generator you are using, you should be able to specify a "salt" value. This enables you to generate the same series of gems every time (although they are still random). If you do it this way, you can then run the level lots of times and work out how many moves it should take.


2

A good algorithm to generate any kind of solvable puzzle is to first generate a solved configuration of the puzzle, and then backtrack a number of valid moves which would lead to this configuration. You can easily control the difficulty by how many moves you perform and you have a valid solution to it. However, keep in mind that there could always be a ...


0

It's not quite the same, but I implemented something similar at a game jam. The game had players moving on a small circular level, wrapped around when the player reached an 'x' position of pi. Rendering was easy because we just rendered everything and then rotated an offset camera to track what was going on. You could implement something similar, as has been ...


1

While it might not be ideal or the most performant option depending on your actual use case, you could just create a single "3d tile" that is actually bigger than your real tile (due to having the 3d part attached): While the tile size would be 32 × 32 pixels, this tile image is actually 40 × 40 pixels big (the fake depth is 8 pixels in every ...


0

I think the only reasonable approach would be to implement your wrapped world in an underlying data-structure completely transparent to the game and the user. So on some Low-Level you have a function mapCoordinate() which wrap your actual coordinates to your underlying map-resource... So if your actual World is only 10units wide, the player and the game ...


2

Disconnect the rendering from the world and you can do wraparound and correct rendering without resorting to any cloning or teleporting artifacts. First, in your world you have a fixed size world, from 0 to Width. Anytime an object goes below 0 you wrap it to the end, and anytime an object is over Width wrap it to the start. This means that all logical ...


6

Remember that what you display on screen, and what's in memory are two totally different things. Imagine you have a window that you need to fill with data about the world. You fill the window from left to right. While you're parsing your data to fill the world, if you reach the end of the world, simply loop back around to the beginning of your data. Using a ...


10

The canonical solution is to use portals. In your example, there is only one level, except there is a portal connecting the left and right ends. Anything moving across that portal will have its coordinates translated to the other end of the portal, so that if something is moving left through the portal, it will reappear on the right side of the level and ...


12

This system with all these triggers sounds a bit too complicated and error prone. You could wrap the position of the player using modulo with something like playerPositionX = playerPositionX % mapWidth This way when your player reaches playerPosition == mapWidth the playerPosition will reset back to 0. This solution could be extended with the whole ...



Top 50 recent answers are included