That is a religious question rather than a technical one, and the honest answer is that it depends on who you ask.
Views differ substantially between scholars and traditions. Some focus on the content itself — violence, imagery, language — while others weigh the effect a game has on your behaviour and attention. A rating of "M" is a content classification, not a religious ruling, so it does not settle the matter on its own.
For a decision that actually applies to you, the right step is to ask a knowledgeable person within your own tradition, ideally describing the specific game rather than the rating. A local imam or qualified scholar can give you guidance grounded in your circumstances in a way a general answer cannot.