Hot answers tagged

6

It shouldn't have any impact. You should not be implementing zoom by scaling or otherwise messing with 'the Z factor' (whatever that is) of your objects in the world. You should be implementing zoom by adjusting properties of the camera and projection (field of view, camera position). The camera and projection properties only come into play when you ...


3

A rational approach might be to simplify your problem. This is a game, so most of the time there is no need for 100% accurate physics. Instead of tracking every single component that makes your ship, you can instead prepare several damaged ship models and swap then on the fly as it gets more and more damage. When you swap the models, you could spawn some ...


2

Generally game mechanics should not behave differently depending on whether or not the player observes the event. The player expects that the game mechanics outside of their field of view behave exactly as those inside their field of view. It is very immersion-breaking when they leave an area, enter it again shortly afterwards and apparently in the mean-time ...


1

One approach to a multilayered map would be an array (or 2-dimensional array) of linked lists or vectors holding tile objects. So your tile struct would either hold a pointer to the next tile above it, or you would have "stacks" of tiles of varying heights spread across the grid. Essentially that creates a 3D array. A nice, albeit old article on ...


1

You might have some success checking the Collider2D.IsTouching method in your OnTriggerEnter. void OnTriggerEnter2D(Collider2D col) { if (weaponCollider.IsTouching(col)) { /* Weapon */ } if (sightCollider.IsTouching(col)) { /* Sight */ } } IsTouching is polled against the last physics update so it should be pretty light weight. However, if your ...


1

The algorithm you are using right now has a runtime of O( n^2 ). A tree structures can help you get that runtime lowered. Quadtrees have O( log(n) ) From that you can calculate if you will benefit from a quadtree.


1

Set the new Physics Material on the object you are colliding with. Make sure you set the friction to 0. http://docs.unity3d.com/Manual/class-PhysicMaterial.html


1

In Alto's Adventure, the terrain is dynamically generated over time, by concatenating prefabricated patterns (for example the super steep slope where you can perform a triple backflip, or any other soft slopes) in a randomic way to keep the game various from play to play. A possible implementation can be treating these "pieces" of terrain as vertices, from ...


1

Almost everything happens in the game loop somewhere, so that distinction is a bit moot. What you seem to be asking is "when you change the position of an object, do you check for collision there, or do you check for collision later." It depends on the specific needs of your game, but in general it's probably better to do the calculation later. Code that ...



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