How do I Create a power meter

0 favourites
  • 4 posts
From the Asset Store
75 power-up sound effects; bonus and notification sounds, fanfares, harp glissandi, stabs, clock ticks, etc.
  • Hey, I was wondering if you guys could point me in the direction of creating a power meter that fluxuates, as in, a little "cursor" goes up and down on the power meter and depending on when i press the activate button, the cursor stops, and the meter logs the value associated with that area on the meter. I would like to make a simple little game and that would be the perfect system to build it on. Thanks!

  • on event move (image +1 )

    like while mouse over

    on even end set position to org. location

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • All you need to do to log the position is to know the Y values from start to finish in the meter area and translate those values to your reading value. Then you just grab the current Y value (assuming X is constant) with Pointer.Y stored in instance variable that you compare with your actual values.. ie Y for meter = 100-300 you could output using Pointer.Y = <50 text = POWER: 100% or whatever...

    If your meter was exactly 100 pixels tall (or wide.. using X instead) it would be easy to translate to a 1-100% value to post to player (or show on meter) using (gulp) math... say you use Y pixel value 200-300 you could simply assign the Pointer.Y to a variable and subtract 200 for a 1-100% value... etc otherwise you would need to use complex math or a long series of value = result = value conditions.

    You could use a SINE behavior to make the pointer actually move up and down and use stop SINE behavior to make it stop at any point you choose.

  • Thanks guys

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