Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Enumeration
  2.   #Flake
  3.   #WinHeight = 600
  4.   #WinWidth = 800
  5.   #Number_of_flakes = 10
  6. EndEnumeration
  7.  
  8. Structure SnowPosition
  9.   X.i
  10.   Y.i
  11. EndStructure
  12.  
  13. Dim Snow.SnowPosition(1)
  14. Snow()/X = Random(800)
  15. Snow()/Y = Random(600)
  16.  
  17. UsePNGImageDecoder()
  18. InitKeyboard()
  19. InitSprite()
  20.  
  21.  
  22. OpenWindow(0, 0, 0, 800, 600, "Static Sprite Test", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  23. OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0) ;Set the window parameters
  24. Global Quit.b = #False
  25. LoadSprite(#Flake, "flake.png", #PB_Sprite_Texture | #PB_Sprite_AlphaBlending)
  26.  
  27. Repeat
  28.  
  29.   Repeat
  30.     Event = WindowEvent()
  31.     If Event = #PB_Event_CloseWindow : Quit = #True : EndIf
  32.   Until Event = 0
  33.   FlipBuffers()
  34.   ClearScreen(0)
  35.   Gosub Snowflake
  36.   ExamineKeyboard()
  37.   Delay(5)
  38. Until KeyboardPushed(#PB_Key_Escape) Or Quit
  39. End  
  40.  
  41. Snowflake:
  42. For count=0 To #Number_of_Flakes
  43.   DisplayTransparentSprite(#Flake, x, y)
  44. Next count
  45. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement