Page 1 of 1

Posted: Mon Dec 31, 2001 12:49 pm
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

Posted: Mon Dec 31, 2001 2:54 pm
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.

Posted: Mon Dec 31, 2001 8:25 pm
by BackupUser
Restored from previous forum. Originally posted by blue-speed.

ups

thx
bluespeed

WOOOOOOW!