if buy_apples_sen.positive:
# Here we check if you have enought money to buy an apple
if owner["Money in pocket"] - owner["Apples price"] >= 0:
# Here we increment your number of apples by one
owner["Apples in pocket"] += 1
# Here we reduce your money amount depending
# on the price of an apples.
owner["Money in pocket"] -= owner["Apples price"]
# this line look if the bananas sensor is activated
if buy_bananas_sen.positive:
# Here we check if you have enought money to buy a bananas
if owner["Money in pocket"] - owner["Bananas price"] >= 0:
# Here we increment your number of bananas by one
owner["Bananas in pocket"] += 1
# Here we reduce your money amount depending
# on the price of a bananas.
owner["Money in pocket"] -= owner["Bananas price"]
What we are confused about is, the script says that it first wants to check whether the apple button sensor is activated by using the line "if buy_apples_sen.positive;". We understand that the 'positive;' means that its checking whether the button is pressed. This should mean that the button is labeled ''buy_apples_sen" or "buy_apples". But the thing is its not named that way. Anyways, we posted our question on a blender blog, should be very soon before the Canadian guy answers.
i'll have to look into this with you two when i get back. let me know if you get any reply from the forum.
ReplyDelete