Python Forum
Speed issue with sprite update
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Speed issue with sprite update
#11
Also using Rect and Vector2 for math. Will speed up your program.
99 percent of computer problems exists between chair and keyboard.
Reply
#12
I certainly need to change character movement to vectors to add better physics if nothing else. Everything thing is done with rect.x/y.

On another note, I suspect that pygame's display update might be built to ignore thing too far off screen and here's why:

I built a boss battle, and when the boss dies tumbles down rotating covered in explosions. The victory music and screen text are triggered when the dead boss sprite has fallen a certain amount. It triggers the victory stuff, and kills the sprite. What happened however, is that one time as the boss's body was falling I flew out of the room and away and the text and music didn't come. So I flew back in and the boss finished falling and the music came. It was like when the boss's body was far enough off screen the sprite didn't update, and only started again when I got close enough to it. I can replicate it and screen cap it, but I'm sure you understand what I'm saying.

Have you noticed or heard of this? Everything works perfectly if you stay in the room, near the boss sprite.
Reply
#13
Pygame.display.update() only update any rect that has change. Except when there to many and flip the whole screen. If your screen is in constant change it better to use pygame.display.flip().

That sound like something in your code. It like you stop process that data when you left. With out seeing code. I just be guessing.
99 percent of computer problems exists between chair and keyboard.
Reply
#14
Yeah... I had a "in_boss_fight" tag.

Blush
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] My Pygame Sprite not appearing... noodlespinbot 3 4,856 Oct-30-2020, 06:51 AM
Last Post: robinmurphy
  My Pygame Sprite not appearing... noodlespinbot 1 2,863 Apr-08-2020, 11:25 AM
Last Post: pyzyx3qwerty
  [PyGame] Terrible Sprite controls, need help. michael1789 16 8,036 Dec-18-2019, 10:32 PM
Last Post: michael1789
  [PyGame] Sprite image.get_rect() moves sprite to 0, 0 michael1789 2 5,705 Dec-13-2019, 08:37 PM
Last Post: michael1789
  Pygame sprite not moving michael1789 1 3,845 Nov-10-2019, 03:54 AM
Last Post: michael1789
  Sprite not rendering Clunk_Head 2 3,416 Oct-03-2019, 11:27 AM
Last Post: Clunk_Head
  Need help making a sprite GalaxyCoyote 4 4,269 Aug-11-2019, 09:12 PM
Last Post: metulburr
  creating sprite mask pfaber11 5 4,884 Jun-12-2019, 09:39 PM
Last Post: pfaber11
  [PyGame] assigning rect to sprite pfaber11 1 2,765 May-18-2019, 05:39 PM
Last Post: metulburr
  moving a sprite pfaber11 3 3,299 May-15-2019, 12:52 PM
Last Post: pfaber11

Forum Jump:

User Panel Messages

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