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

Comments

  • creativeappscreativeapps Member Posts: 1,770
    Here is the template available for that

    http://www.deepblueapps.com/jetpack-template/
  • MrSKYoneMrSKYone Member Posts: 26
    Ok, I found something but I don't think it's cool...

    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...
  • MrSKYoneMrSKYone Member Posts: 26
    Im not asking about a Joyride template, but a tips on how to fix abehavior issue.
    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.
  • ElfizmElfizm Member Posts: 489
    edited November 2012
    @creativeapps was offering a solution to a paid template that wasnt his. Because if you look at other people templates you learn. He was just putting out an option for you to look out

    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
  • ElfizmElfizm Member Posts: 489
    @MrSKYone Here i am as promised :)

    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
  • jjramire83jjramire83 Member Posts: 1
    MrSKYone,

    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
Sign In or Register to comment.