The latest inflation rate is the highest since June 2013, and above the Bank of England's 2% target.
The Office for National Statistics said the price of food and clothing also went up slightly but fuel costs fell for a third month in a row.
The pick-up in inflation is likely to continue the squeeze on consumers.
The fall in the value of the pound since last year's Brexit referendum has increased the cost of imports, which has been one of the key factors behind the rise in inflation.
However, wage increases have not kept up with the rise in prices. The most recent ONS data on wages showed that average weekly earnings excluding bonuses increased by 2.1% in the three months to March. Earnings data for the three months to April will be released on Wednesday.
Computer games are part of the recreational and cultural goods and services sector, where prices rose overall by 0.9% between April and May compared with a fall of 0.4% a year ago.
As computer games are mostly imported they have been affected by the weaker pound, while the drop in sterling has also meant holidays abroad are more expensive.
The sugar, jam, confectionery and children's clothing markets were mainly responsible for the increase in food and clothing prices.
There were also rises in the price of furniture and household goods, and in the cost of electricity - with further price increases coming into effect in May.
Travellers did have some good news, however, with the decrease in fuel costs coupled with a drop in the cost of air and sea travel, which was influenced by Easter falling in April instead of March as in 2016.
Amit Kara, head of UK macroeconomic forecasting at the National Institute of Economic and Social Research, said: "We expect inflation to rise further over the course of this year and to reach a peak in the final quarter of 2017.
"This spike in inflation will exert further downward pressure on real household disposable income, at a time when wage growth remains modest and in turn squeeze consumer spending."
Nick Dixon, investment director at life insurance and pensions firm Aegon, said: "This high rate will particularly affect the purchasing power of retirees locked into a fixed income and the growing number whose wages have failed to keep pace."