Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Comments & Feedback
  3. Behavior Request: Colliding

Behavior Request: Colliding

Scheduled Pinned Locked Moved Comments & Feedback
11 Posts 3 Posters 2.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Thecheater887
    wrote on last edited by
    #1

    While colliding is sufficient in most cases, but it doesn't return if it is being activated, and runs every Frame.

    I need a "Colliding" behavior. Tags work like Collided does, however, instead of checking if they are colliding, and executing an event, it returns a bool attribute "Colliding", telling whether or not the object or objects are colliding.

    This frees up some performance space, as it is invoked by the user, not by the mainloop, and allows for better mathematics in-game.

    For instance:
    If Object B is colliding with Object C and if not already triggered: add 1 to AmountColliding;
    If object B is not colliding with object C and if not already triggered: subtract 1 to AmountCollding;
    Finally subtract AmountColliding from HP;

    Michael KhalfinG 1 Reply Last reply
    1
    • T Thecheater887

      While colliding is sufficient in most cases, but it doesn't return if it is being activated, and runs every Frame.

      I need a "Colliding" behavior. Tags work like Collided does, however, instead of checking if they are colliding, and executing an event, it returns a bool attribute "Colliding", telling whether or not the object or objects are colliding.

      This frees up some performance space, as it is invoked by the user, not by the mainloop, and allows for better mathematics in-game.

      For instance:
      If Object B is colliding with Object C and if not already triggered: add 1 to AmountColliding;
      If object B is not colliding with object C and if not already triggered: subtract 1 to AmountCollding;
      Finally subtract AmountColliding from HP;

      Michael KhalfinG Offline
      Michael KhalfinG Offline
      Michael Khalfin
      wrote on last edited by
      #2

      @Thecheater887 you could already do this! Without the behavior!

      timer (every 0 seconds)

      Get position (of selected object)
      If (get position X > x)
      If (get position X < y)
      If (get position Y < z)
      If (get position Y < n)
      behaviors...

      The ifs set the object boundary.
      They can be changed using "set input field" behaviors per moving object.
      It's harder but it works!

      T 1 Reply Last reply
      0
      • Michael KhalfinG Michael Khalfin

        @Thecheater887 you could already do this! Without the behavior!

        timer (every 0 seconds)

        Get position (of selected object)
        If (get position X > x)
        If (get position X < y)
        If (get position Y < z)
        If (get position Y < n)
        behaviors...

        The ifs set the object boundary.
        They can be changed using "set input field" behaviors per moving object.
        It's harder but it works!

        T Offline
        T Offline
        Thecheater887
        wrote on last edited by
        #3

        @GameCRAZY Thanks, but I need to be tag and loop heavy when using this in most cases, so having this for say 250 different object would bog down the project a LOT.

        Additionally, I see "if"s like hammers.

        A necessary tool, but deadly when misused. There it would be like giving 1000 three year olds hammers, letting the, loose, and expecting them all to behave and survive.

        This for the suggestion though! I'll use it in smaller projects!

        Michael KhalfinG 1 Reply Last reply
        0
        • T Thecheater887

          @GameCRAZY Thanks, but I need to be tag and loop heavy when using this in most cases, so having this for say 250 different object would bog down the project a LOT.

          Additionally, I see "if"s like hammers.

          A necessary tool, but deadly when misused. There it would be like giving 1000 three year olds hammers, letting the, loose, and expecting them all to behave and survive.

          This for the suggestion though! I'll use it in smaller projects!

          Michael KhalfinG Offline
          Michael KhalfinG Offline
          Michael Khalfin
          wrote on last edited by
          #4

          @Thecheater887 I'm using it for my level creator in my game. It's a pretty big scene and will be a huge system. Thing is, it isn't causing me any bugs.

          It's hint you could still get what you want out of the sequence. If behaviors are one of the most important behaviors.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Thecheater887
            wrote on last edited by
            #5

            What device are you on? I'm on an older one, and any time I have 250 "if"s running, my game slows down to a crawl.

            Michael KhalfinG 1 Reply Last reply
            0
            • T Thecheater887

              What device are you on? I'm on an older one, and any time I have 250 "if"s running, my game slows down to a crawl.

              Michael KhalfinG Offline
              Michael KhalfinG Offline
              Michael Khalfin
              wrote on last edited by
              #6

              @Thecheater887 I'm on a first generation iPad Mini. I have tons of lag - but this isn't inluded in my list :)

              T 1 Reply Last reply
              0
              • Michael KhalfinG Michael Khalfin

                @Thecheater887 I'm on a first generation iPad Mini. I have tons of lag - but this isn't inluded in my list :)

                T Offline
                T Offline
                Thecheater887
                wrote on last edited by
                #7

                @GameCRAZY I'm on iPad mini 2, and lots of lag as well, unfortunately, the ifs are on my list XD

                1 Reply Last reply
                0
                • iTap DevelopmentI Offline
                  iTap DevelopmentI Offline
                  iTap Development
                  wrote on last edited by
                  #8

                  If I understand your question, the simplest way to do this is to have an attribute with a default of 0 and when the objects collide set the attribute to 1 then when they stop colliding set it back to 0.
                  So, all you have to do is to get that attribute and if it is equal to 1 that means they are currently colliding!
                  Hope this makes sense, if you have any questions about this just ask!

                  Michael KhalfinG 1 Reply Last reply
                  1
                  • iTap DevelopmentI iTap Development

                    If I understand your question, the simplest way to do this is to have an attribute with a default of 0 and when the objects collide set the attribute to 1 then when they stop colliding set it back to 0.
                    So, all you have to do is to get that attribute and if it is equal to 1 that means they are currently colliding!
                    Hope this makes sense, if you have any questions about this just ask!

                    Michael KhalfinG Offline
                    Michael KhalfinG Offline
                    Michael Khalfin
                    wrote on last edited by
                    #9

                    @iTap-Development ooh, I like that one... Works in most cases... Sounds so good... XD.

                    iTap DevelopmentI 1 Reply Last reply
                    0
                    • Michael KhalfinG Michael Khalfin

                      @iTap-Development ooh, I like that one... Works in most cases... Sounds so good... XD.

                      iTap DevelopmentI Offline
                      iTap DevelopmentI Offline
                      iTap Development
                      wrote on last edited by
                      #10

                      @GameCRAZY thanks! Just curios, you said works on most cases...what cases would it NOT work on? I'm not saying there aren't any!

                      Michael KhalfinG 1 Reply Last reply
                      0
                      • iTap DevelopmentI iTap Development

                        @GameCRAZY thanks! Just curios, you said works on most cases...what cases would it NOT work on? I'm not saying there aren't any!

                        Michael KhalfinG Offline
                        Michael KhalfinG Offline
                        Michael Khalfin
                        wrote on last edited by
                        #11

                        @iTap-Development I'm not sure XD.

                        1 Reply Last reply
                        0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Search