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. Help and Support
  3. Enermy health bar

Enermy health bar

Scheduled Pinned Locked Moved Unsolved Help and Support
13 Posts 3 Posters 2.7k 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.
  • Aidan_FireA Aidan_Fire

    Give the enemy a Health Attribute and put them in a tag, make them spawn a health bar when they spawn. Make the health bar not scenery at first (so that it can collide with the enemy), collided with enemy group activates get Health attribute of that group and get position of that group, also turn on a timer that has both the get attribute and get position connected to it, then just add a few other behaviours under the timer only, like move to point get position (or you might like to add a value to the Y position so that it is above the enemy) and set health bar to the attribute. Probably also should set health bar to scenery when that's done. I'm not sure if there's a better way, but that's how I do it, if it's too hard to understand I can try to make some screenshots. EDIT: this does not work as health bars aren't allowed to collide.

    DGames135D Offline
    DGames135D Offline
    DGames135
    wrote on last edited by
    #3

    @Aidan-Oxley I don't get this. Can you show an example?

    Aidan_FireA 1 Reply Last reply
    0
    • DGames135D DGames135

      @Aidan-Oxley I don't get this. Can you show an example?

      Aidan_FireA Offline
      Aidan_FireA Offline
      Aidan_Fire
      wrote on last edited by Aidan_Fire
      #4

      Hmm I'm gonna have to think of another way, health bars aren't allowed to collide. This might end up being fairly complex, instead of showing screenshots I'll post an example to the hub when I'm done (and add another comment in forums to say it's done).

      DGames135D 1 Reply Last reply
      0
      • Aidan_FireA Aidan_Fire

        Hmm I'm gonna have to think of another way, health bars aren't allowed to collide. This might end up being fairly complex, instead of showing screenshots I'll post an example to the hub when I'm done (and add another comment in forums to say it's done).

        DGames135D Offline
        DGames135D Offline
        DGames135
        wrote on last edited by
        #5

        @Aidan-Oxley It doesn't really have to be health bars above thir heads. I just wanted a way so that each enermy has it's own health but I just thought that health bars might look cool

        Aidan_FireA Jack de WildeJ 2 Replies Last reply
        0
        • DGames135D DGames135

          @Aidan-Oxley It doesn't really have to be health bars above thir heads. I just wanted a way so that each enermy has it's own health but I just thought that health bars might look cool

          Aidan_FireA Offline
          Aidan_FireA Offline
          Aidan_Fire
          wrote on last edited by
          #6

          Yeah it would look cool, I am gonna make it work (nearly done already). I've never made a game myself with hovering health bars above spawned objects.

          Aidan_FireA 1 Reply Last reply
          0
          • Aidan_FireA Aidan_Fire

            Yeah it would look cool, I am gonna make it work (nearly done already). I've never made a game myself with hovering health bars above spawned objects.

            Aidan_FireA Offline
            Aidan_FireA Offline
            Aidan_Fire
            wrote on last edited by
            #7

            It's done, but I might need to add a few comments and stuff in to make it easier to understand, I will upload it in less than or about 3 hours from now (I'm about to go out, won't be able to use my iPad for a bit).

            1 Reply Last reply
            0
            • DGames135D DGames135

              @Aidan-Oxley It doesn't really have to be health bars above thir heads. I just wanted a way so that each enermy has it's own health but I just thought that health bars might look cool

              Jack de WildeJ Offline
              Jack de WildeJ Offline
              Jack de Wilde
              wrote on last edited by Jack8680
              #8

              @DGames135 This is knew of those things that should be simple but sadly isn't, because there is no way to select a spawned object without using collisions. The workaround is to use dynamic attributes on a non-spawned object to transfer information between the spawned objects, using an ID to specify which. Here is an example project.

              For example, to get the health of the object with ID 2 you would get the attribute "2 Health". It's an inefficient way to do it and I hope Aidan has a better way, but this is all I can think of. With my method you'd probably want to avoid having more than 6 health bars.

              Alternatively, if you don't want visible health bars, you could just use an attribute in the enemy called health, and when it gets hit, subtract from that, if it's less than 0 kill it, but this doesn't look as nice.

              Aidan_FireA 1 Reply Last reply
              0
              • Jack de WildeJ Jack de Wilde

                @DGames135 This is knew of those things that should be simple but sadly isn't, because there is no way to select a spawned object without using collisions. The workaround is to use dynamic attributes on a non-spawned object to transfer information between the spawned objects, using an ID to specify which. Here is an example project.

                For example, to get the health of the object with ID 2 you would get the attribute "2 Health". It's an inefficient way to do it and I hope Aidan has a better way, but this is all I can think of. With my method you'd probably want to avoid having more than 6 health bars.

                Alternatively, if you don't want visible health bars, you could just use an attribute in the enemy called health, and when it gets hit, subtract from that, if it's less than 0 kill it, but this doesn't look as nice.

                Aidan_FireA Offline
                Aidan_FireA Offline
                Aidan_Fire
                wrote on last edited by Aidan_Fire
                #9

                @Jack8680 that's pretty much how I did it, will upload to hub soon

                1 Reply Last reply
                0
                • Aidan_FireA Offline
                  Aidan_FireA Offline
                  Aidan_Fire
                  wrote on last edited by
                  #10

                  It's on the hub now.

                  DGames135D 2 Replies Last reply
                  0
                  • Aidan_FireA Aidan_Fire

                    It's on the hub now.

                    DGames135D Offline
                    DGames135D Offline
                    DGames135
                    wrote on last edited by
                    #11

                    @Aidan-Oxley Omg thanks. Didn't have time to check it but I will

                    1 Reply Last reply
                    0
                    • Aidan_FireA Aidan_Fire

                      It's on the hub now.

                      DGames135D Offline
                      DGames135D Offline
                      DGames135
                      wrote on last edited by
                      #12

                      @Aidan-Oxley Ok I checked it and I kinda get it. The thing I got is that you have to give each enermy and health bar a id but the rest of the spawning mechanisms I don't get. Also the combining text is confusing.

                      Aidan_FireA 1 Reply Last reply
                      0
                      • DGames135D DGames135

                        @Aidan-Oxley Ok I checked it and I kinda get it. The thing I got is that you have to give each enermy and health bar a id but the rest of the spawning mechanisms I don't get. Also the combining text is confusing.

                        Aidan_FireA Offline
                        Aidan_FireA Offline
                        Aidan_Fire
                        wrote on last edited by
                        #13

                        @DGames135 If you can't figure it out, you can just try to copy it behaviour for behaviour. All the combine text does is combines the words Xposition, Yposition or Health with its ID, all the spawning does is adds 1 to the ID attribute then spawns an enemy and a health bar to go with it.

                        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