chat about it views!!
I thought of this a long time ago, but never got around to it.
scratch_blox.js is a JavaScript library to help make games in JavaScript. It uses functions that have block names and you call them to make things do stuff.
Example:
$(document).ready(function(){
!forever{
show("#pic");
waitSeconds(5);
hide("#pic");
waitSeconds(5);
}
});In this example, the script shows the pic, waits 5 seconds, hides the pic, waits 5seconds, then repeats it forever.
This is a simple way for people who understand scratch to create JavaScript games.
I need developers and testers. Ask me and I'll put you in the box.
GP1 — head developer
ProgrammingFreak — developer
WindowsExplorer — tester
Guinea_Pig_Girl — tester
gbear605 — developer
bobbybee — developer
ohaiderstudios — tester
Downloads: unavailable: not debugged properly, so we're starting over.
Last edited by GP1 (2011-08-26 17:46:01)
Offline
Cool idea! I always wanted to jearn JavaScript! Whens it going to be out?
Offline
Oh wow. I have wanted to do this forever, but no one seemed to be interested in helping!
I will help but first you need to look at these articles.
They are helpful.
http://www.admixweb.com/2009/05/20/how- … rk-part-1/
http://blogs.vertigo.com/personal/rbigg … .aspx?ID=8
Offline
ProgrammingFreak wrote:
Oh wow. I have wanted to do this forever, but no one seemed to be interested in helping!
I will help but first you need to look at these articles.
They are helpful.
http://www.admixweb.com/2009/05/20/how- … rk-part-1/
http://blogs.vertigo.com/personal/rbigg … .aspx?ID=8
Thanks, I'll look at them and put you in the box. Lol, I wanted to do this so that I could make games with js easy smeasy
Offline
In your example, you are using some jQuery code.
Offline
okay
Offline
GP1 wrote:
@pf those are really helpful. I need help with a block, more info in the chat room.
Okay. When are you normally on?
Offline
Wow! That looks like an amazing idea!
Offline
veggieman001 wrote:
Wow! That looks like an amazing idea!
![]()
It really is.
Offline
YAY!! I just got done with a lot of new blocks
I'm done with numbers and looks and control
And now I am done with sensing for version 1
Last edited by GP1 (2011-08-15 13:54:07)
Offline
We are now ready for testing. Sorry, pf, I kinda took over. Could you find out how to play sounds in js?
Anyway, I will edit the first post with directions.
Offline
These are the list of control blocks and what version they are in, along with the funciton.
[blocks]<when green flag clicked> not supported
____________________________________________________________________________________
<when[ ]key pressed> v1
$(document).keydown(funciton(){
//select to wich key here
if(keyDownBool('key here') ){
//code for game here
}
});
___________________________________________________________________________________
<wait( )secsc> v1
waitSecondsThen(numberOfSeconds, function(){
//code to execute after num of seconds go by
});
___________________________________________________________________________________
<when[ ]clicked> v1
$("#idOfImageHere").click(function(){
//code when id is clicked
});
___________________________________________________________________________________
<forever> v1
forever(function(){
//code to repeat forever
});
___________________________________________________________________________________
<repeat( )> v1
repeat(numberOfTimesToRepeat, function(){
//code to be repeated the # of times
});
___________________________________________________________________________________
<broadcast[ ]> v1 as function
ex.
function nameOfFuntion(){
//code when called
//code won't be executed until you call the funtion
}
//anywhere in code
nameOfFunction();
__________________________________________________________________________________
<broadcast[ ]and wait c> not supported
__________________________________________________________________________________
<when I receive[ ]> as function
__________________________________________________________________________________
<forever if> v1
foreverIf(someSortOfBooleanAnswer, function(){
//code here
});
__________________________________________________________________________________
<if> v1
if(statement here){
//code here
}
__________________________________________________________________________________
<if><else> v1
if(statement here){
//code
}else{
//code
}
_________________________________________________________________________________
<wait until> not supported
_________________________________________________________________________________
<repeat until> v1
repeatUntil(booleanStatment, function(){
//code here
});
_________________________________________________________________________________
<stop script>not supported
_________________________________________________________________________________
<stop all> v1
exit;
_________________________________________________________________________________
Last edited by GP1 (2011-08-15 15:00:25)
Offline
These are the list of motion blocks and what version they are in, along with the function.
[blocks]<turn cw( )degrees> v1
turnRight(idOfPicture, numberOfDegrees);
___________________________________________________________________________________
<turn cw( )degrees> v1
turnLeft("#idOfPicture", numberOfDegrees);
___________________________________________________________________________________
<go to x
)y
)> v1
goTo("#idOfPicture", xPosition, yPosition);
___________________________________________________________________________________
<move( )steps> not supported
___________________________________________________________________________________
<if on edge, bounce> not supported
___________________________________________________________________________________
<glide( )secs to x
)y
)> not supported
___________________________________________________________________________________
<point in direction( )> not supported
___________________________________________________________________________________
<change x by( )> not supported
___________________________________________________________________________________
<point towards( )> not supported
___________________________________________________________________________________
<direction> not supported
___________________________________________________________________________________
<x position> v1
xpos("#idOfPicture");
___________________________________________________________________________________
<y position> v1
ypos("#idOfPicture");
___________________________________________________________________________________
<change y by( )> not supported
___________________________________________________________________________________
<set x to( )> v1
setXpos("#idOfPicture", numberOfXPosition);
___________________________________________________________________________________
<set y to( )> v1
setYpos("#idOfPicture", numberOfYPosition);
___________________________________________________________________________________
<go to[ anotherImage ]> v1
goToOther("#idOfImageGoing", "#idOfOtherImage");
___________________________________________________________________________________
<go to[ mouse ]> v1
goToMouse("#idOfImage");
___________________________________________________________________________________
Offline
@pragrammingfreak could you look the code over? Something is wrong and the code won't execute.
http://kitcatprogramming.net78.net/test … ch_blox.js
EDIT: I named the file scratch_blocks.js instead of scratch_blox.js LOL
I'm going to fix that.....
Last edited by GP1 (2011-08-15 16:20:39)
Offline
GP1 wrote:
@pragrammingfreak could you look the code over? Something is wrong and the code won't execute.
http://kitcatprogramming.net78.net/test … ch_blox.js
EDIT: I named the file scratch_blocks.js instead of scratch_blox.js LOL
I'm going to fix that.....
I'll see what I can do!
Offline
When is the last time it worked? That could help me narrow it down.
Uh, also, are we gonna have it look like scratch or just a textarea? or you use the source plain?
Offline
ProgrammingFreak wrote:
When is the last time it worked? That could help me narrow it down.
Uh, also, are we gonna have it look like scratch or just a textarea? or you use the source plain?
one version like scramble, another is plain source. Also, I never got the chance to try it out until I finished it
Offline