GP1 wrote:
rdococ wrote:
Key codes are important for DSi Scratch, so here's a table:
Code Button
13 A
37 Left
38 Up
39 Right
40 Down
EDIT: Can I help? I know Javascript, and even if I don't know a few commands, I will search for the commands on w3schools.those will help. BTW, comp500, is Go Everywhere a javascript thing? I know it well enough and I am learning on how to make games with it. that might help.
Yup.
YaY! PaGe 13!!!!!!!!!!!!!!
Last edited by comp500 (2011-06-27 13:30:37)
Offline
For advertising:
A site to use the source code of: http://3dsplaza.com/home.php
Offline
comp500 wrote:
GP1 wrote:
rdococ wrote:
Key codes are important for DSi Scratch, so here's a table:
Code Button
13 A
37 Left
38 Up
39 Right
40 Down
EDIT: Can I help? I know Javascript, and even if I don't know a few commands, I will search for the commands on w3schools.those will help. BTW, comp500, is Go Everywhere a javascript thing? I know it well enough and I am learning on how to make games with it. that might help.
Yup.
YaY! PaGe 13!!!!!!!!!!!!!!
I can start on ds for you, or the wii. I'll do more research on javascript, I only read the beginners books at my library, but theres Googles!
Last edited by GP1 (2011-06-27 14:47:09)
Offline
I have a code from the internet, modified to be a block code
<HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4)); var _all = ''; var _style = ''; var wwidth, wheight; var ydir = '++'; var xdir = '++'; var id1, id2, id3; var x = 1; var y = 1; var x1, y1; if(!isNS) { _all='all.'; _style='.style'; } function getwindowsize() { clearTimeout(id1); clearTimeout(id2); clearTimeout(id3); if (isNS) { wwidth = window.innerWidth - 55; wheight = window.innerHeight - 50; } else { wwidth = document.body.clientWidth - 55; wheight = document.body.clientHeight - 50; } id3 = setTimeout('randomdir()', 20000); animate(); } function randomdir() { if (Math.floor(Math.random()*2)) { (Math.floor(Math.random()*2)) ? xdir='--': xdir='++'; } else { (Math.floor(Math.random()*2)) ? ydir='--': ydir='++'; } id2 = setTimeout('randomdir()', 20000); } function animate() { eval('x'+xdir); eval('y'+ydir); if (isNS) { pic1.moveTo((x+pageXOffset),(y+pageYOffset)) } else { pic1.pixelLeft = x+document.body.scrollLeft; pic1.pixelTop = y+document.body.scrollTop; } if (isNS) { if (pic1.top <= 5+pageYOffset) ydir = '++'; if (pic1.top >= wheight+pageYOffset) ydir = '--'; if (pic1.left >= wwidth+pageXOffset) xdir = '--'; if (pic1.left <= 5+pageXOffset) xdir = '++'; } else { if (pic1.pixelTop <= 5+document.body.scrollTop) ydir = '++'; if (pic1.pixelTop >= wheight+document.body.scrollTop) ydir = '--'; if (pic1.pixelLeft >= wwidth+document.body.scrollLeft) xdir = '--'; if (pic1.pixelLeft <= 5+document.body.scrollLeft) xdir = '++'; } id1 = setTimeout('animate()', 30); } // End --> </script> </HEAD> <!-- STEP TWO: Insert the event handlers into your BODY tag --> <BODY OnLoad="getwindowsize()" OnResize="getwindowsize()" background="space.jpg"> <!-- STEP THREE: Copy this code into the BODY of your HTML document --> <div id="pic1" style="position:absolute; visibility:visible; left:0px; top:0px; z-index:-1"> <img src="alien.gif" border="0"> </div> <script language="javascript"> var pic1=eval('document.'+_all+'pic1'+_style); </script> <!-- end of move: steps block -->
I just copied and pasted this code from the internet. Just wanted to share it to all the other devs before I change the code. ONE THING. you need two pictures to run the code, so don't even try. I think that we will need php scripts for the pictures, as well as javascript, as javascript can't do it all! it would also be a good way to save projects. you could save them in a text document then load them in php and tell javascript the info, then it would load the projects into the viewer. i can do php if you want.
Offline
AND ANOTHER! sorry for posting so many posts, but I can't keep a little something to myself. here is a non-edited script for the [blocks]<set size to( )%> <set[ ]effect to( [/blocks]
<HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Original: Mike Dransfield (mike@blueroot.net) --> <!-- Web Site: http://mike.dransfield.org/ --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin var ival, imgname, total, steps, maxx, maxy, currentx, currenty, dx, dy; function zoomImg(imgname, total, steps, maxx, maxy) { // convert the total from seconds to miliseconds total = total * 1000; objref = eval("document.getElementById('"+imgname+"')"); currentx = objref.width; currenty = objref.height; // work out how much we need to increase the image by each step // devide image sizes by number of steps to get the amount we need to change each step stepx = maxx / steps; stepy = maxy / steps; // devide the total time (in ms) by the number of steps to get the interval time inttime = total / steps; // set the interval to increase the size of the image by the required pixels functionRef = "resizeImg('"+imgname+"', "+stepx+", "+stepy+", "+maxx+", "+maxy+")"; ival = setInterval(functionRef, inttime); } function resizeImg(imgname, dx, dy, maxx, maxy) { objref = eval("document.getElementById('"+imgname+"')"); currentx = objref.width; currenty = objref.height; if ((currentx<maxx-dx) && (currenty<maxy-dy)) { objref.height = currenty + dy; objref.width = currentx + dx; } else { clearInterval(ival); objref.height = maxy; objref.width = maxx; } } // End --> </script> </HEAD> <!-- STEP TWO: Insert the onLoad event handler into your BODY tag --> <BODY onLoad="zoomImg('test', 10, 150, 300, 200)"> <!-- STEP THREE: Copy this code into the BODY of your HTML document --> <div align="center"><img src="img.gif" name="test" id="test" height="2" width="3"></div>
these codes might help other programmers with their device and codes.
EDIT: I forgot that everybody was working together. I am used to working by myself. LOL Any way, you can make lots of different blocks with this one
Last edited by GP1 (2011-06-27 17:17:15)
Offline
comp500 wrote:
GP1 wrote:
BTW, do you just want the scratch blocks, or do you want any custom blocks as well?
Maybe. Probably like scratch 2.0
that will take more programming for the BYOB feature. I have a code for the clone me block and the delete me block.
Offline
the device detection is almost complete. hey guys! this little code might help us:
var agent = navigator.userAgent.toLowerCase(); if (agent.indexOf('iphone') != -1) { // iPhone Device // If it is an iPhone put specific code to run here for iPhone users } else if (agent.indexOf('android') != -1) { // Google phones running Android OS // If it is a Google phone put specific code to run here for Android users }
it will sense ANY kind of device (ex. computer, type of phone, nitendo, psp, etc.) I will take the list of devices on the front page (testing devices) and make sensors for them. we can put the edited code into them
Offline
I got the final code for it:
document.write("you need javascript to run Go Everywhere."); var agent = navigator.userAgent.toLowerCase(); if (agent.indexOf('iphone') != -1) { // iPhone Device // If it is an iPhone put specific code to run here for iPhone users } else if (agent.indexOf('android') != -1) { // Google phones running Android OS // If it is a Google phone put specific code to run here for Android users } else if ('wii' != -1) { //wii // If it is a wii, then put the wii code in here } else if ('ipod' != -1) { //ipod touch // If is an ipod, then put the ipod code in here } else if ('ipad' != -1) { //ipad // If it is an ipad, then put the ipad code here } else if ('DS' != -1) { //DS // If it is a ds, then put the ds code here } else if ('3DS' != -1) { //3DS // If it is a 3DS, then put the code here } else if ('DSi' != -1) { //DSi //if it is a DSi, then put the code here } else { document.write('You must be on a computer or a non-registered device. go to the <a href="http://scratch.mit.edu/forums/viewtopic.php?pid=774559#p774559">Go Everywhere disscussion</a> and tell us what your device is. Thank you.'); }
all I need to know is what we're doing next.
Offline
GP1 wrote:
I got the final code for it:
Code:
document.write("you need javascript to run Go Everywhere."); var agent = navigator.userAgent.toLowerCase(); if (agent.indexOf('iphone') != -1) { // iPhone Device // If it is an iPhone put specific code to run here for iPhone users } else if (agent.indexOf('android') != -1) { // Google phones running Android OS // If it is a Google phone put specific code to run here for Android users } else if ('wii' != -1) { //wii // If it is a wii, then put the wii code in here } else if ('ipod' != -1) { //ipod touch // If is an ipod, then put the ipod code in here } else if ('ipad' != -1) { //ipad // If it is an ipad, then put the ipad code here } else if ('DS' != -1) { //DS // If it is a ds, then put the ds code here } else if ('3DS' != -1) { //3DS // If it is a 3DS, then put the code here } else if ('DSi' != -1) { //DSi //if it is a DSi, then put the code here } else { document.write('You must be on a computer or a non-registered device. go to the <a href="http://scratch.mit.edu/forums/viewtopic.php?pid=774559#p774559">Go Everywhere disscussion</a> and tell us what your device is. Thank you.'); }all I need to know is what we're doing next.
Well... I think it MIGHT not work, I will test android with emulator ( )
But anyway I'm doing a different method, switch.
Last edited by comp500 (2011-06-28 12:11:21)
Offline
GP1 wrote:
the device detection is almost complete. hey guys! this little code might help us:
Code:
var agent = navigator.userAgent.toLowerCase(); if (agent.indexOf('iphone') != -1) { // iPhone Device // If it is an iPhone put specific code to run here for iPhone users } else if (agent.indexOf('android') != -1) { // Google phones running Android OS // If it is a Google phone put specific code to run here for Android users }it will sense ANY kind of device (ex. computer, type of phone, nitendo, psp, etc.) I will take the list of devices on the front page (testing devices) and make sensors for them. we can put the edited code into them
I do not believe you.
Offline
comp500 wrote:
GP1 wrote:
I got the final code for it:
Code:
document.write("you need javascript to run Go Everywhere."); var agent = navigator.userAgent.toLowerCase(); if (agent.indexOf('iphone') != -1) { // iPhone Device // If it is an iPhone put specific code to run here for iPhone users } else if (agent.indexOf('android') != -1) { // Google phones running Android OS // If it is a Google phone put specific code to run here for Android users } else if ('wii' != -1) { //wii // If it is a wii, then put the wii code in here } else if ('ipod' != -1) { //ipod touch // If is an ipod, then put the ipod code in here } else if ('ipad' != -1) { //ipad // If it is an ipad, then put the ipad code here } else if ('DS' != -1) { //DS // If it is a ds, then put the ds code here } else if ('3DS' != -1) { //3DS // If it is a 3DS, then put the code here } else if ('DSi' != -1) { //DSi //if it is a DSi, then put the code here } else { document.write('You must be on a computer or a non-registered device. go to the <a href="http://scratch.mit.edu/forums/viewtopic.php?pid=774559#p774559">Go Everywhere disscussion</a> and tell us what your device is. Thank you.'); }all I need to know is what we're doing next.
Well... I think it MIGHT not work, I will test android with emulator ( )
But anyway I'm doing a different method, switch.
Works!
Offline
comp500 wrote:
GP1 wrote:
I got the final code for it:
Code:
document.write("you need javascript to run Go Everywhere."); var agent = navigator.userAgent.toLowerCase(); if (agent.indexOf('iphone') != -1) { // iPhone Device // If it is an iPhone put specific code to run here for iPhone users } else if (agent.indexOf('android') != -1) { // Google phones running Android OS // If it is a Google phone put specific code to run here for Android users } else if ('wii' != -1) { //wii // If it is a wii, then put the wii code in here } else if ('ipod' != -1) { //ipod touch // If is an ipod, then put the ipod code in here } else if ('ipad' != -1) { //ipad // If it is an ipad, then put the ipad code here } else if ('DS' != -1) { //DS // If it is a ds, then put the ds code here } else if ('3DS' != -1) { //3DS // If it is a 3DS, then put the code here } else if ('DSi' != -1) { //DSi //if it is a DSi, then put the code here } else { document.write('You must be on a computer or a non-registered device. go to the <a href="http://scratch.mit.edu/forums/viewtopic.php?pid=774559#p774559">Go Everywhere disscussion</a> and tell us what your device is. Thank you.'); }all I need to know is what we're doing next.
Well... I think it MIGHT not work, I will test android with emulator ( )
But anyway I'm doing a different method, switch.
come to think of it, that might work better, since it would save typing time
Offline
comp500 wrote:
GP1 wrote:
the device detection is almost complete. hey guys! this little code might help us:
Code:
var agent = navigator.userAgent.toLowerCase(); if (agent.indexOf('iphone') != -1) { // iPhone Device // If it is an iPhone put specific code to run here for iPhone users } else if (agent.indexOf('android') != -1) { // Google phones running Android OS // If it is a Google phone put specific code to run here for Android users }it will sense ANY kind of device (ex. computer, type of phone, nitendo, psp, etc.) I will take the list of devices on the front page (testing devices) and make sensors for them. we can put the edited code into them
I do not believe you.
I'm not lying, it will work with ANY device, but it is untested for the ds. I couldn't find the right parameter, but I will test it soon. I loaned my ds to my friend. What do I do next?
Offline
I would do it using switch not if's.
Offline
wiki page is online! http://wiki.scratch.mit.edu/wiki/Go_Everywhere!
Offline
jslomba wrote:
hey guys, I'm on the development team for Kitcat, the mod that can be used on a dsi.
and also, how are you doing on the iphone version?
hey jslomba, does the ds version of Kitcat work? we haven't tried it out yet Anyway, we're still on device detection. I gave them the code, just that their changing the method from elseif to switch, witch is a little bit simpler. I can't figure out how to do it with switch, because I didn't pay attention when I read that part in the book, and anyway, I have a habit of using elseif.
Offline
GP1 wrote:
jslomba wrote:
hey guys, I'm on the development team for Kitcat, the mod that can be used on a dsi.
and also, how are you doing on the iphone version?hey jslomba, does the ds version of Kitcat work? we haven't tried it out yet Anyway, we're still on device detection. I gave them the code, just that their changing the method from elseif to switch, witch is a little bit simpler. I can't figure out how to do it with switch, because I didn't pay attention when I read that part in the book, and anyway, I have a habit of using elseif.
I'll try it.
Offline
jslomba wrote:
hey guys, I'm on the development team for Kitcat, the mod that can be used on a dsi.
and also, how are you doing on the iphone version?
while I'm waiting for these peeps to do next, I'll try to pull a quick version together. it will probably only have two blocks, but still.
Offline
jslomba wrote:
GP1 wrote:
jslomba wrote:
hey guys, I'm on the development team for Kitcat, the mod that can be used on a dsi.
and also, how are you doing on the iphone version?hey jslomba, does the ds version of Kitcat work? we haven't tried it out yet Anyway, we're still on device detection. I gave them the code, just that their changing the method from elseif to switch, witch is a little bit simpler. I can't figure out how to do it with switch, because I didn't pay attention when I read that part in the book, and anyway, I have a habit of using elseif.
I'll try it.
thank you. I think that I MIGHT be able to pull up direction for it.
Offline