By the way, please note that here i'm talking strictly in terms of gameplay. Other elements can come at play too, like story, level design patterns, etc. The more the game is complex, OR the more the mechanics used by the game are common, the less there is legal ground to call out a copycat.
Aka, if someone makes a 3D shooter where you shoot at people in square rooms, nobody would call it a wolfenstein clone. Same if you make a platformer where you need to jump over holes.
Basically, if your game is an obvious attempt at riding on another game's gameplay and style, while doing your best to avoid asset/name copyright, then action can be taken.
If you're just making a game with very common tropes used in many other video games, or if your game is clearly trying to be its own thing, and does not copy more than a few elements from other games, then you should be fine.
it's still very much a grey area that most of the time gets resolved by Steam/Apple/Google directly, but it has been taken to court, and it has resulted in the party accusing the other game of being a copy to win their case. So there is legal precedent basically.