# Tag Info

19

In various Super Mario games, it's called a pit, abyss or bottomless pit. Bottomless Pit is also a TV trope.

8

The problem you are facing is that you can't simply "tint" the whole image, the appearance you see is more than just a base color. For one you have fine gradients from one one material to the other, but more importantly you also have reflections,highlights and shadows, which are not influenced by the base color. (Those are basically added on top of it.) So ...

6

I'll answer with a story about me. Projector sheets You know those ancient projectors that come with transparent sheets? When I was in primary school, I discovered you could draw a character's torso on one transparent sheet... ... and then take out another sheet, lay it on top of that, and draw arm with a gun on it ... ... and then rotate the top ...

4

For a 2D grid, like in the image you posted. While probably not the most efficient in terms of speed and memory usage, I find that a brute force approach could still be useful, since it's easy to get it started. Especially if this is not to be used in places with time or memory constraints. //Get some random cells for countries to start extending from. for ...

4

Here is the general algorithm that could be used to achieve a similar result: Let N be the number of countries you wish to have Randomly pick N^2 points on the 2D plain. Create the Voronoi diagram to split the plain into N^2 cells. Use Union Find between 2 random neighboring cells (that are on disjoint sets) N*(N-1) times Use the newly created trees of ...

4

Several things you could try : Subdivide your main ship bounding box into smaller bounding boxes . You can keep the main bounding box as it is now, then if collision is detected, perform additional tests using custom boxes (see picture). You can probably use Rect class and Intersect() method to implement this. While not being perfect it will still be a ...

4

First, while MMOs usually have a lot of players online at any one time, these players usually concentrate on key-areas. There are usually large parts of the world where no players are present most of the time. That means you can still use chunks and not keep those in memory which have no players near them. When you have some NPCs which need to perform some ...

3

you can do the simple scaling trick. yea too lazy to explain, just look at the image and ask if you don't understand In this example I just scaled by a factor of 2. Higher values give longer shadows.

3

Calculating the trajectory of a projectile can be done in two ways: analytically and numerically. Analytical calculation is where you integrate position with respect to time and get equations such as x = x_0 + vt + ½at^2. You can use these equations to solve for time of impact, distance traveled, maximum height, etc. or just find the displacement at any ...

3

As you state, the best choice is to approximate, in this case using a numerical scheme. Divide time into large timesteps (say 100-300ms), and use the parabolic approximation for each timestep. The forces are the same throughout except air resistance. The parabolic path is basically for constant acceleration, but with air resistance the acceleration changes ...

3

Yay! I did it! I'm using simple simulation that takes the first position to cross the horizontal axis of the target point - from there, I take the previous simulated position and make a segment. Now I check whether the target point is below this segment. If it is - we can jump there. It's a player-controlled character on the gif. Pink is the predicted ...

3

I would personally recommend using mask textures to achieve what you want. This will ensure that your main RGB24 texture will keep its original colour quality without sacrificing any precision. It will also give you plenty of artistic freedom to blend your main texture with your colour mask. Each mask can be viewed as a grayscale texture that will linearly ...

3

I think you are stuck on trying to implement utterly dissimilar powerups using a unified system. That seems like a mistake, and it might become obvious if you thought about the idea of multiple balls outside the context of a power-up: multiple balls are simply more instances of a Ball object. Handling multiple balls in code would not require a ...

3

I dont know if you have seen this but i found this very usefull http://forum.unity3d.com/threads/212172-Animator-state-machine-for-top-down-2d-games-with-non-rotational-sprite-animation From a Unity dev: One way to go about this is to have 2D blendtree for each movement (example: idle, walk, run, ...) The unity dev explains further: Even though ...

2

you can use color palettes and let the player edit the palette. If you use shaders, you can use 1D textures as palettes and the original gray value as index. To convert a true color image into an image with 255 colors, you can take all your pixel color values and group them in the 3d color space to 255 clusters with the k-means algorithm. Or use generic ...

2

You might want to "just calculate" the answer but I'm sure that you'll find it insufficient once you've got it because of the highly interactive nature of your "free fall" physics. Consider using a different approach: Searching. Here is how it's done for Super Mario AI: http://aigamedev.com/open/interview/mario-ai/ Searching possible pathes to get from A ...

2

The numbers define a triangle: Giving the x and y coordinates in order like ((X,Y),(X,Y),(X,Y)). Might be easier to understand if you wrote the code like this: poly.getPoints().setAll( 14d, 17d, 26d, 17d, 20d, 27d); When in doubt you can always check the documentation. Creates a polygon, defined by an array of x,y coordinates.

2

As lealand raised "width" and "height" are somewhat vague terms. Here is a straightforward approach to finding the width and height of the AABB: double minX = Double.MAX_VALUE; double maxX = -Double.MAX_VALUE; double minY = Double.MAX_VALUE; double maxY = -Double.MAX_VALUE; double[] points = poly.getPoints().toArray(); for(int i = 0; i < ...

2

Let's boil this down to dependencies. Now the first thing is first, how do you render something? Well the logical manner tells us that we need some asset which will be loaded and then displayed. Assets: Sprite Sound Music Now how to you get these assets into your program? You typically will have some sort of Asset Manager who's responsibility is to ...

2

I see two things suspect with your code: You should not be calling transform.Translate() to move a projectile - it's possible that you'll translate it right over its target! Instead, attach a rigidbody component, turn off gravity, and set the velocity. If the velocity is high enough, you may also need to set the collision mode to 'continuous'. This code ...

2

It depends if you want realistic physics or not. If realistic then like Garan said. If not, and you want it to bounce exactly as it was and in the same speed: Give the ball a 2D collider, and the wall a 2D collider. Make them both triggers. In OnTriggerEnter2D(Collider2D collider) inside the ball script, bounce the ball manually. Reverse the horizontal ...

2

Prepare your polygon Set up your polygon as a directed sequence of points / lines. This is described in any point-in-polygon test, for which there are countless resources online and on Stackoverflow / Stackexchange, so I won't repeat here. Prepare your map for querying Assign every grid square a unique ID. Construct a list of all unique vertices ...

2

I think this could be solved using render targets. I propose the following technique Create two render targets, one for the colors in the scene and one for the lighting in your scene colorMap = new RenderTarget2D(GraphicsDevice, windowWidth, windowHeight, false, SurfaceFormat.Color, DepthFormat.Depth16, 16, RenderTargetUsage.DiscardContents); lightMap = ...

2

I did this successfully by rotating the sprite to 90 degrees on the Y-axis, then changing the sprite texture and finally rotating it back again. while(turningCard) { transform.rotation = Quaternion.Slerp(startRotation, endRotation, rotateTime); if (CheckIfAngleBigEnough()) { ChangeSprite(); ChangeRotationDirection(); } ...

2

Technically you could do a new scene for each level, but I highly recommend the other approach of one scene that simply places objects based on data in an XML file. Separate scenes in Unity are intended for loading/unloading graphics and code when each level is significantly different, but if each level is pretty much the same objects just with the objects ...

1

I've implemented a similar method in the past, and it can be quite tricky to get it right. The best resource I've seen is on Amit Patel's fantastic site: http://www.redblobgames.com/articles/visibility/ There are quite detailed explanations of each step, lots of good demos, and some code samples. To briefly answer your question directly, the "polygon ...

1

As hinted by user concept3d, it is difficult to help you without further details about your implementation approach. I'm going to give it a shot nevertheless, but that means that I have to make some assumptions that may or may not be true for your code. In any event, I hope that the following is general enough that you can adapt it if necessary. The first ...

1

At the moment, you seem to be changing only the view (what objects look like), rather than the model (what their state is). (I'm using the MVC terms.) How about this for a model: It's a grid of hotspots. Now, when the mouse is pressed, you could set the closest point on the grid to a true value. The percentage cleaned would then be the ratio of true ...

1

The picture you posted seems to be seen from a 45° angle. This perspective is sometimes informally called "bird view". More formally, it is usually referred to as orthogonal, dimetric projection. Orthogonal means that all the world-axis are all parallel to a screen-axis (world-x is parallel to screen-x, world-y and world-z are parallel to screen-y). Dimetric ...

1

So the problem was the culling, I recommend to debug your code while turning off the culling with D3D11_CULL_NONE flag in the rasterizer if your geometry does not get displayed, this is quite a common problem for beginners. And be sure to cull the backfaces in a release application wherever you can.

Only top voted, non community-wiki answers of a minimum length are eligible