Skip to reading
Getting started with PCA3D

28. Make the winding puzzle

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView illustrations
On this page

28. Make the winding puzzle

The dial is a GUI with three buttons: I, II and III. A number variable, dial, stores how many correct turns have been made. It starts at 0. The required sequence is [3, 1, 2]. A wrong turn resets the counter.

Build the dial GUI#

Figure 34. The dial GUI in the designer. The buttons call three small scripts; the dial variable remembers progress.

Create GUI dial, hidden initially. Add its panel, title, help text, three numeral buttons and Close button from the GUI recipe. The numeral buttons call turn_one, turn_two and turn_three. Close hides dial; it does not complete the puzzle.

Create the three scripts#

Use the following complete source for turn_one. The other two scripts are identical except for the tested number: use 2 in turn_two and 3 in turn_three. Change only that comparison, not the required sequence.

Page 72 of 184Permalink
Go to page