サブクエリで集計を実行してから、変数を使用してランクを取得する必要があります。
select pid, name, game, score, (@rn := @rn + 1) as rank
from (select pid, name, game, SUM(score) as score
from player
where game = 'aa'
group by pid, game
) p cross join
(select @rn := 0) vars
order by score desc;