Game Development Community

(Solved) Iphone touched command isDown help?

by Eliezer Cardona · in iTorque 2D · 06/11/2011 (8:50 am) · 21 replies

Hi I have created a image to be a button and in script I called it Button. I have created a player and in script i called it player. When i was looking in the document dragging, which I do not use this one. I looked in the code for music player and i saw isDown. I try doing some coding to making the player move up. I have success but when it come to play on keyboard I am fine. Can you guys share some expertise, did I do something wrong with the coding?

If you know more commands for the touch and where did you find it can you share it thanks. Also I have the documents for what came with Itorque which I take a look. If you know the section also so you can tell me where to look.

function oniPhoneTouchUp( %touchCount, %touchX, %touchY ) 
{
   Button.isDown = false;
}

function oniPhoneTouchMove( %touchCount, %touchX, %touchY ) 
{
   if(Button.isDown)
   {
      %this.player.setLinearVelocityY(-55);
   }
   else
   {
      %this.Button.setLinearVelocityY(-55);
   }
}
function Cloud::onMouseDown(%this, %modifier, %worldPos)
{
   if(Button.isDown)
   {
      return;
   }
   else
   {
      Button.isDown = true;
   }
}

Thanks for looking
Page«First 1 2 Next»
#21
06/16/2011 (1:59 pm)
Hey peps,
looks like I got dragged in?!!? ;-)
I was going to wait till the weekend to post, as there are a lot more talented and experienced programmers than I, so I was hoping someone else would chime in!
But like most of us we want our packs now! So I hope I can help!!??!!

The PSK and iT2D does work, I have some issues myself but I think that's more my failing, and not the pack, the pack works fine in T2D, so if your talented I suspect you would have no problems.(at the moment I think my puppy is more talented than I!)

I have a version that was created for iT2D1.4, I'm not sure if that has been extended, since I was emailed it but I have merged with 1.5-preview, the merge is not for the faint hearted, but I am planning on releasing a diff back to the PSK community/Phillip O'Shea, if that helps anyone.

Is it worth getting? I would say YES, But make sure you get the PRO version as there is a lot of C++ code in the pack, AND you will not be able to compile an iPhone app with out it!!!!!!
There is a lot of code in the pack, that does actually cover some hurdles you would face in creating a platformer style game from scratch, and why reinvent the wheel??.

Does it work with iT2D out of the box? No,
the download version is only for T2D, the iT2D is currently emailed out upon request,
But I would say that is a good thing as you can get dirty with T2D and learn the pack, there is a lot in there and a lot too learn,
then once you are familiar with it then grab the iT2D version and go for it!
I hope that helps you
Steve
Page«First 1 2 Next»