animation

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by blue-speed.

Hi!

I want to ask why this code doesent display a animation with 16 frames. When i start it i cant see anything. Only the Black fullscreen .

Code: Select all

InitSprite()=0                                                                        
MessageRequester("Fehler","Konnte dx nicht finden",0) 
EndIf             
                                                        
If InitKeyboard() =0                                                                             
MessageRequester("Fehler","Konnte dx nicht finden",0)            
EndIf                                                                                                   


If OpenScreen(800,600,32,"Vollbild") = 0                                      
MessageRequester("Fehler","Konnte kein Vollbild erstellen ",0) 
EndIf                                                                                                    

For anim = 1 To 16
LoadSprite(anim,"files\anim_"+Str(anim)+".bmp",0)
Next

anim = 0

Repeat                                                                                   
ClearScreen(0,0,0)                                                                            
FlipBuffer()                                                                                        
anim+1       
If anim = 16
anim = 0
EndIf
DisplayTransparentSprite(anim,30,30)
ExamineKeyboard()                                                                         
If KeyboardPushed(#PB_Key_Escape)              
End                                                                                                  
EndIf                                                                                                   
ForEver


cu
bluespeed

WOOOOOOW!

Edited by - blue-speed on 31 December 2001 12:49:57
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Looks like you are clearuing the screen then flipping the clear screen into view. Then you draw your sprite.
You should FlipBuffer after you draw the sprite on the screen.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by blue-speed.

ups

thx
bluespeed

WOOOOOOW!
Post Reply