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

#1 2011-10-13 07:52:52

Babado
Scratcher
Registered: 2011-09-15
Posts: 84

Unlocking spells!

So, say I want certain spells to be unlocked when the good guy kills certain things how would I go around doing that?

I thought.

When which death recieved
If
Key 3 pressed.

But then realized key pressing can not be added into a script <.< Anyone got a way to make it so if he kills something, he can then use  a certain spell?

Offline

 

#2 2011-10-13 15:18:54

Babado
Scratcher
Registered: 2011-09-15
Posts: 84

Re: Unlocking spells!

No answers yet ? D=

Offline

 

#3 2011-10-13 15:57:10

legoscratch
Scratcher
Registered: 2010-06-18
Posts: 100+

Re: Unlocking spells!

Yes, you actually can add a key press in to a script.
<key[ 3 ]pressed?> in the sensing category.


Or do you mean automatically pressing a key?  That you can't do.

What you can do is add a variable, like "can use spell?" and set it to true if he can, and false if he can't.
Then change your script for using this spell to look like this:

When key [3] pressed
If <((can use spell))=(true)> {
   --do whatever the spell is here
   /*Here, if you want to you can add a [set "can use spell?"] to (false)] block to make him only able to use the spell once.*/
}


If you are having trouble with simple counting, use the following mnemonic device: 1 comes before 2 comes before 5,280 comes before 523,860,759 comes after the square root of -153 comes before π. This will make your previous counting problems seem like no big deal.

Offline

 

#4 2011-10-13 16:11:24

Babado
Scratcher
Registered: 2011-09-15
Posts: 84

Re: Unlocking spells!

Automaticaly pressing a key? Nope. Just if they kill certain bad guys, then go on to press key 4 whenver they want, it does that

Offline

 

Board footer