Such amount of spam messages are usually sent by spam bot, then there is little you can do except delete one by one.
You can try to prevent it by leaving no or almost no traces of your private information such as email address, telephone number on the Internet.
Playing a game online is fun, but such a website needs 'resources' to pay for their website.
· Free games and applications are also not completely free, think of ads and others.
· You can also report to your Internet Service Provider.
'Free' doesn't exist, there's always something hiding behind the word Free.
See this Apple article:
Recognize and avoid phishing messages, phony support calls, and other scams
Recognize and avoid phishing messages, phony support calls, and other scams - Apple Support
See also the Apple articles below:
Block phone numbers, contacts, and emails on your iPhone, iPad, or iPod touch
Block phone numbers, contacts, and emails on your iPhone, iPad, or iPod touch - Apple Support
Detect and block spam phone calls
Detect and block spam phone calls - Apple Support
Block messages in Messages on Mac
Block messages in Messages on Mac – Apple Support (UK)
Phony "tech support" / "ransomware" popups and web pages
Phony "tech support" / "ransomware" popup… - Apple Community
You can ask your carrier to block all that phone numbers that send spam sms to you.