tap button to continue

Post Reply
Pankaj
Posts: 6
Joined: Sat May 23, 2015 5:19 pm
My devices: 4S
5C
iPad 3
MacMini

tap button to continue

Post by Pankaj »

What is the simplest way to give an option to continue to next step by tapping a screen 3 times or pressing a volume button.

presently I am inserting pauses but that is not so slick.

Thanks in advance

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: tap button to continue

Post by Mr. Kibernetik »

Please check examples in sample programs how button press is analyzed.
There are many examples where buttons are used, for example "painter.txt" in Interactive Interface section.

Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: tap button to continue

Post by Henko »

Pankaj wrote:What is the simplest way to give an option to continue to next step by tapping a screen 3 times or pressing a volume button.

presently I am inserting pauses but that is not so slick.

Thanks in advance

Code: Select all

graphics ! graphics clear 
draw color 0,0,0
button "nono" title "do NOT press" at 100,100 size 150,100
draw text "Pressing this button will" at 30,240
draw text "destroy your button!" at 60,270

wait: if not button_pressed ("nono") then wait

button "nono" delete    ' continue the program
graphics clear ! draw text "You did it" at 50,255
end

Pankaj
Posts: 6
Joined: Sat May 23, 2015 5:19 pm
My devices: 4S
5C
iPad 3
MacMini

Re: tap button to continue

Post by Pankaj »

Henko wrote:
Pankaj wrote:What is the simplest way to give an option to continue to next step by tapping a screen 3 times or pressing a volume button.

presently I am inserting pauses but that is not so slick.

Thanks in advance

Code: Select all

graphics ! graphics clear 
draw color 0,0,0
button "nono" title "do NOT press" at 100,100 size 150,100
draw text "Pressing this button will" at 30,240
draw text "destroy your button!" at 60,270

wait: if not button_pressed ("nono") then wait

button "nono" delete    ' continue the program
graphics clear ! draw text "You did it" at 50,255
end
Thanks Henko for Chaos theory code :)
I will make it move to the next step .

Pankaj

Pankaj
Posts: 6
Joined: Sat May 23, 2015 5:19 pm
My devices: 4S
5C
iPad 3
MacMini

Re: tap button to continue

Post by Pankaj »

Mr. Kibernetik wrote:Please check examples in sample programs how button press is analyzed.
There are many examples where buttons are used, for example "painter.txt" in Interactive Interface section.
Thanks, I am an absolute beginner, so those were a bit too tricky for me.
However, I have managed with the - Input from keyboard(PROMPT$) routine and used DO UNTIL FIELD_CHANGED as method of pausing.
It is rather crude and unsightly but works.

Pankaj

Post Reply