Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Negative Variable in CopperCube

dynamogames
Registered User
Quote
2023-07-27 22:46:05

I'm creating a system in my game, where I assign a variable called "Bullet Count" which stores the number of bullets the player has at a particular time which for instance, has a count of 25 (bullets). Bullet Count reduces as players shoot at enemies, but when the player shoots enemies and Bullet Count reaches 0(zero), I want the count to stop at zero and not go to negative numbers. CopperCube moves from 0 to negative numbers.


count2rfeit
Registered User
Quote
2023-07-28 00:42:06

use the "if a variable has a value do something" action.
bullet count < (smaller than) 0 (zero) then set action to:
"Set or change a value" to:
bullet count = (equal) 0 (zero)

that way, if bullet count goes below 0 (zero), it will be made back to 0 (zero)


dynamogames
Registered User
Quote
2023-07-28 13:43:52

Thanks so much!


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact