Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

tracking multiple touches

edited March 2014 in Questions Posts: 136

I am trying to make a game with two main buttons, one to rotate the view and one the direction you run in. It is coming out good, but I can't get Codea to let me use both buttons simultaneously. What I want to do is create something like the Ping sample game in Codea, and have two touches exist at once. Anyone know how?



  • dave1707dave1707 Mod
    edited March 2014 Posts: 7,514

    @jrohanian Here's a simple example. Slide a finger back and forth. Then try more fingers.

    displayMode(FULLSCREEN) function setup() mt={} -- touch table end function draw() background(40, 40, 50) z=0 for a,b in pairs(mt) do z=z+1 sprite("Planet Cute:Character Boy",b.x,HEIGHT-100*z) end end function touched(t) if t.state==BEGAN then mt[]=t end if t.state==MOVING then mt[]=t end if t.state==ENDED then mt[]=nil end end
  • Posts: 418

    @dave1707 's example is good. Codea also has a built in example that you can look at.

  • Posts: 136

    @dave1707 Thanks I get it now. I was making this way too complicated.

Sign In or Register to comment.