Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 1,203 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
PANEL digits #373599
06/11/11 12:16
06/11/11 12:16
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline OP
Junior Member
Minamato  Offline OP
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Hey guyz!

Back again in A8-forums, I have another question wink
I think it is a kind of a noob-question...hehe...whatever grin

Code:
digits(360, 10, "Leben: %.f", arial_font, 1, leben);



In the format-tag, here "Leben: %.f", the variable "leben" shall be shown as a round lot without decimal places. I have programmed that the game stops when the player's live comes to 0. But I've noticed that the variable can also be negative (in my case items are falling down and they have to be collected - the game stops at 0, but an item can still drop down. if that happens, the variable "leben" shows -1).
Is it possible, to change the format-tag in "digits" so that the variable cannot be shown negative? Or is it wiser to change it in some way within the code?

Hope you can help!

Greetz, Minamato

Re: PANEL digits [Re: Minamato] #373630
06/11/11 14:24
06/11/11 14:24
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline OP
Junior Member
Minamato  Offline OP
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
push grin

Re: PANEL digits [Re: Minamato] #373635
06/11/11 15:30
06/11/11 15:30
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
you can't do it directly within the digits(...);

you'll need a second variable to display which only equal leben when it's greater than -1

Re: PANEL digits [Re: MrGuest] #373637
06/11/11 15:44
06/11/11 15:44
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline OP
Junior Member
Minamato  Offline OP
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
can you please give me an example?

Re: PANEL digits [Re: Minamato] #373640
06/11/11 15:55
06/11/11 15:55
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
digits(360, 10, "Leben: %.f", arial_font, 1, leben_display);

Code:
void main(){
...

  while(1){
    if(leben > 0){
      leben_display = leben;
    }else{
      leben_display = 0;
    }
    wait(1);
  }
}



Re: PANEL digits [Re: MrGuest] #373642
06/11/11 16:03
06/11/11 16:03
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline OP
Junior Member
Minamato  Offline OP
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
thanks =)


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1