This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-06-17 11:01:17

Raxonir
Scratcher
Registered: 2009-06-17
Posts: 1

Attack Question

Havn't been using Scratch for a long time so not sure whether this is advanced or not, but my question is:

If i have a character (like a stickman) and want to add several attacks that do seperate changes on variable (Health) when targetting another character.

And, Is there any way that I can use a specific attack to amplify the variable loss when hit by that attack?
Any ideas are welcomed

Offline

 

#2 2009-06-17 14:41:20

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: Attack Question

Make a variable called "Attack type", and a sprite called "PlayerAttack", then a broadcast "PlayerFire". Make several costumes for the attack sprite, which must correspond with Attack type variable. Then, for example:

Code:

When I receive [ PlayerFire ]
  if < (Attack type) = [ 2 ] >
    if <touching [ PlayerAttack ] ?>
      change (health) by [-10]

Converting my Scratch projects to Python!

Offline

 

Board footer