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

#1 2012-06-26 10:25:34

reddy360
Scratcher
Registered: 2008-07-22
Posts: 8

Add a scratch coding language

I want scratch 2.0 to use a coding language I used a bit of Java and Lua to make this language

download the text doc here: http://www.mediafire.com/?7kfp2xcobd68w7z
or look here V

Motion
move () steps: moveSteps()
turn90 : turnClockWise()
turn-90 : turnAntiClockWise()
Point in Direction: pointDir()
PointTowards: pointTo()
gotoXY: goto(x, y)
glide to xy: glideTo(x,y)
Change x by(): changeX()
Set x to (): setX()
Change y by(): changey()
Set y to (): sety()
If on edge Bounce: ifOnEdgeBounce

x Position \
x Position   --- Can be used as a varible
Direction   /}

Control
When flag clicked:  onFlagClick{
    Code Goes Here
}
When (key) pressed: onKeyPress(){
    Code Goes Here
}
When Sprite clicked: on(SpriteName)Clicked{
    Code Goes Here
}
Wait () Secs: Wait()
forever: Forever{
    Code Goes Here
}
repeat(): Repeat(){
    Code Goes Here
}
broadcast(): Broadcast()
broacast () and wait: broadcastWithWait()
When i receive(): on()Recive{
    Code Goes Here
}
Forever If(): foreverIf(){
    Code Goes Here
}
if(): if(){
    Code Goes Here
}
else if: if(){
    Code
}else {
    Other Code
}
Wait Until: waitFor()
Repeat Until: repeatUntil{
    Code Goes Here
}
Stop Script: end //Put end at the end of the code btw // Will be a comment
Stop All: stopAll

Looks
Switch To Costume(): changeTexture(nameOfCostume)
Next Costume: changeTexture(costume++) //The ++ WIll mean add one and -- will take away one
Costume#: costume
say() for (): Print("Text", time)
say(): Print("Text")
Think() for (): think("Text", time)
Think(): think()
Change () effect by: effect.change()By()
Set () effect to(): effect.set()To()
Clear Graphic Effects:  effect.clear
Change Size By(): sizeSet(size + ())
Set Size To (): sizeSet()
[]Size: size //To check do size.show
show: show
hide: hide
Go To Front: goToFront
Go Back () Layers: layersBack()

Sensing
touching (): isTouching()
Touching Color (): isTouchingColor()
Ask (): ask("TEXT")
answer: Getanswer
mouse x: getMouseX
mouse y: getMouseY
Mouse Down?: isMouseDown
Key () Pressed: isKey()Pressed
Distance To (): getDistanceTo()
reset timer: timer.reset
timer: getTimer or timer.value
() of (): get()Of()
loudness: getLoud
loud?: isLoud

Sound
Play Sound(): sound.play()
Play Sound() Until Done: sound.play()UntilDone
Stop All Sounds: sound.stop
Play Drum () for () beats: sound.playDrum()For()
Rest For () Beats: sound.rest()
Play Note () for () beats: sound.playNote()For()
Set Instrument to (): sound.setInstrument()
Change Volume By(): sound.setVolume(Volume + ())
Set Volume (): sound.setVolume()
Volume: Volume
Change Tempo by (): sound.setTempo(Temp + ())
Set Tempo to (): sound.setTempo()
Tempo: Tempo

Operators
()+() \
()-()    \ Are the same
()*()   /
()/() /
Pick Random () to (): rand(1, 10)
()<()\
() sad )  |The same
()>()/
()and()\  The
()or()    /  Same
not(): !()
join(Hello )(world): "Hello " + "world"
Letter (1) of (world): getLetter(1)Of("World")
length of (world): getLength("world") or for a varable varName.length
()mod(): math.mod()
round(): math.round()
(sqrt) of (10): math.(sqrt, 10)

Pen
clear: pen.clear
pen down: pen.down
pen up: pen.up
set pen color: pen.setColorRGB(123,123,123)
change pen color by: pen.changeColor(10)
set pen color: color.setColor(0)
change pen shade by (10): pen.changeShade(10)
change pen shade to (50): pen.setShade(50)
change pen size by (10) pen.changeSize(10)
set pen size to (1): pen.setSize(1)
stamp: pen.stamp

Varables

I have a varable called test and a list called text

set test to (0): var.setVal(test, 0)
change test by (1): var.setVal(test, test + 1)
show variable test: var.show(test)
hide variable test: var.hide(test)

add thing to text:  list.add(thing, text)
delete 1 of text: list.delete(thing, 1, text)
insert thing at 1 of text: list.addAtNumber(thing, 1 ,text)
replace item 1 of text: list.replace(1, text)
item 1 of text: list.item(1, text)
length of text: list.text.length
text contains thing: list.contains(text, thing)

Last edited by reddy360 (2012-06-26 10:28:44)

Offline

 

#2 2012-06-26 10:45:24

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Add a scratch coding language

This isn't really help with scripts, it's more of a suggestion, so i'll move it there for you.

2.0 is going to remain block based programming, but you can check out M30W, a text based Scratch.  smile

Offline

 

#3 2012-06-27 09:55:15

jackrulez
Scratcher
Registered: 2009-08-01
Posts: 1000+

Re: Add a scratch coding language

Dude, turn off smileys. The block/smiley matcher is far too overenthusiastic.


Yawn, another boring text signature. I should really make something better.

Offline

 

#4 2012-06-27 17:10:43

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Add a scratch coding language

scimonster wrote:

2.0 is going to remain block based programming, but you can check out M30W, a text based Scratch.  smile

yeah, we got advertised by mod  wink

Offline

 

#5 2012-06-27 17:50:27

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: Add a scratch coding language

scimonster wrote:

This isn't really help with scripts, it's more of a suggestion, so i'll move it there for you.

2.0 is going to remain block based programming, but you can check out M30W, a text based Scratch.  smile

Though, theoretically, you could decompile the .sb2, edit the JSON with a text editor, then recompile it  tongue
Though it wouldn't be as easy as text based scratch

Last edited by SJRCS_011 (2012-06-27 17:50:54)


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

#6 2012-06-28 01:58:06

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Add a scratch coding language

This would be cool, but Scratch is block based on purpose (I think).


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#7 2012-06-28 05:37:00

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Add a scratch coding language

If you feel that you have outgrown Scratch, why not try another language, such as Processing, Java, C++, or JavaScript?


http://trinary.tk/images/signature_.php

Offline

 

#8 2012-06-28 09:38:33

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Add a scratch coding language

This has been suggested a lot in the past, and would definitely benefit Scratchers looking to venture into the scary world of text-based programming. I totally agree!

Offline

 

#9 2012-08-04 17:01:27

amaru2005
New Scratcher
Registered: 2012-05-20
Posts: 5

Re: Add a scratch coding language

the link of  http://www.mediafire.com/?7kfp2xcobd68w7z
say 404 not found  sad

Offline

 

#10 2012-08-06 07:21:56

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: Add a scratch coding language

Great idea, and it'll work quite well! But, Scratch is block-based so that it is easier to understand; Making it a text-based language kinda voids the whole thing. Like Paddle said, you should check out M30W, but Lua is also very easy. It's also easy to move on to Javascript after you've mastered Scratch.  smile


http://i50.tinypic.com/312u714.jpg

Offline

 

#11 2012-08-06 08:11:37

blargin
Scratcher
Registered: 2012-07-06
Posts: 49

Re: Add a scratch coding language

they should put in the scratchblocks language because it's easy to figure  out.

when gf clicked
repeat until <(timer) > [10]>
  go to [mouse-pointer v]
end
think [Scripts in your posts!] for (3) secs
when gf clicked
repeat until <(timer) > [10]>
  go to [mouse-pointer v]
end
think [Scripts in your posts!] for (3) secs

Last edited by blargin (2012-08-06 08:12:25)

Offline

 

Board footer