Random reigns supreme

Being able to pull and effectively use random numbers is another game development essential. With random numbers, you can make sure every card deal is different, like you've just done with your Robot Repair game. You can make enemies behave unpredictably, making it seem as though they're acting intelligently (without having to bother with complicated Artificial Intelligence programming! See Chapter 12, Game #5 –Kisses 'n' Hugs, for more on this technique.) You can make spaceships attack from surprising angles. You can build an avatar system with a Shuffle button that randomly dresses up your player's character.

The best game developers use random numbers to make their games meatier, more visually appealing, and more fun! The ...

Get Unity 4.x Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.