Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. using System;
  2. using SwinGameSDK;
  3.  
  4. namespace MyGame
  5. {
  6. public class GameMain
  7. {
  8. public static void Main()
  9. {
  10. //Open the game window
  11. SwinGame.OpenGraphicsWindow("GameMain", 800, 600);
  12. SwinGame.ShowSwinGameSplashScreen();
  13.  
  14. Shape myShape = new Shape();
  15.  
  16. //Run the game loop
  17. while(false == SwinGame.WindowCloseRequested())
  18. {
  19. //Fetch the next batch of UI interaction
  20. SwinGame.ProcessEvents();
  21.  
  22. //Clear the screen and draw the framerate
  23. SwinGame.ClearScreen(Color.White);
  24. SwinGame.DrawFramerate(0,0);
  25.  
  26. //Draw onto the screen
  27. SwinGame.RefreshScreen(60);
  28.  
  29. myShape.Draw();
  30.  
  31. if (SwinGame.MouseClicked(MouseButton.LeftButton) == true)
  32. {
  33. myShape.X = SwinGame.MouseX();
  34. myShape.Y = SwinGame.MouseY();
  35.  
  36. }
  37. }
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement