ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator Negative Variable in CopperCube
person icon
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.

person icon
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)

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

Thanks so much!


Create reply:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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