I’m building a top-down twin-stick shooter with a level editor.
For gameplay reasons, the level is made of tiles, and the arena can be any shape whatsoever. For example (x representing a tile):
xxxxxxxxxx
xxxx xxxx
xxxx xxxx
xxxxxxxxxx
xx
xxxxxxxxxx
xxxxxxxxxx
The player can move freely inside the arena, but can’t leave it. I was wondering how to check for collisions and make sure the player can’t leave.
Any ideas?