i'am making a game in which whenever you fire one of your weapon your power level decreases .... whenever i fire that weapon the bar of the counter decreases but when i switch to another weapon the bar increases again ( the value of the counter remains the same ) and when i switch back to that weapon in which the bar is decreased something like this happens to it ..... :
http://www.freewebs.com/rehansites2/whatthehell.jpg
WHAT SHOULD I DO NOW?
(\__/)
(='.'=This is Bunny. Copy and paste Bunny into ur
(")_(")signature to help him gain world domination.
Better idea is to change this counter with "Lives counter".
1. Create an active object which has movement with maximal speed 0. Make this one be controlled by "Player 2" or "Player 4" - this will give in event editor more "Players" (it gives control upon scores and lives of player 2, 3 and 4).
2. For example you'll use 2nd Player's lives to make a counter with "Lives counter". Hide your actual "Power" counter. It'll be still useful.
3. In "Lives object" setup in "Display as" select 'picture' and edit it to make 1px horizontal and (for example) 16px vertical lenght bar. This lives object will be used as a horizontal bar counter (that's why it is only 1px horizontally long)
Now example situation.
Let's say you had 262 pixel long counter. It had minimal value = 0, and maximal value = 1000.
Lives object must be Converted:
If "Power" = 0 -> lives = 0
If "Power" = 1000 (maximum) -> lives = 262
If "Power" = 500 (half) -> lives = 131
To make that add event:
1. Always
-> Set "Player 2" Lives to: ( Value("Power") * 262 ) / 1000.
Place "Lives object" where Counter was, and that's all.
Everytime when i will substract a value from the counter i'll bring the black bar to a new position ...... like POSITION X("BLACKBARNAME")-3 ....... so the blackbar will cover the red bar and it will look like the red bar is decreasing
(\__/)
(='.'=This is Bunny. Copy and paste Bunny into ur
(")_(")signature to help him gain world domination.