Feb-28-2021, 11:18 PM
As is you do not have any collision detection whatsoever in your example. Your player is just drawn and not an object. Same as your boundary line, it is just drawn and not an object.
First i would make the player an object with a rect collsiion detection and work from there on. Then detail it further for circular. With the boundary, i would create it as an object with its specified coordinates and identify the lines between them to create collision detection upon those lines.
First i would make the player an object with a rect collsiion detection and work from there on. Then detail it further for circular. With the boundary, i would create it as an object with its specified coordinates and identify the lines between them to create collision detection upon those lines.
Recommended Tutorials: