Jetpack style - Acceleration & move behaviors
hi guys,
I think I would need some help to find out what to do in order to produce a behavior similar to the one used in Jetpack Joyride for iOS and Android.
The thing is that I need to make an object move from left to right at an increasing speed.
What I did:
Accelerate behavior for the objet set to direction: 0 and acceleration: 200 (relative to scene)
then I need to make the object move up when touching the screen
What I did:
Rule/ when touch = 1 (touch attribute)
--> Move (dir: 60 relative to scene / stacked + Speed: 350)
--> Accelerate (dir: 0 relative to scene + acceleration: 200)
My problem is that when playing the test, the object move from left to right, but when Im touching the screen to make it goes up, there is some latency and he stop using the accelerate behavior to use only the move behavior. Is there something to do to make it work at the same time?
Thank a lot for any comment!!!!
SKYone
I think I would need some help to find out what to do in order to produce a behavior similar to the one used in Jetpack Joyride for iOS and Android.
The thing is that I need to make an object move from left to right at an increasing speed.
What I did:
Accelerate behavior for the objet set to direction: 0 and acceleration: 200 (relative to scene)
then I need to make the object move up when touching the screen
What I did:
Rule/ when touch = 1 (touch attribute)
--> Move (dir: 60 relative to scene / stacked + Speed: 350)
--> Accelerate (dir: 0 relative to scene + acceleration: 200)
My problem is that when playing the test, the object move from left to right, but when Im touching the screen to make it goes up, there is some latency and he stop using the accelerate behavior to use only the move behavior. Is there something to do to make it work at the same time?
Thank a lot for any comment!!!!
SKYone
Comments
http://www.deepblueapps.com/jetpack-template/
Timer: Every 0 sec/
change attribute to self.position.X to Self.Position.X+Z (Z is a speed value)
I woudl look for a better solution. I think it's simple and too stupid to find it...
By the way, Im not sure that answering question with content to purchase is a good way to create a community... Anyway, thanks for you marketing comment.
This made me see that there is no "disagree", or "not helpful" buttons. It would be interesting to lower comment visibility by using such buttons.
But I would have offered other advice because i would dislike it if I asked a question and didn't get a free response.
Do when I get home ( good be few hours) will have a quick test around for you, only because i dont like the idea of you only getting a paid solution
Elfizm
So I am not to sure what you after exactly but here is what I did.
Created an actor and made a behavior called change velocity to go right at speed of 50.
Then has a rule that says when touched,
Accelerate up relative to scene at speed of 50
Otherwise accelerate down relative to scene at speed of 50.
Works for me but it may be what you want.
Elfizm
I had a similar issue with the Move behavior overriding other acceleration rules. Basically (as I learned), the Move behavior does just that: it overrides other forces on an actor.
In my case I needed the actor to "move" in the direction it was rotating but also maintain speed. So I used some trig to constrain the x and y linear velocities (linear x = cos(self.rotation) * speed, etc.). This makes the actor move with the rotation but does not override it's speed.
Cheers!
~Jim