简体   繁体   中英

Pyglet large sprites glitch

I am working on a simple game in Python, using the Pyglet graphics library. I have an image, 6000x300 pixels, that I want to use as a scrolling background for the game. At the moment, I have made a sprite with the image and move it left and right depending on the player's position. The problem I have is that the sprite is glitchy: sometimes the 400 or so pixels at the start are duplicated several times along the length of it, and the motion of the sprite is sometimes jerky and sometimes smooth.

Is this expected behavior for an image of that size? Is there a workaround? If not, can anyone suggest an better way to make a scrolling background?

Thanks in advance.

Well, it's a strange one. I got home and ran the program on my newer desktop (my laptop is about 8 or more years old...) with the intention of making a video to help to explain the problem, and guess what? It runs perfectly. Must be a bug with Pyglet and very old hardware...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM