I've come to a spot where I need Else or an Else If and there are no such blocks in Scratch. Has someone created an addition with those blocks in them?
There's If and If Else, but no Else or Else If ... is there a way for me to add Else blocks to Scratch easily or is it fairly complex and not worth the effort?
Offline
I think I can help you; I'll get back to you once I've finished.
Offline
It doesn't seem like it works too well.
For now I think you should just go with what you already have.
Offline
MabonBaladevaKain wrote:
is there a way for me to add Else blocks to Scratch easily or is it fairly complex and not worth the effort?
Extremely complex (but possible) and not worth the effort at all. Just put an 'if' into the bottom space in an 'if else.'
If you really want to make an else if block, reply back.
Offline
ScratchReallyROCKS wrote:
Extremely complex (but possible) and not worth the effort at all.
I just learned that the hard way
Offline
I'd also like to see some While blocks .... do those exist somewhere?
Does one of those things like BYOB or Panther or that other one have these sort of blocks?
Offline
MabonBaladevaKain wrote:
I'd also like to see some While blocks .... do those exist somewhere?
Does one of those things like BYOB or Panther or that other one have these sort of blocks?
Instead of While, Scratch has Repeat Until. Just put the condition you need inside a "Not" block. So
While (condition) Do whatever EndWhile
In Scratch would be:
Repeat until NOT(condition) Do whatever EndRepeat
Just one of those things with a simple workaround.
Last edited by Harakou (2010-07-29 17:37:29)
Offline
Harakou wrote:
MabonBaladevaKain wrote:
I'd also like to see some While blocks .... do those exist somewhere?
Does one of those things like BYOB or Panther or that other one have these sort of blocks?Instead of While, Scratch has Repeat Until. Just put the condition you need inside a "Not" block. So
Code:
While (condition) Do whatever EndWhileIn Scratch would be:
Code:
Repeat until NOT(condition) Do whatever EndRepeatJust one of those things with a simple workaround.
Uh, a while block is just the forever if block. No workarounds needed.
Offline
ScratchReallyROCKS wrote:
Harakou wrote:
MabonBaladevaKain wrote:
I'd also like to see some While blocks .... do those exist somewhere?
Does one of those things like BYOB or Panther or that other one have these sort of blocks?Instead of While, Scratch has Repeat Until. Just put the condition you need inside a "Not" block. So
Code:
While (condition) Do whatever EndWhileIn Scratch would be:
Code:
Repeat until NOT(condition) Do whatever EndRepeatJust one of those things with a simple workaround.
Uh, a while block is just the forever if block. No workarounds needed.
Nope, because
1) Forever if constantly checks for the given condition once it is executed.
2) Other scripts can't be placed under it.
While/repeat until checks for the given condition only as it reaches that point, and when the condition is no longer true, moves on to the scripts after it and stops checking. Forever if is actually equivalent to
Forever If (condition) code EndIf EndForever
Last edited by Harakou (2010-07-29 17:58:01)
Offline
Harakou wrote:
ScratchReallyROCKS wrote:
Harakou wrote:
Instead of While, Scratch has Repeat Until. Just put the condition you need inside a "Not" block. SoCode:
While (condition) Do whatever EndWhileIn Scratch would be:
Code:
Repeat until NOT(condition) Do whatever EndRepeatJust one of those things with a simple workaround.
Uh, a while block is just the forever if block. No workarounds needed.
Nope, because
1) Forever if constantly checks for the given condition once it is executed.
2) Other scripts can't be placed under it.
You always find a flaw in my theorizing.
Offline
ScratchReallyROCKS wrote:
Harakou wrote:
ScratchReallyROCKS wrote:
Uh, a while block is just the forever if block. No workarounds needed.Nope, because
1) Forever if constantly checks for the given condition once it is executed.
2) Other scripts can't be placed under it.You always find a flaw in my theorizing.
Hey, I'm just sayin'
Wait, is that a bad thing, or you mean I'm helpful at catching mistakes? I hope it's the second, I don't mean to be mean.
Offline
Harakou wrote:
ScratchReallyROCKS wrote:
Harakou wrote:
Nope, because
1) Forever if constantly checks for the given condition once it is executed.
2) Other scripts can't be placed under it.You always find a flaw in my theorizing.
Hey, I'm just sayin'
![]()
Wait, is that a bad thing, or you mean I'm helpful at catching mistakes? I hope it's the second, I don't mean to be mean.
It was more meant to be a joke. (I should have added a )
Offline
Harakou wrote:
ScratchReallyROCKS wrote:
It was more meant to be a joke. (I should have added a
)
Oh, I see now. Let me correct your post for you then:
ScratchReallyROCKS wrote:
You always find a flaw in my theorizing.
![]()
![]()
(uhh, my tongue is getting dry from sticking it out so much
(grr! there I go again!) )
Offline
:p
I'm stuck already.
Pretty bad at Scratch, heh.
Klik & Play is easier.
Thanks for advice on the While thing ... it sorta confuses me though, wonder why they didn't just include a while ... <shrugs>
Oh, I have another question ... how can I make it so when pointing in a direction, the sprite does not flip upside down?
Do I have to make a left facing sprite and a right facing sprite and use extra code?
Or is there a better way?
Offline
MabonBaladevaKain wrote:
Oh, I have another question ... how can I make it so when pointing in a direction, the sprite does not flip upside down?
Do I have to make a left facing sprite and a right facing sprite and use extra code?
Or is there a better way?
Yes, there is a better way. On the top of the script panel, above the tabs for scripts, costumes and sounds, there is a picture of the sprite. On the left of it are 3 buttons. Click the second button down and you should be all set!
EDIT: 14 posts and I'm at 1000!
Last edited by ScratchReallyROCKS (2010-07-29 22:45:18)
Offline
MabonBaladevaKain wrote:
:p
I'm stuck already.
Pretty bad at Scratch, heh.
Klik & Play is easier.
Thanks for advice on the While thing ... it sorta confuses me though, wonder why they didn't just include a while ... <shrugs>
Oh, I have another question ... how can I make it so when pointing in a direction, the sprite does not flip upside down?
Do I have to make a left facing sprite and a right facing sprite and use extra code?
Or is there a better way?
It depends. Do you want it to face only left/right, or just spin 360 degress around, but not be upside down? If the former, then use ScratchReallyROCKS's suggestion. If the latter, then yes, make another costume that is upside down (copy the original costume and use the vertical flip button in the sprite editor), and use something like this:
When Green Flag Clicked Forever If <Direction < 0> Switch to costume upside_down else Switch to costume normal EndIf
Last edited by Harakou (2010-07-29 23:24:54)
Offline
Sweet! .. I didn't notice those buttons were there.
Thank you ScratchReallyROCKS!
Kewl, that could come in handy later on.
Thank you Harakou!
You guys are great
Offline
MabonBaladevaKain wrote:
Sweet! .. I didn't notice those buttons were there.
Thank you ScratchReallyROCKS!
Kewl, that could come in handy later on.
Thank you Harakou!
You guys are great![]()
You're welcome! I only come to the's forums to help.
Offline