Guest User

Untitled

a guest
Oct 20th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.56 KB | None | 0 0
  1. Graphics 600, 600
  2.  
  3. Local myImage : TImage = LoadImage("Content/ball.png")
  4.    
  5. Repeat
  6.     Cls
  7.  
  8.     For i : Int = 1 To 3000
  9.         DrawImage myImage, 0, 0
  10.  
  11.     Next
  12.    
  13.     FPS.DrawFPS()
  14.    
  15.     Flip 0
  16.    
  17. Until AppTerminate()
  18.  
  19. Type FPS
  20.     Global Counter : Int
  21.     Global Time : Int
  22.     Global TFPS : Int
  23.     Function Calc : Int()
  24.         Counter = Counter + 1
  25.         If Time < MilliSecs()
  26.             TFPS = Counter ' <-Frames/Sec
  27.             Time = MilliSecs() + 1000 'Update
  28.             Counter = 0
  29.         EndIf
  30.         Return TFPS
  31.     EndFunction
  32.    
  33.     Function DrawFPS()
  34.         DrawText "FPS = " + FPS.Calc(), 0, 0
  35.     EndFunction
  36. EndType
Add Comment
Please, Sign In to add comment