Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Enumeration
- #Flake
- #WinHeight = 600
- #WinWidth = 800
- #Number_of_flakes = 10
- EndEnumeration
- Structure SnowPosition
- X.i
- Y.i
- EndStructure
- Dim Snow.SnowPosition(#Number_of_flakes)
- For i=0 To #Number_of_flakes
- Snow(i)\X = Random(800)
- Snow(i)\Y = Random(600)
- Next
- UsePNGImageDecoder()
- InitKeyboard()
- InitSprite()
- OpenWindow(0, 0, 0, 800, 600, "Static Sprite Test", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
- OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0) ;Set the window parameters
- Global Quit.b = #False
- LoadSprite(#Flake, "flake.png", #PB_Sprite_Texture | #PB_Sprite_AlphaBlending)
- Repeat
- Repeat
- Event = WindowEvent()
- If Event = #PB_Event_CloseWindow : Quit = #True : EndIf
- Until Event = 0
- FlipBuffers()
- ClearScreen(0)
- Gosub Snowflake
- ExamineKeyboard()
- Delay(5)
- Until KeyboardPushed(#PB_Key_Escape) Or Quit
- End
- Snowflake:
- For count=0 To #Number_of_flakes
- DisplayTransparentSprite(#Flake, Snow(count)\X, Snow(count)\Y)
- Next count
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement