Step By Step Explanation Needed For Pinball Flipper Logic.

Discussion in 'How Can I...?' started by Jeroen, Nov 28, 2018.

  1. Jeroen

    Jeroen Boxer

    Joined:
    Nov 26, 2018
    Messages:
    5
    Likes Received:
    0
    Hi!

    I am a newby considering Buildbox and I would love to get started on a pinball game. I have an idea in mind, but before I can get started developing I need to figure out the basics of the flippers (when selecting the gameplay type).

    It does not seem to be a simple object with a rotation point that makes a certain movement once it's activated. There seems to be some sort of workaround for it and I can't get my head around it.

    I've been looking at a video from Al Cox: but it's not helping really.

    Is it possible for someone to give me a tutorial or the simple basics on building a working flipper in Buildbox 2?
     
  2. AaroArts

    AaroArts Miniboss Boxer

    Joined:
    Jun 22, 2016
    Messages:
    1,546
    Likes Received:
    826
    You need to create an Object and offset it’s center in the Animation Frame.

    For example, a Flipper that is 100x20 should be moved by 50 pixels so the pivot is on the end of the Object.

    Then you add an Advanced Move that rotates it by X amount with a short Time Out.
     
    Christoph likes this.
  3. Jeroen

    Jeroen Boxer

    Joined:
    Nov 26, 2018
    Messages:
    5
    Likes Received:
    0
    Thank you @AaroArts . That part was clear to me.

    Problem is that when you hit the flipper again within the timeout, it will rotate even further and not get back to it's original position.
     
  4. AaroArts

    AaroArts Miniboss Boxer

    Joined:
    Jun 22, 2016
    Messages:
    1,546
    Likes Received:
    826
    You can add a second Advance Move and check the “Activate on Release” and rotate it back.
    So after you tap and the Flipper moves, it moves back to the original position.
    I can provide a BBDoc if you want.
     
    Christoph likes this.
  5. Jeroen

    Jeroen Boxer

    Joined:
    Nov 26, 2018
    Messages:
    5
    Likes Received:
    0
    @AaroArts I would love that, because I keep running into timing problems. So your example will always reset to static position no matter if it's not done with the rotation?

    Thanks in advance for the effort. I appriciate it!
     
  6. AaroArts

    AaroArts Miniboss Boxer

    Joined:
    Jun 22, 2016
    Messages:
    1,546
    Likes Received:
    826
    Check out this BBDoc.
    It's a bit cleaner than the default Pinball Preset.
    It could probably be fine tuned further to suit your game but gives you an idea.
     

    Attached Files:

    Christoph and steves like this.
  7. Jeroen

    Jeroen Boxer

    Joined:
    Nov 26, 2018
    Messages:
    5
    Likes Received:
    0
    @AaroArts Thank you so much my friend! You've given me something great to start working on! I will look into this!
     
  8. Jeroen

    Jeroen Boxer

    Joined:
    Nov 26, 2018
    Messages:
    5
    Likes Received:
    0
    @AaroArts Ok, this works really well. Next challenge is: How do I add a bumper that accelerates the ball upon hit (for like 2 seconds or so)?

    I tried adding an action, but they disappear after they are hit once. Can you tell me what to do (or what to add) to make a permanently functioning bumper?
     
  9. AaroArts

    AaroArts Miniboss Boxer

    Joined:
    Jun 22, 2016
    Messages:
    1,546
    Likes Received:
    826
    There’s a couple of ways and it really depends on the set up of your game.

    One way is to add Advanced Moves to the Walls or Character which change the Characters velocity with a short Time Out.

    Another way, similar to what you were already exploring is to place an Action inside an Object, then place the Object inside the Bumper Object and spawn it every second or so.
     

Share This Page