O'Reilly logo

LiveCode Mobile Development HOTSHOT by Edward D Lavieri Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming the game

We are now ready to program the game. There are only four programmable objects for this application: the three buttons (spot1, spot2, and spot3) and the information label. Most of our code will be placed at the card level.

Engage Thrusters

  1. Add the following code to the Main card:
    command setupGame global gScore, gLevel, gLoss, gAnswer # Section 1 put 0 into gScore put 0 into gLevel put 0 into gLoss put 0 into gAnswer # Section 2 set the icon of btn "spot1" to 1022 set the icon of btn "spot2" to 1022 set the icon of btn "spot3" to 1022 # Section 3 set the text of fld "Score" to "Score: 0" set the text of fld "Level" to "Current Run: 0" # Section 4 set the vis of img "loss1" to true set the vis of img "loss2" to true set the vis ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required