Python Forum
[PyGame] Keeping the player within a polygon
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Keeping the player within a polygon
#2
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.
Recommended Tutorials:
Reply


Messages In This Thread
Keeping the player within a polygon - by Atekka - Feb-27-2021, 12:16 AM
RE: Keeping the player within a polygon - by metulburr - Feb-28-2021, 11:18 PM
RE: Keeping the player within a polygon - by Atekka - Feb-28-2021, 11:44 PM
RE: Keeping the player within a polygon - by Atekka - Mar-06-2021, 10:28 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020