There are many ways to attack for both zombies and survivors. Most zombies can only attack up close, but can also have ranged attacks too, whereas survivors can usually wield weapons, throw grenades, and only tend to use hand-to-hand combat as a last resort.
Direct attacks are attacks that are directed at someone or something with the intent to harm them/it.
A melee attack is any attack that is extremely close range, or hand-to-hand combat. They are usually always countered with ranged attacks, but are usually unlimited, whereas ranged attacks are usually limited. Melee attacks from behind usually kill a zombie instantly (assassination or take-down) and can infect survivors (who are not immune) instantly, regardless of being on the front or back. Melee range is usually within 6 feet, rarely 10 feet.
Melee Attack Examples
Nearly every zombie has a melee attack; zombies usually only have melee attacks. They can be used to damage survivors (claw, charge) or infect them (bite). In the Last Of Us, being bitten infects you can results in a game over, but being clawed only damages you. In films like Zombieland, the zombies tend to only bite as an attack to instantly infect you. Survivors on the other hand, tend not to use melee attacks unless they're suicidal or using it as a last resort. Survivors tend to use weapons instead of claws or fists (frying pans, baseball bats, shovels etc.) due to the risk of the zombie biting their hand.
A ranged attack is an attack that can be performed from a distance from the target. They can easily counter almost any other type of attack. Ranged attacks usually fall into 3 categories - Short Range, Medium Range, and Long Range. Long ranged weapons are weapons like hunting and sniper rifles. Range is usually anywhere contact with the muzzle of the weapon to half a mile with conventional guns and rifles. You can have higher ranges, but that is hard for an average survivor to obtain.
Ranged Attack Examples
In most zombie stories, ranged attacks are favored solely by survivors, and are usually firearms. But there can be other ranged attacks against zombies, such as grenades and Molotov cocktails, and throwing other items in desperation (like a chair, or a tv). On the other hand, zombies don't really use ranged attacks, but there are a few exceptions where the zombies can use firearms, like in the film Fast Zombies With Guns. Zombies can also use biological ranged attacks instead of tools, such as vomiting to infect or burn survivors alive, or leaking other liquids from themselves in order to roast a survivor. Zombies intentionally vomit into the face of the prey in 28 Days Later and Floaters do too in Dead Island. Zombies can infect you at a distance just by standing near you and breathing at you.
A suicidal attack is an attack where the zombie (or survivor) attacks someone suicidally, taking their own life in the process. It is usually an explosion, but not always. Survivors only tend to perform a suicidal attack if they're insane, have been bitten and take some zombies down with them, or want to sacrifice themselves for the rest of the survivor team. Zombies will perform the majority of suicidal attacks, usually they will take survivors by surprise. It does not count as a suicidal attack if the zombie/survivor is killed by the opposing team instead of killing themselves. Suicidal attacks aren't always direct attacks, and some can be indirect, harming anything in the immediate vicinity.
Suicidal Attack Examples
In the game Plants Vs. Zombies, the Jack-In-The-Box Zombie and Super-Fan Imp both explode nearby plants as a suicidal attack. The Flood Carrier Form from the Halo franchise infects prey by exploding near them. For survivors, they don't tend to suicidal attack the zombies until the last resort. In many zombie stories, survivors have run into battle wielding melee weapons and eventually dying at the hands of the zombies, and that's as near to a suicidal attack you get from survivors.
Indirect attacks are attacks that can affect anything in the immediate vicinity.
Passive attacks are attacks that cover an area of effect and are usually ranged. They can never be directed at someone/something and harms them if they are in the area of effect. If a zombie performs and area of effect attack, it damages the survivors, and sometimes the other zombies too. They can be effected by their own area of effect attack too.
Passive Attack Examples
Survivors can throw grenades and Molotov cocktails into a crowd of zombies to destroy them all as sort of a passive attack, like in Resident Evil. The zombies may be attracted if it is a pipe bomb such as in Left 4 Dead. In Left 4 Dead, the spitter character's spit is an area of effect because it harms survivors as long as they're stood in it. Traps such as pitfalls and landmines also fall under this category.
A death effect is an event that happens upon a survivor's or zombie's death. It is not a direct attack because they do not usually let it happen intentionally. It usually happens when someone kills them, although they can pull of a suicidal attack with a death effect for twice the chaos. Death effects are favored more by the zombies because of mutations done to them.
Death Effect Examples
In Left 4 Dead, the Boomer has the biggest death effect of the infected, exploding, covering everyone in bile and pushing them back. In many zombie stories, dead zombie corpses can let off a putrid smell as sort of a death effect, infecting anyone who breathes it in or putting them off tasks. For survivors, they can pull a grenade if they know that they're about to die from zombie attacks.