Python Forum
[PyGame] Confused with Pygame documentation. (Newbie here)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Confused with Pygame documentation. (Newbie here)
#4
(Sep-10-2022, 02:36 PM)XavierPlatinum Wrote:
(Sep-10-2022, 04:07 AM)monkeydesu Wrote:
if self.rect.right < 0:
            self.kill()
And what does the "right" here mean? I understand it's to wipe the sprite enemy from the screen. Does "right" mean the screen border or something? Super confused! )=

The "right" is the right side of the your rectangle. "0" means the left side of the screen, as the y value is 0. So if the right side of your sprite is less than 0, that means your whole sprite is off the screen to the left.

Ah! That makes so much sense! Thank you haha
Reply


Messages In This Thread
RE: Confused with Pygame documentation. (Newbie here) - by monkeydesu - Sep-11-2022, 01:54 AM

Forum Jump:

User Panel Messages

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