Discuss Scratch

Moonflower88
Scratcher
6 posts

Defense Code

Hello. I´m making a game where you fight each other with umbrellas(don´t ask), and I have a costume which involves the character blocking the other with the umbrella. Is there any way I can code into the game a way where if the character or enemy touches the other while using the attack costume where the other has the defend costume on that they don´t take damage? So basically, I´m asking if there´s any way I can make it so that if a character has a certain costume on, and gets attacked, instead of taking damage, they block the damage and take no damage at all?
Theo_1er
Scratcher
500+ posts

Defense Code

if <([costume # v] of [Sprite1 v]) = [1]> then 
no damage
else
damage
end

Quand le risque est ridicule, la récompense est ridicule.
Moonflower88
Scratcher
6 posts

Defense Code

Theo_1er wrote:

if <([costume # v] of [Sprite1 v]) = [1]> then 
no damage
else
damage
end
Thank you!
Merci!

Powered by DjangoBB