Angry cat behavior during play can become difficult to deal with if it's not nipped in the bud.
Little kittens will try to bite and scratch you when they play. When they're small, this doesn't hurt - in fact it can be quite amusing - and for this reason it's sometimes encouraged...
However, as kittens get older, their biting and scratching does start to hurt - a lot - but by that stage they've formed a habit.
If you have a kitten, don't let him bite and scratch you when he's playing. If he tries, firmly pick him up, say "NO" firmly (but don't shout or handle him roughly) and move him out of the way.
Don't give him any attention for about 5 minutes (maximum). It may be helpful to put him out of the room, if necessary locking him somewhere by himself so that he can't get any attention.
I stress that you should only do this for a short period of time - 5 minutes is long enough to teach him that he can't get away with this behavior, but short enough that it won't make him feel insecure and unloved (which could trigger more behavior problems).
If, when you give him attention again, he plays nice, really lavish attention and praise on him. But as soon as he starts biting and scratching again, it's back out of the room again... and so on.
This solution may sound mean, but as long as you make the "solitary confinement" phase short, it will solve the problem swiftly. It's better to be mean briefly than to endure years of an unhappy relationship with your cat, who keeps randomly attacking you and doesn't understand why you don't like it...
You can also try making a loud noise - for example rattling a tin of coins loudly. Keep doing this every time he attacks. He'll learn, hopefully quite quickly if he's young, that aggressive cat behavior won't get him the kind of attention he wants.
The same applies to adult cats that are attacking you during play. However, with adults, it will take longer to re-train them because they've been displaying this so-called angry cat behavior for longer. However the same "solitary confinement" rule applies - no more than 5 minutes.