Jump to content

Recommended Posts

Posted

Hi there,

Is there an easy way to substract from a variable?

I am creating a little game in which you have 3 lives, I need to substract 1 every time a certain thing happens that should make you lose one.

I tried the following:

$Lives = 3

(...)
if (certain thing happens) then

$Lives-1

(...)

If $Lives = 0 Then
MsgBox ( 0, "Game Over", "Game Over" )

Now my problem is that "$Lives-1" doesn't seem to be a valid command

Any help is much appreaciated.

P.S: I cna also post my full code, but I'd rather keep the forum clean and thought this would do.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...