johnnydean1 wrote:
JQuery??
Have you heard of Google?
Offline
I have but use it rarely
Offline
midnightleopard wrote:
I don't think jquery is needed. If we wanted to make an HTML element glide across a web page then yes, but we are working in a canvas so no. All in favor of not using jquery say I. [blocks]<say[ I ]>[/blocks]
Seeing as what midnight leopard said was probably true, somone is going to need to redo the motionblocks before I learn canvas!
Ill race you!
Offline
Wait: Aren't we drawing every sprite to a seperate canvas? that would mean we wouldnt need to rewrite code, and transforms() would be a pain to code with many sprites anyway...
Alternatively, we could use PHP to create an image/png and just use an img tag to embed it...
Offline
Um, JD1, you might want to update the topic post, as it links to the old site, and there's outdated info in the post.
Offline
I've got it! We use separate canvas tags (Mozilla style) like so
<canvas id="sprite1" style="position: absolute; top: 100px; left: 30px; z-index: 1"> </canvas> <canvas id="stage" style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; z-index:-1"> </canvas>
And then, we put image tags on the inside of those for the people that don't have canvas:
<canvas id="sprite1" style="position: absolute; top: 100px; left: 30px; z-index: 1"> <img src="<?php imagefunctioncall() ?>" style="position: absolute; top: 100px; left: 30px; z-index: 1" /> </canvas>
So, the canvas allows more flexibility and more stuff to be done, but in the end it CAN all boil down to an img tag if necessary
Note: Safari will display both the <canvas> and the <img> some CSS tricks should get rid of that!
Offline
markyparky56 wrote:
johnnydean1 wrote:
markyparky56 wrote:
I've been wanting to ask this for a while, its likely already been asked though.
Whats wrong with the current one?Nothing, except try viewing it on the Wii, DS or your phone. It doesnt work see. This one should work!
I don't have a Wii or a DS, with internet; or a phone to view it with! Thats what a computer is for, and a computer views it fine!
I have a Wii with internet!
BTW, what is the block.js for? And also, I would like to have a job please! I know HTML, CSS, HTML5(learning), and I am learning Javascript!
Offline
Daffy22 wrote:
johnnydean1 wrote:
TheSuccessor wrote:
That's a bad idea as it will interrupt the execution of all other scripts.Ok then have a toggle box that toggles a pop up keyboard.
look here: http://www.scratchhtmlviewer.net23.net/keys.html
my keyboard I made!![]()
Nice!!!
Offline
Lets clear things up
Language
I would like it to be in any combo of
PHP
JavaScript
HTML4
This will allow compatability with most (95%) of web browsers.
Jobs
Heres what we still need
A way to get the scripts
A way to get the costumes
A way of displaying the costumes
A way of running scripts
Updates
When I have time I will update the first post
Offline
I'm working on the way of running scripts. It's nearly finished.
Offline
more sensing code:
(I'm using tcb's element inside as well)
//distance from sprite %value1
function getDistance(element, value1) {
otherSprite = getElementByID(value1)
x1 = element.style.left
x2 = otherSprite.style.left
y1 = element.style.top
y2 = otherSprite.style.left
c1 = x1 - x2
c2 = y1 - y2
d1 = c1 - x1 //(correct the math if i screwed up, it made point C and is calculating the
d2 = c2 - y1 //distance.)
return (Math.sqrt(d1*d1)+(d2*d2)) } //Changed it to find the distance between the two.Curiously, how would I do the mouses?
Last edited by bbbeb (2010-11-29 23:28:18)
Offline
OK, I'm adding that to block.js...
Wait...
Your code is finding the distance from element...
Remember, value1 is the id of the element...
We need to find the distance between element and value1....
And theres not even a single getElementById!
So, the maths is right, but I don't think the output will be as excpected....
Sorry
Offline
tcb wrote:
OK, I'm adding that to block.js...
Wait...
Your code is finding the distance from element...
Remember, value1 is the id of the element...
We need to find the distance between element and value1....
And theres not even a single getElementById!
So, the maths is right, but I don't think the output will be as excpected....
Sorry![]()
My bad, I rushed through it.
I THINK i fixed it....
Last edited by bbbeb (2010-11-29 07:30:07)
Offline
I have written a lot of scratch blocks in javascript. get them here. I did some panther, too. It also includes a new sprite function. The block functions are (arg1, arg2, element). The element argument is actually the element, not the id.
Last edited by paulpsicle (2010-11-29 16:50:32)
Offline
Suggestion
Do we add as many blocks from mod's as possible, to get a big range of support?
Offline
johnnydean1 wrote:
Suggestion
Do we add as many blocks from mod's as possible, to get a big range of support?
Yeah! Then we have to completely recode everything to accomadate Panther, BYOB, Bingo...
Maybe a bit much. Just the ones like [open url %s] and the universal mod blocks.
Offline
bbbeb wrote:
johnnydean1 wrote:
Suggestion
Do we add as many blocks from mod's as possible, to get a big range of support?Yeah! Then we have to completely recode everything to accomadate Panther, BYOB, Bingo...
Maybe a bit much. Just the ones like [open url %s] and the universal mod blocks.
only do this for mods that allows us to view the source. That leaves out BYOB and many others. We have to do this becuase we need to get the spec, code ect from it and that means we need access.
Anyway BYOB header has changed.
Offline
paulpsicle wrote:
I have written a lot of scratch blocks in javascript. get them here. I did some panther, too. It also includes a new sprite function. The block functions are (arg1, arg2, element). The element argument is actually the element, not the id.
Nice... Cool code. I'm jealous
. But... you seem to be switching in-between the sprites canvas being the same as the stages canvas, as in line 8:
this.canvas = document.getElementById("stagecanvas").getContext('2d'and it being a seperate element:
function glideSecsToXY(t1, t2, t3, e){
var x = e.style.left;
var y = e.style.top;
$("#" + e).animate({
left: xpos + t2 + "px",
top: ypos + t3 + "px"
}, t1);
var canvas = sprites[e.id].canvas;
if(sprites[e.id].pendown){
canvas.moveTo(x, y);
canvas.lineTo(e.style.left, e.style.top);
canvas.stroke();
}
}Wait! I get it! sprites[obj.id].canvas is the canvas for the pendown blocks, not for the sprite itself to be drawn on.
And style.webkitTransform only works with webkit browsers. This is slightly more cross-browser:
$("#" + sID).css({ '-moz-transform': sCSS, '-o-transform': sCSS, '-webkit-transform': sCSS });Sorry to be nitpicky, but I was confused by the awesome code...
Last edited by tcb (2010-11-30 03:27:15)
Offline
Daffy22 wrote:
bbbeb wrote:
johnnydean1 wrote:
Suggestion
Do we add as many blocks from mod's as possible, to get a big range of support?Yeah! Then we have to completely recode everything to accomadate Panther, BYOB, Bingo...
Maybe a bit much. Just the ones like [open url %s] and the universal mod blocks.only do this for mods that allows us to view the source. That leaves out BYOB and many others. We have to do this becuase we need to get the spec, code ect from it and that means we need access.
![]()
Anyway BYOB header has changed.![]()
DUDE! BYOB is open source, and the rest are hackable! The header change in BYOB isn't hard to change either. BUUUUUUUUUUTTTTTTTTT, lets stick with Scratch for now.
Offline
Ok lets do the normal scratch blocks +
open url %s
get url %s
read line %n from %s
write %s to file %s (writes as a cookie)
read file %s
%n ^ %n
and if we do mesh
join mesh %s
leave mesh %s
host mesh
(ip adress)
That way we should be about 50% conpatible with most mods
Offline
johnnydean1 wrote:
Ok lets do the normal scratch blocks +
open url %s
get url %s
read line %n from %s (from cookie)
write %s to file %s (writes as a cookie)
read file %s (from cookie)
%n ^ %n
and if we do mesh
join mesh %s
leave mesh %s
host mesh
(ip adress)
That way we should be about 50% conpatible with most mods
Offline