Created
June 9, 2013 13:04
-
-
Save figengungor/5743438 to your computer and use it in GitHub Desktop.
EnterFrame Event in Corona
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
| --Disco App =) | |
| --Create a rectangular object that covers the entire screen | |
| disco = display.newRect(0,0, display.contentWidth, display.contentHeight) | |
| --Play Disco music | |
| media.playSound("whatislove.wav") | |
| local function changeColor() | |
| --Changes the color of "disco" rectangular object randomly in every frame | |
| disco:setFillColor(math.random(0,255),math.random(0,255), math.random(0,255)) | |
| end | |
| --EnterFrame listener calls "changeColor" function every frame | |
| Runtime:addEventListener("enterFrame", changeColor) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment