System - Loop and Progress Bar as XP Bar

Just started using Construct 2? Post your questions here

Post » Thu Dec 01, 2016 3:48 am

Sprite as Mouse Cursor (Solved). Under no circumstance, it seems, will it use the image as the mouse cursor. I figure this is probably something I'm doing or not doing.

EDIT: This does work in Chrome, however. Did not work in FireFox.

However, a new problem has emerged. I tried using the System - Loop function to repeat by adding 5 points to a progress bar each time something was killed. Having this in the event sheet causes the game and browser to crash, it seems.

Also...
Monster - On Destroyed - Add 5 to EXP (Progress Bar)

Nothing happens. What is wrong with this line of coding, why does it not work?
B
6
S
3
Posts: 9
Reputation: 568

Post » Fri Dec 02, 2016 2:30 pm

Not sure why you are wanting to loop the event, just call the function (I assume that adds the +5) each time something is killed.

As far as not showing on progress bar.. did you update the bar after adding the +5?
If you are using a standard X pixel long rectangle then modifying it in increments to make it longer/shorter you will need to redraw it at its new length each time it changes.
The easiest way to do this is to have an EXP variable that is updated each time something adds EXP and then set the length of the EXP BAR to EXP variable each time it needs updating (every time you change the value).
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Sat Dec 03, 2016 7:01 am

Well, I don't know if it was technically a "Loop", but the idea behind it was so that for every enemy killed it repeats the +5 addition to the progress bar. I gave up on trying to use the Progress Bar as an EXP bar. But every other way is a lot more complicated it seems. I have since tried different methods however. Thanks for reply.
B
6
S
3
Posts: 9
Reputation: 568

Post » Sun Dec 04, 2016 12:35 pm

Try this tutorial on bars.. https://www.scirra.com/tutorials/182/making-a-fancy-lifebar

You can also search the tutorials section for lots of tutorials on health/exp bars.
You will also find many forum threads on this topic by searching for "health bar" in the "How do I" forum area.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Tue Dec 13, 2016 1:07 pm

you might want to look at doing your own custom progress bar. if you want something like a gradual bar with exp. this part is fairly easy just use one color bar and in the action just set the width or height to your desire place. If i remember right there a fairly easy code where you can use % to control the action of your progress bar using current data and max data point so that it flows evenly.

the construct two progress bar is the worst and offer no flexiability. So id would just custom build your own.
B
52
S
24
G
6
Posts: 391
Reputation: 7,855


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest