Pygame, surface refresh flicker.

Pygame, surface refresh flicker.

Postby spamynator_1 » Mon Sep 23, 2013 2:07 pm

I have made is so that when in the correct state, you can press w,a,s,d to make the sprite image cycle through 12 images, 3 for each direction making a sort of walking animation. One issue i have with this is to make it so it doesnt have a massive trail of previously displayed sprite images i have to reload the surface image before i blit the next sprite image. This causes a breif period of time that the sprite image is not displayed on the screen. This makes a flicker effect that is obnauxious. Does anyone know a way i can make it so i does not flicker?
spamynator_1
 
Posts: 63
Joined: Sun Mar 03, 2013 12:45 am

Re: Pygame, surface refresh flicker.

Postby spamynator_1 » Mon Sep 23, 2013 7:16 pm

Anybody?
spamynator_1
 
Posts: 63
Joined: Sun Mar 03, 2013 12:45 am

Re: Pygame, surface refresh flicker.

Postby metulburr » Mon Sep 23, 2013 7:21 pm

One issue i have with this is to make it so it doesnt have a massive trail of previously displayed sprite images i have to reload the surface image before i blit the next sprite image.

the flicker is caused by constantly reloading the image. Always load the image once. The trail of images can be removed by scr.fill((0,0,0)), filling the image with black each frame, thus removing each trial from the previous frame

thats all i could come up with, without seeing the code
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1500
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY


Return to Game Development

Who is online

Users browsing this forum: No registered users and 2 guests