Hello everyone I ve seen that here is full of capable people so I want to ask a question to you
In few words I have 2 images
local omino = display.newImage("omino.png") omino:setReferencePoint(display.BottomLeftReferencePoint) omino.x = 66 omino.y = 249 local omino2 = display.newImage("omino2.png") omino2:setReferencePoint(display.BottomLeftReferencePoint) omino2.x = 68 omino2.y = 139
The “omino2” run alone and i used an enterframe function :
function corri(self, event) self.x = self.x + 3 end omino2.enterFrame = corri Runtime:addEventListener("enterFrame", omino2)
The “omino” have to run and overtake “omino2” after each “touch” of the player. So I need that the for each Touch the “omino2” must move back 12px from the position that he has in that moment (the moment I touch the screen).
I tried to make somethinng like this:
function avanza(event) if event.phase == "began" then transition.to(omino2,{ time = 50 ,x = self.x - 12} ) end end tasto:addEventListener("touch" , avanza)
But the System doesn’t recognize the "self.x - 12 " command. What I have to do??
( Sorry Again For My Bad English)