Change Character Direction By Bouncing Off Object BB2

Discussion in 'How Can I...?' started by steverha, Apr 9, 2016.

  1. steverha

    steverha Boxer

    Joined:
    Oct 8, 2015
    Messages:
    49
    Likes Received:
    16
    Alright guys... so I've spent a ridiculous amount of time trying to figure this out and I need help so if anyone could give me some sort of insight I would be beyond appreciative. I am using BB 2 Beta 5. The problem is as follows:
    The game direction is set at 0(moving to the right), its a side scrolling game, similar to an endless runner except the character isn't limited to moving only to the right. The character is moving at a speed of 55 on the x axis. The character controls are simple, you tap to jump and thats it.

    I want to create a scenario where if the character bounces off X object, the characters will switch directions and the game direction will be to the right(180). Basically, I want the character to hit the object, and move left... but theres no way of connecting the move left key to occur when colliding with an object(If i'm wrong please let me know!)

    I've tried the following:
    The default animation has the character faced to the right. The jump animation has the character faced to the right, and the animation is simply the flapping of a wing in the middle of the character.
    Using action to change gameplay from 0 to 180, and have replaced the character image with another image of the character flipped as the action animation. The problem with this is that when the character jumps again, the jump animation does not appear, and once the action timeout has expired, the character flips directions back to the default animation.

    I've tried using an advanced component and set it so when the character collides with X object, the x axis linear velocity of the game is set to -55, making the character move from right to left, and have replaced the character image with another image of the character flipped as the animation for the component. The problem with this is that when the character jumps again, the jump animation does not appear, and once the action timeout has expired, the character flips directions back to the default animation.

    I can't seem to figure any way around this.. I've messed with the gameplay settings, i've experimented with the characters gameplay settings by changing it from direct movement, forced movement, image direction, fixed rotation.. combinations of more than one of these.. and nothing seems to work. If anyone could help me out I would really appreciate it, this is beyond frustrating for me because it serves as a core element in my gameplay.
     
    Last edited: Apr 9, 2016
  2. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
    https://www.dropbox.com/s/6uejsunxfn5488v/back_and_forth.bbdoc?dl=0

    make sure the action duration is what you want... it will turn back around when the action ends, so 9999 would do it permanent... back threshold will be an issue though (i have them set to 5000), I don't know what you can get away with and not bog down device memory... also, the action gets used when hit... so if you want it to happen more than once, layer them like slices of bread. be sure to make the image opacity 0 as in the example (in the image editor) and make your game frame constrictive as in the example... I hope this is what you were looking for and I hope it helps.

    eidt: hmmm... one sec something changes when I download the bbdoc from what I have here on my puter...

    eidt: Ok... don't double click on it if you have more than one bb installed... it opens it beta 3 and freaked me out cuz of course it was broke... I almost went bald wondering what happened... open beta 5 first, then open the file from within 5...
     
    Last edited: Apr 9, 2016
  3. steverha

    steverha Boxer

    Joined:
    Oct 8, 2015
    Messages:
    49
    Likes Received:
    16
    I appreciate you taking the time to try and tackle the problem man! I have been able to accomplish what you had in the same file attached, but it doesn't solve the character image flipping 180 degrees whenever it changes directions. I need the character to rotate 180 degrees while being able to jump with the jump animation displaying. What I need it to do is basically mimic the left and right character controls with the keyboard that way the character still displays the jump animation when jumping.
    I posted the images in the files you gave me to show you where the problem lies, here's the link if you wanna take a look.

    https://drive.google.com/file/d/0B6BQcLqNBfa7cm11SFFuenVqdkE/view?usp=sharing
     
  4. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
    can you upload this as the actual .bbdoc file... I'm not sure what all those folders and .xml files are for...
     
  5. steverha

    steverha Boxer

    Joined:
    Oct 8, 2015
    Messages:
    49
    Likes Received:
    16
  6. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
    well... I'm not sure why this isn't working unless game direction doesn't change image direction by design... if you use the arrows to move the toon left or right, the image changes direction, even after the gameplay changes direction
     
  7. steverha

    steverha Boxer

    Joined:
    Oct 8, 2015
    Messages:
    49
    Likes Received:
    16
    Right? I can't figure it out man.... it's driving me insane, i've spent hours trying to figure it out. I may just email support about it because I don't know what else to do. I'm really trying to avoid using arrows to move left and right in the game but I may have to.
     
  8. abdussadik

    abdussadik Boxer

    Joined:
    Jan 12, 2016
    Messages:
    79
    Likes Received:
    12
    Hello @steverha, did you find the solution? thank you
     
  9. steverha

    steverha Boxer

    Joined:
    Oct 8, 2015
    Messages:
    49
    Likes Received:
    16
    Hey there @abdussadik, unfortunately I have not. I mean, I have solutions to it.. but I don't think its worth the trouble. It would require tremendous a tremendous amount of effort and there is a lot of room for error.
     
  10. abdussadik

    abdussadik Boxer

    Joined:
    Jan 12, 2016
    Messages:
    79
    Likes Received:
    12
    Hello @steverha, can you please share your solution?
     
  11. EZKad

    EZKad Avid Boxer

    Joined:
    Apr 26, 2016
    Messages:
    157
    Likes Received:
    155
    didn't tried it but here is a suggestion you can try :
    use the game X gravity for movement, and make sure to set maximum and minimum character velocity otherwise it can accelerate to some unplayable speed.
    then use an action that will switch the game direction and gravity.

    to adjust movement you can play with air drag values to get acceptable behavior.

    hope this can help :)
     
    Trudeau likes this.
  12. N7SO Archangel

    N7SO Archangel Boxer

    Joined:
    Apr 10, 2020
    Messages:
    4
    Likes Received:
    0
    years later I know, but try using the physics node for the character, and if collide node linked to a move node. Then set the direction and speed on collide.
     

Share This Page