How do I keep same HUD for all levels

0 favourites
  • 5 posts
From the Asset Store
Use this epic life system with hearts like famous games in your game!
  • let's assume i'm making a platform game with 50 levels. so i will create 50 different layouts... i have a score and a health bar. do i have to write the event sheets again and again for keeping and displaying score and health? or is it possible to use a seperate event sheet for just keeping score, health etc.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Just make a layer called "Hud" or whatever you want it to be and make sure its the top one, then in the properties window. Set parallax to 0,0 for the layer.

    Setting parallax to 0,0 allow you to scroll the screen while always leaving the hud where you have placed it in the design view.

    Then all objects that are part of the Hud you make global, by selecting them and in the properties window you set global to true. Whenever you make a new layout you just duplicate this layout or you add a layer and call It "Hud" as well to avoid any unforeseen problems.

  • It's a little tedious to set up at first, but just have an event sheet for your ui that you include on every pertinent layout. Have a single event "On start of layout" and have it create the objects you use in your UI on your UI layer. So you still need to make a layer called UI or something, set it to 0,0 parallax and probably 0 for scaling, so don't forget to make the layer! But you can simply spawn in all of the objects you need and then have all of the events that control the elements in that included event sheet.

  • Yeah in my current project my UI is made up of around a hundred small pieces. What I am trying to do is to put all of them into a family, give the family instance variables of startx, starty and startangle, put them in place by hand on a layout, give the startx and starty values manually, then create them in the beginning of the layout in the correct order to prevent z-sorting related problems. This is not easy and alot of hassle, and also not fun but it's part of the work I guess...

    And that's not even counting that I have to manipulate the instance variables for various aspect ratios in-code... We really need a solution here, whether a plugin or an official update...

  • Three questions:

    1. Why 100 small objects, there must be an easier way..

    2. Why is the z-ordering important? Would using animationframes work for some of the objects?

    2. Would containers work for what you are trying to do?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)