Hi, I’m having a problem here making an object touching another image. When they touch a certain area i want point +1 and when it touches a different area i want to display the “you lost” page
here’s a pic that might help you understand more.
Hi, I’m having a problem here making an object touching another image. When they touch a certain area i want point +1 and when it touches a different area i want to display the “you lost” page
here’s a pic that might help you understand more.
I’ll try to help, even with the code. But I need much more
information.
An object is fixed and the other moves?
The object that moves, makes it through a drag on the screen?
An object is fixed and there is no other object but are only taps?
If you can clarify this and I’ll be able to help.
so basically the object above is one fixed picture. (lets call it x)
An object that collides with “x” on the screen is moved using transition.to()
thanks for helping
The object hits the object x, is falling?
It would be a vertical transition?
The object x is still in the two coordinates? Vertical and horizontal?
forgot to mention before the object(s) that hits “x” are randomly generated and come from different sides.
object x is in the middle of screen
Ok, give me a while and see to do.
hey fferraro, any luck so far?
hello, I’m on it. Yesterday I could not do anything because I was cursing with iTunnes Connect to upload an app to the store. But I’m working on it. Do not forget me.
thanks!! you’re awesome!
Code parts:
Objetivo = display.newImage(“Pozo.png”)
button0 = display.newRect(50,50,120,120)
button0:setFillColor(1,0,0,0.01)
Piedra = display.newRect(300,0,5,5)
Piedra:setFillColor(1,1,0)
Piedra.y=40
ypos=10
Objetivo.y=500
button0.y=442
local function moveObjetivo( event )
Objetivo.x=event.x
button0.x=event.x
end
local function animate(event)
if (ypos>496) then
ypos=497
else
ypos = ypos + (2)
end
Piedra:translate (0, (ypos) - Piedra.y)
end
Runtime:addEventListener( “touch”, moveObjetivo )
Runtime:addEventListener( “enterFrame”, animate )
You e-mail, please?
Create a new project in the simulator. I did it for iPad horizontally.
Add this image to the project. In the LUA file poné the code did.
Missing a pile of stuff. But it is to see that I was working.
alright il try it thanks again
Here came the Pozo.png file?
i don’t have the file pozo.png
Check your email
I’ll try to help, even with the code. But I need much more
information.
An object is fixed and the other moves?
The object that moves, makes it through a drag on the screen?
An object is fixed and there is no other object but are only taps?
If you can clarify this and I’ll be able to help.
so basically the object above is one fixed picture. (lets call it x)
An object that collides with “x” on the screen is moved using transition.to()
thanks for helping
The object hits the object x, is falling?
It would be a vertical transition?
The object x is still in the two coordinates? Vertical and horizontal?
forgot to mention before the object(s) that hits “x” are randomly generated and come from different sides.
object x is in the middle of screen