Hot answers tagged

5

I haven't worked through the full equations for this yet, but here's some visuals to help wrap our heads around the problem. It boils down to some geometry: (Car icons via Kenney) From any given starting point and orientation, we can draw two circles with our minimum turning radius - one on the left, one on the right. These describe the points on the ...


2

You could use a hashtable with a key which consists of both the x-coordinate and y-coordinate. Finding the tile at a specific coordinate is then a constant-time operation. When you want to cache the "outline", you could store it in another hashtable. Whenever a node is added, follow this algorithm: the new node is removed from the "outline" hashtable for ...


2

A lot of great stuff covered in the other answers. Here's my take on (the perception of) win/loss probabilities. In the case of PvP, consider different ways to track & show win loss scores either directly or in some sort of cooked format (I.E. player rank). Specific examples: Puzzle Pirates ranks player performance relative to all of the other players ...


2

I would create a box and spawn object inside it. Or if your road is windy you can use multiple boxes or some other shape. Here is some code: using UnityEngine; using System.Collections; /// <summary> /// Spawns a prefab randomly throughout the volume of a Unity transform. Attach to a Unity cube to visually scale or rotate. For best results disable ...


2

The theory will tell that you're likely to get less cache misses (so 'more efficiency' w.r.t. response time) if your objects are close one to another in memory. This means that if you use an array, and your objects are contiguous, and you access each of them in a in-memory-sequential fashion, it will be more efficient than if you hop from here to there and ...


1

A first aproach could be giving a varying weight to each type of block, modifying such weight each level, decressing the probability of spawning an easy blocks and increasing the probability to spawn a harder ones. I'm also going to suppose you have some kind of a parent Block class and different child classes for each type of block. public Block ...


1

This very much depends on the rest of your data model for the navigation. Ie. what data you have handy, what you can easily add data and how you consume it. Taking a similar scenario from a traffic system at water, and with the assumtion that you are in a game loop you have a node path system your cars behave like an autonomous objects that control ...



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