I am new to programming. I have downloaded Corona last week to learn to code and have fun with my son playing games.
We went through the "Getting Started" tutorial and now we are trying to experiment.
My setup: Version 2018.3326 (2018.6.25) on MacOS High Sierra.
I have n cats displayed on screen. If I tap on three cats, say cat_j, cat_k, cat_l, then only these cats should rotate 180.
Please observe: the touches must be sequential and the order
is irrelevant (i.e., j -> k -> l, or j->l-> k … and so on on through all the 6 permutations).
I skip the code I used to display the cats: basically I have as many local variables
cat_i as png images I have, i =1,…, n, and I have named them, i.e.
cat_i.name=“cat_i” for i=1,…,n.
I first tried with cat_1.
local function turn(event)
But then, when I tried with cat1 and cat2, I realize it is above my very low skills.
- - First try.
local function turnA(event)
if event.target.name==“cat1” then
if event.target.name==“cat2" then
- - Nothing happens and I get no error.
- - Second try, (now with cat3 and cat4).
local function turnB(event)
if (event.target.name==“cat3") and (event.target.name==“cat4") then
As above, nothing happens and I get no error.
Could you help me, please?