Hold for power
MattVollet
Member Posts: 86
I just began working with Gamesalad today and I am really enjoying it, I was having a little problem getting what I want to get working (though I know it's possible)
I want to be able to hold down my finger (on iphone) on a football that charges the speed it will be tossed at, then on release it accelerates at an angle dictated by the X,Y of the iPhone accelerometer.
I tried looking into the cannon example and couldn't really get what I wanted from it. Can anyone help out?
Thanks a lot.
I want to be able to hold down my finger (on iphone) on a football that charges the speed it will be tossed at, then on release it accelerates at an angle dictated by the X,Y of the iPhone accelerometer.
I tried looking into the cannon example and couldn't really get what I wanted from it. Can anyone help out?
Thanks a lot.
Comments
2) Create two game integer attributes (call them targetX and targetY or something)
3) In the target actor constrain game.targetX to self.position.X and constrain game.targetY to self.position.Y
4) Then in the football create an integer attribute called powerup (or something like that). In the football have a rule:
when touch is pressed
Timer - (EVERY)
.1 second (play around with this amount)
change attribute - self.powerup to self.powerup+1 (may need to do +10 or something - play aruond with it)
rule
when touch is released
acclerate toward (use game.targetX for the horizontal coordinant and use game.targetY for the vertical)
amount use self.powerup
Haven't ever tried this but it seems like it will work.
Good luck!
Welcome to the GS community!