It is currently Sun Jul 05, 2020 4:51 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Flickering Sprite
PostPosted: Sat Jun 20, 2015 1:55 pm 
Offline
User
User

Joined: Sat Jun 20, 2015 1:47 pm
Posts: 42
Hi,

I've decided to give the latest version of Pure BASIC a go for games.

Loading and displaying the background sprite leads to flickering at first until things settle down - then the flickering stops.
I'm guessing it's something to do with flip, but I've tried all sorts of combinations, with no luck.

Code:
UsePNGImageDecoder()

If InitSprite() And InitKeyboard() And OpenScreen( 1920, 1080, 32, "GameGrid", #PB_Screen_WaitSynchronization )

    img = LoadSprite(  #PB_Any, "Gamegrid.png" )
    col_cls.i = RGB( 0, 0, 0 )
   
    If img

        Repeat
 
            ClearScreen( col_cls )
            StartDrawing( ScreenOutput() )
                DisplaySprite( img, 0, 0 )
            StopDrawing()
            FlipBuffers()
            ExamineKeyboard()
           
        Until KeyboardPushed( #PB_Key_Escape )
        FreeSprite( img )
       
    EndIf

EndIf



Steve


Top
 Profile  
Reply with quote  
 Post subject: Re: Flickering Sprite
PostPosted: Sat Jun 20, 2015 1:57 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Jan 21, 2011 8:25 am
Posts: 1021
Location: 'stralia!
You don't need Start / StopDrawing for displaying sprites. :wink: Just remove it.

_________________
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds


Top
 Profile  
Reply with quote  
 Post subject: Re: Flickering Sprite
PostPosted: Sat Jun 20, 2015 2:05 pm 
Offline
User
User

Joined: Sat Jun 20, 2015 1:47 pm
Posts: 42
Awesome! Thanks, I've been playing around with that code for ages lol...Works perfectly now :D


Top
 Profile  
Reply with quote  
 Post subject: Re: Flickering Sprite
PostPosted: Sat Jun 20, 2015 7:07 pm 
Offline
User
User

Joined: Sat Jun 20, 2015 1:47 pm
Posts: 42
It seems Pure BASIC has come on since I last looked regards gaming. Good Sprite routines, alpha blending, pixel perfect collisions, 3D - and 64-bit! :)

Onwards and upwards with my game...

And a library for Pure ;)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye