Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Need help with experience bar

Author
Message
Red Rain
15
Years of Service
User Offline
Joined: 28th Aug 2009
Location:
Posted: 26th Jan 2010 18:05
I'm working on a Role Player Game which of all of you know needs to include an experience point gaudge to level up your character, right? I've made my gaudge sprite and a box text to incress the length when the character gains experience. But when the character levels up to 2, needing more experience to level up again. The box text exceeds longer then my sprite gaudge. How do I stop it from doing this from going beyong my gaudge?
Teh Stone
14
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 26th Jan 2010 18:44
Post code I'll try to help
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 26th Jan 2010 20:13
Have a look at this link, might be what you are after in the code it show how to keep a bar at x length but the value you are using is bigger than the bars length.

http://forum.thegamecreators.com/?m=forum_view&t=161256&b=6

Dark Physics makes any hot drink go cold.
Red Rain
15
Years of Service
User Offline
Joined: 28th Aug 2009
Location:
Posted: 27th Jan 2010 04:07
Here's my coding so far. It's pretty much all in text just to make things easyier

Red Rain
15
Years of Service
User Offline
Joined: 28th Aug 2009
Location:
Posted: 29th Jan 2010 16:00
I've upgraded it some what. But still need help

CodeCriminal
14
Years of Service
User Offline
Joined: 29th Jan 2010
Location:
Posted: 30th Jan 2010 03:27
Think percentages, instead of having the gauge measured by the actual XP gained, do something like this

( CurrentXp / NextLvlXp ) * HealthBarWidth

then no mater what amount of XP is needed the bar should never exeed its 'container'

PS: i hope i understood your problem correctly, your last update didnt have any 'sprite' drawing of any kind... then again i wouldnt really know, im new to darkbasic (using it at college) im a C++ programmer myself
NightX
15
Years of Service
User Offline
Joined: 3rd Apr 2009
Location: Australia, QueensLand
Posted: 11th Feb 2010 13:46
i edited your code, i would make it different but for the sake of it, here u go -


chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 11th Feb 2010 14:41
A little bit different.




cheers.

learning every day

Login to post a reply

Server time is: 2024-11-24 20:31:33
Your offset time is: 2024-11-24 20:31:33