What is the script required so when a certain Sprite is touching another Sprite, the Variable (for example Score) is changed by 1? On my game, when the Pirate Ship touches the gold coin, I want the variable - Score to increase by 1.
Thank you.
Offline
Sorry, this doesn't belong in this forum. A good place for a topic like this would be Help with Scripts. But anyway, onto your question:
(This would be in the Pirate Ship sprite)
when gf clicked forever if < touching [Gold Coin v] ? > change [Score] by [1] else end end
Last edited by ProgrammingPro01 (2013-04-12 14:56:27)
Offline
ProgrammingPro01 wrote:
Sorry, this doesn't belong in this forum. A good place for a topic like this would be Help with Scripts. But anyway, onto your question:
(This would be in the Pirate Ship sprite)when gf clicked forever if < touching [Gold Coin v] ?> change [Score] by [1] else end end
Fixed. Even though it's just one block.
Offline
twilightgem wrote:
What is the script required so when a certain Sprite is touching another Sprite, the Variable (for example Score) is changed by 1? On my game, when the Pirate Ship touches the gold coin, I want the variable - Score to increase by 1.
Thank you.
when gf clicked show forever if<touching gold coin> change [score] by(1)
when gf clicked forever if <[score]= [5]> broadcast [you win]
Last edited by joshuaho (2013-04-12 15:26:00)
Offline
joshuaho wrote:
twilightgem wrote:
What is the script required so when a certain Sprite is touching another Sprite, the Variable (for example Score) is changed by 1? On my game, when the Pirate Ship touches the gold coin, I want the variable - Score to increase by 1.
Thank you.when gf clicked show forever if<touching gold coin> change [score] by(1)when gf clicked forever if <[score]= [5]> broadcast [you win]
when gf clicked show forever if<touching [gold coin v]?> change [score] by(1)
when gf clicked forever if <(score)= [5]> broadcast [you win v]Fixed.
Offline
cobraguy wrote:
joshuaho wrote:
twilightgem wrote:
What is the script required so when a certain Sprite is touching another Sprite, the Variable (for example Score) is changed by 1? On my game, when the Pirate Ship touches the gold coin, I want the variable - Score to increase by 1.
Thank you.when gf clicked show forever if<touching gold coin> change [score] by(1)when gf clicked forever if <[score]= [5]> broadcast [you win]when gf clicked show forever if<touching [gold coin v]?> change [score] by(1)when gf clicked forever if <(score)= [5]> broadcast [you win v]Fixed.
Thank you, I am not that good in making scratchblocks.
Offline