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

#1 2012-02-21 20:03:09

imsosuperswell1
Scratcher
Registered: 2010-12-04
Posts: 1000+

Another simple question

Ok so in my game I have a thing where you press X and two things come up to give something experience. My character runs over them initiating the experience. Then they hide. But I want it to not be re-used to give infinate experience so how do I stop the effects of the X button?

Last edited by imsosuperswell1 (2012-02-21 20:03:50)


http://i43.tinypic.com/34y3brb.png

Offline

 

#2 2012-02-21 20:17:50

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: Another simple question

when gf clicked
set (sprite works v) to [1]
forever
if <(Sprite works) = [1]>
wait until <touching (sprite1 v)?>
your script here
set (sprite works v) to [2]


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#3 2012-02-21 20:51:46

imsosuperswell1
Scratcher
Registered: 2010-12-04
Posts: 1000+

Re: Another simple question

Nothing near what I am trying to state.


http://i43.tinypic.com/34y3brb.png

Offline

 

#4 2012-02-21 20:58:29

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Another simple question

Slayerrobe's script is relevant.

when gf clicked
set [exp v] to (0)
set [exp_enabled v] to (1)
forever
    if <(exp_enabled) = (1)>
        wait until <touching [sprite1 v]?>
        change [exp v] by (1)
        set [exp_enabled v] to (0)
    end

Last edited by Magnie (2012-02-21 20:58:58)

Offline

 

#5 2012-02-21 21:00:31

imsosuperswell1
Scratcher
Registered: 2010-12-04
Posts: 1000+

Re: Another simple question

Do you want me to actually show you the script I am trying to use but failed? I may can't cause I fail at the scratchblock thing.


http://i43.tinypic.com/34y3brb.png

Offline

 

#6 2012-02-21 21:05:19

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Another simple question

imsosuperswell1 wrote:

Do you want me to actually show you the script I am trying to use but failed? I may can't cause I fail at the scratchblock thing.

The script does exactly what you want. The sprite that the character walks over, waits until the user walks over it, and then it gives 1 exp then it won't give anymore after that.

Last edited by Magnie (2012-02-21 21:05:57)

Offline

 

#7 2012-02-22 08:03:59

imsosuperswell1
Scratcher
Registered: 2010-12-04
Posts: 1000+

Re: Another simple question

But the script is enabled by the X button which broadcasts Item, then the script initaites. So can you incorperate that into there?


http://i43.tinypic.com/34y3brb.png

Offline

 

#8 2012-02-22 09:26:41

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Another simple question

when gf clicked
set [button_pressed? v] to (1)
forever
    if <(button_pressed?) = (1)>
        wait until <touching [sprite1 v]?>
        broadcast [Item v]
        set [button_pressed? v] to (0)
    end
How about that? You could also use this script:

when gf clicked
set [button_pressed? v] to (1)
forever
    if <<(button_pressed?) = (1)> and <touching [sprite1 v]?>>
        broadcast [Item v]
        set [button_pressed? v] to (0)
    end
And whenever you want to reactivate the button or deactivate, you can just set the button_pressed? variable to 0 to deactivate or 1 to activate.  smile

Offline

 

#9 2012-02-22 20:34:09

imsosuperswell1
Scratcher
Registered: 2010-12-04
Posts: 1000+

Re: Another simple question

No, I am not changing it being activated by the X button. If only I showed you the script so you could see. You know what join.me is? Its a site letting you see my screen, what time will you be on tomorrow? I will give you the link and you will see my screen and I will show you the screen.


http://i43.tinypic.com/34y3brb.png

Offline

 

#10 2012-02-22 20:46:59

videogame9
Scratcher
Registered: 2008-05-12
Posts: 1000+

Re: Another simple question

when gf clicked
set [buttonpressed v] to [0] //This is so the button can be pressed the first time.
forever
if <<key [x v] pressed?> and <(buttonpressed) = [0]>>
broadcast [show the experience whatevers v]
set [buttonpressed v] to [1] //This stops the button from working in the future.
end
end
Comments are broken, apparently.

Last edited by videogame9 (2012-02-22 20:49:12)


http://img641.imageshack.us/img641/4118/newvg9logo.png
QUOTE OF THE RIGHT NOW: why are we arguing about dead babies? -videogame9

Offline

 

#11 2012-02-22 22:49:53

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Another simple question

imsosuperswell1 wrote:

No, I am not changing it being activated by the X button. If only I showed you the script so you could see. You know what join.me is? Its a site letting you see my screen, what time will you be on tomorrow? I will give you the link and you will see my screen and I will show you the screen.

Could you upload the project/script? I don't feel like installing new software, sorry.

Or could you explain exactly what you are trying to do? Do you want a one-time button? Cause the scripts we are giving are one-time buttons.

Offline

 

#12 2012-02-22 23:27:32

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Another simple question

First of all, you need to explain it clearly.

"two THINGS (?!?!) pop up" what things? sprites? how do they give experience? if you want us to help you, you need to ask it clearly.
Don't ask 22+ and expect to get 4.

Secondly, viewers of join.me can view directly in the browser.

Third, you do realize you can just take a picture of your scripts, right?

Offline

 

#13 2012-02-22 23:32:56

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Another simple question

kayybee wrote:

First of all, you need to explain it clearly.

"two THINGS (?!?!) pop up" what things? sprites? how do they give experience? if you want us to help you, you need to ask it clearly.
Don't ask 22+ and expect to get 4.

Secondly, viewers of join.me can view directly in the browser.

Third, you do realize you can just take a picture of your scripts, right?

Ah okay.

Also, basically what he's saying is the code of conduct: http://scratch.mit.edu/forums/viewtopic … 2#p1147782

Explain everything as clearly and detailed as possible.

Offline

 

#14 2012-02-25 12:15:16

imsosuperswell1
Scratcher
Registered: 2010-12-04
Posts: 1000+

Re: Another simple question

Well guys I figured it out. I had to add the stop script to the activation script and it worked. Oh well, close it mods!


http://i43.tinypic.com/34y3brb.png

Offline

 

#15 2012-02-25 12:16:39

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: Another simple question

imsosuperswell1 wrote:

Well guys I figured it out. I had to add the stop script to the activation script and it worked. Oh well, close it mods!

Did you report it?


Get ready for domination of:  tongue

Offline

 

#16 2012-02-26 13:51:57

imsosuperswell1
Scratcher
Registered: 2010-12-04
Posts: 1000+

Re: Another simple question

Nope..... reporting to close now.


http://i43.tinypic.com/34y3brb.png

Offline

 

#17 2012-02-26 15:32:41

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Another simple question

imsosuperswell1 wrote:

Nope..... reporting to close now.

Will do.  smile


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer