New answers tagged

0

Why not use colliders and tags. When an enemy trigger/collider detects a player trigger/collider tagged say "Player kick" (child game object of the player) then that enemy executes his reaction with OnTriggerEnter(2D)/OnCollisionEnter(2D). Player just needs to enable and then disable its kick game object when kick is pressed. The most important thing is ...


0

Your stack error comes from the fact that 'AdView' is a type, not an instance. For example, let's say you have the following class: package simulator; import java.awt.Color; public class Dog { public Color coatColor; public static boolean mans_best_friend; } because all dogs are man's best friend, the statement Dog.mans_best_friend = true; is a ...


0

There's a couple of ways you could go about such a system, as with anything. I'll try to describe the core of one such system in a pretty general sense here: An animation consists of AnimationFrames. An animation frame contains a bunch of data. struct AnimationFrame { //The graphic for this frame Sprite * sprite; //Duration (for example, ...


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

This link looks interesting and provides almost that what I need, maybe it can help somebody too http://forum.unity3d.com/threads/animfollow-active-ragdoll-is-now-free-to-download.220812/


6

"Manager" classes can be problematic for various reasons. The two key reasons tend to be: the name is unclear (what actually does "management" entail, and is it always the same for every type of thing being managed?) they tend towards being buckets of functionality that violate the single responsibility principle (that is, that a type should do one thing) ...


5

When you read the blog post you linked to in the comments, then you will see that "being a Manager if by another name" is exactly what it wants you do to. It's general consensus in software development that global variables are evil, and the only alternative is that any data is held by other data. The problem with a class named FoobarManager is that the ...



Top 50 recent answers are included