Page 1 of 1

Multi Touch when I want Single Touch

Posted: Fri May 04, 2012 8:53 pm
by daran
I am tinkering with the academy tutorial week one and was testing it out on my android Samsung G4 Epic.

I have messed with the code quite a bit trying to get it to recognize single touch to make the rocket go up, but only a multi-touch makes it raise.

if i put On MouseUp / End MouseUp instead of if the mouse is Up then, i will get a compile error, the error seems to be associated with how i am using if sGameRunning then.

using touchStart/touchEnd produces the same error i get with on mouseUp/end mouseUp

can someone comment on what i am doing wrong or should do differently? possibly i need to look at this from a different perspective?

Code: Select all

local sGameRunning

on updatescreen 
   
  if sGameRunning then 
            
      if the mouse is up then
         
         if the bottom of button "rocket" + 10 < the bottom of this card then
            set the bottom of button "rocket" to the bottom of button "rocket" + 10
         end if
         end if


If the mouse is down then
   if the top of button "rocket" - 10 > the top of this card then
      set the top of button "rocket" to the top of button "rocket" - 10
   end if
   end if



end if

end updatescreen 
    
    
on startgame 
   activateScreenupdates
   
   put true into sGameRunning 
end startgame

on stopgame
   put false into sGameRunning 
end stopgame