Last active
December 17, 2015 11:49
-
-
Save tluyben/5604660 to your computer and use it in GitHub Desktop.
Sinusscroller in Monkey
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function UpdateAd() | |
If Not gameScreen.adsOn Return | |
If _MouseClick() And _MouseIn(New Vector2D(0, SCREEN_HEIGHT-80), New Vector2D(SCREEN_WIDTH, 80)) | |
LaunchNativeBrowser(ADLINK, ADLINK) | |
End | |
End | |
Function RenderAd() | |
If Not gameScreen.adsOn Return | |
SetColor 0,0,0 | |
DrawRect(0, SCREEN_HEIGHT-80, SCREEN_WIDTH, SCREEN_HEIGHT) | |
SetColor 255,255,255 | |
Local f := assets.Find("adfont").font | |
Local am:=Millisecs()/10.0 | |
Local x:Int=SCREEN_WIDTH - am Mod f.TextWidth(ADTXT)*2.5 | |
For Local n:=0 Until ADTXT.Length | |
f.DrawText ADTXT[n..n+1], x + n*f.TextWidth("W"), (SCREEN_HEIGHT-55)+Sin(am+n*20)*20 | |
End | |
End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment