/Giocare/ has only an indirect object;
it can be /a/ or /con/, depending upon the CONTEXT:
Giocare a carte con gli amici.
Giocare con gli amici.
Giocare con le parole.
Giocare con la sabbia gli altri bambini in riva al mare.
Giocare a <sport_name>.
Giocare con la palla.
Giocare a pallavolo.
When to use /a/ ?
When the game is well-defined, or the category of the game is stated
a1) giocare a carte.
a2) giocare con le carte
(a1) means that people are playing one of: poker,briscola,bridge,canasta,
....
(a2) means that people are (for instance) making buildings with cards,
or doing other things with cards, like throwing them, etc.
Everything 'playful' but not in the realm of a game with more or less
defined rules.