Skip to content

Commit 5c4969a

Browse files
committed
add touchscreen touch function
1 parent 9fcf938 commit 5c4969a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

sketch.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,14 @@ function mouseClicked()
535535
{
536536
generateNewSandwich();
537537
}
538-
539538
}
540539

540+
function touchStarted() {
541+
if(touch.x < w/2 + 75 && touch.x > w/2 - 75 && touch.y < h-100 + 35 && touch.y > h-100 - 35 )
542+
{
543+
generateNewSandwich();
544+
}
545+
}
541546
function startTraining()
542547
{
543548
if(level == 3)

0 commit comments

Comments
 (0)