# subtract math

0 favourites
• 12 posts
From the Asset Store
Aliens are invading our planet! Solve the math question, and attack the alien with your laser. Covers addition, subtract
• Score = 100.

Let's set "move"= 34 and "kill"= 30.

If "move" greater than "kill", for each 1 unit(example: 31,32,33), subtract from "score" 5 unit.

• anyone ?

• There's no question here.

• Score = 100.

Let's set "move"= 34 and "kill"= 30.

If "move" greater than "kill", for each 1 unit(example: 31,32,33), subtract from "score" 5 unit.

How can i subtract 5 unit from score for each 1 unit of "move"greater than "kill"

• It's very hard to recommend any course of action without having a frame of reference. What exactly are you trying to accomplish? What is a unit? Are Score, Move, Kill all variables? If so, global variables or instance variables?

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• zatyka My english is very bad, and it's so hard to provide.

Try it again, for example, i have 3 global variables. First called "move", second called "kill", and third called "score". I set "move" = 8, "kill" = 5, "score" = 100. How can i subtract 5 score from "score" if global "move" greater than global "kill". If "move" = 7 then "score" = 95, "move" = 6, "score" = 90...

• It seems self explanatory. I don't see what the problem is.

<img src="http://puu.sh/2qqou.jpg" border="0" />

<img src="http://puu.sh/2qqpu.jpg" border="0" />

<img src="http://puu.sh/2qqqo.jpg" border="0" />

• ``score = score - (move - kill) * 5``

or maybe

``score = max(0, score - (move - kill) * 5)``

if you don't want it to go below 0.

• ramones, thank god ! you understand me... it's work. Thank you, thank you.

• Next time, tell people what is your main language. There might be people using your language.

• ramones, thank god ! you understand me... it's work. Thank you, thank you.

Still need help or did you get it working? I'm guessing you understand it now

• retrodude, it's work for me now.

• 12 posts