Well, the subject might have definitely caught your attention. I was thinking about a piece of code that I saw and I could not help but think that if there was porn for a coder, what would it look like, and then it hit me, this is what it would look like.
[lua]function obj:touch(event)
print(“touch event”)
print(“event(”…event.phase)
if(event.phase == “ended”)
then
self.touched = self.touched-1
print(“Se acabo el movimiento”)
if(self.touched == 0)
then
print("Touchs "…self.touched)
self.speedX = 0
end
end
if(event.phase == “began”)
then
if(self.touched == 0 )
then
if(event.x>self.x)
then
self.touched = self.touched+1
self.speedX = 300
end
if(event.x<=self.x)
then
self.touched = self.touched+1
self.speedX = -300
end
print("Touchs "…self.touched)
end
end
Runtime:addEventListener(“touch”, obj)[/lua]
there is sooo much of touch and self.touch that I could not help but notice it… and it even has variable speeds… that change on the number of times self.touched
cheers,
? [import]uid: 3826 topic_id: 13655 reply_id: 313655[/import]