The Daily Click ::. Forums ::. Klik Coding Help ::. Whats happening to the counter?
 

Post Reply  Post Oekaki 
 

Posted By Message

Heart Break Kid



Registered
  13/05/2003
Points
  1754
26th April, 2005 at 11:27:39 -

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.

Klik with the kid!

BROO2



Registered
  23/12/2004
Points
  106
26th April, 2005 at 11:58:45 -

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.

Image Edited by the Author.

 
multi

Heart Break Kid



Registered
  13/05/2003
Points
  1754
26th April, 2005 at 14:48:03 -

well i have a better idea then

Simply take two active objects ...... for e.g

[A RED BAR OBJECT HERE][A BLACK BAR OBJECT HERE]

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.

Klik with the kid!

BROO2



Registered
  23/12/2004
Points
  106
27th April, 2005 at 06:30:54 -

Smart . If you have black background then surely it'll be good.

Note that method with "Lives Object" will be good on every background and for every Counter max&min value.

In my opinion 2 active objects is just tu much complication.

 
multi
   

Post Reply



 



Advertisement

Worth A Click