Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------------------------------------------------------------------
- --
- -- main.lua
- --
- -----------------------------------------------------------------------------------------
- -- Your code here
- local tlo = display.newImage("")
- tlo.x = 160
- tlo.y = 255
- tlo.rotation = 90
- math.randomseed(os.time())
- local tekst2 = display.newText( "-------------------------------------------------", 1, 1, native.systemFont, 40 )
- local tekst1 = display.newText( "Random Lesson", 160, 30, native.systemFont, 40 )
- local tekst3 = display.newText( "-------------------------------------------------", 1, 50, native.systemFont, 40 )
- local tekst5 = display.newText( "-------------------------------------------------", 1, 200, native.systemFont, 40 )
- local tekst6 = display.newText( "-------------------------------------------------", 1, 300, native.systemFont, 40 )
- local widget = require( "widget" )
- function pokaWynik()
- local wynik = math.random(31 + 1)
- return wynik
- end
- local wynik = display.newText("?", 160, 250, native.systemFont, 30)
- local function handleButtonEvent( event )
- if ( "ended" == event.phase ) then
- wynik:removeSelf()
- wynik = nil
- wynik = display.newText(pokaWynik(), 160, 250, native.systemFont, 30)
- end
- end
- local button1 = widget.newButton
- {
- left = 50,
- top = 400,
- id = "losuj",
- label = "Losuj",
- onEvent = handleButtonEvent
- }
Advertisement
Add Comment
Please, Sign In to add comment