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

#1 2011-10-27 21:19:59

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

JsScratch viewer development thread

This is the development thread for the new JavaScript / HTML5 Cavnas scratch viewer known as JsScratch.

The aim of this application is to provide a more stable, more browser compatible, and more modern way to view scratch projects on devices ranging from iPods, Cell Phones, Game consoles, and of course computers.

The current staff consists of:

Project Managers / Main Programmers:
MidnightLeopard
MathWizz

Secondary Programmers:
ProgrammingFreak

*You must have an advanced knowledge of JavaScript and HTML to join*

Application progress:
http://dl.dropbox.com/u/16495156/progress%20bar.png

Checklist:
Reading SB files Check.
Translating into morphs

Last edited by midnightleopard (2011-12-06 20:18:01)


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#2 2011-10-27 22:24:20

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: JsScratch viewer development thread

Yay! I will upload what I have so far to http://jsscratch.site50.net/


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#3 2011-10-27 23:04:43

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: JsScratch viewer development thread

My JS is okay, and so is my HTML5. I don't think I'll be able to help with the app, but maybe I can help with the website's other pages? Like contact us, report bugs maybe?

Or maybe I can test? I have an iPod touch, and I also have access to an iPad and iPhone. Although I think iPhone and iPod touch have the same screen size.

Remember, it's extremely hard to do it on iOS devices. First, you have to disable scrolling so it won't scroll while you try to press it. I suggest you have different sections, or at least be able to detect the device being used.

Offline

 

#4 2011-10-27 23:22:16

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: JsScratch viewer development thread

I'm with kayybee. I'm decent at both, and I can help some with the main app (such as developing the blocks and such, and maybe a possible way to deal with embedded blocks).


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#5 2011-10-27 23:45:16

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: JsScratch viewer development thread

Wow! Two responses already! I personally think we should not have anymore than two or three developers because projects with more than that amount seem to die off and not get completed (like the old HTML viewer.) We could use testers for mobile devices for sure because we may not have all the devices we want to test on. I will have wait for midnightleopard to give his/her opinion before anything it official.


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#6 2011-10-28 00:00:01

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: JsScratch viewer development thread

Doesn't seem like midnightleopard is up till midnight.  tongue


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#7 2011-10-28 00:12:34

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: JsScratch viewer development thread

I can make several of the blocks already... like the "distance to [sprite]" block and such.  wink

Code:

function distanceto(sprite1, sprite2) {
(We want to assign X and Y positions for each sprite before blocks are executed in a class most likely, and then once after. I'll handle that later.)
return sqrt((sprite2.y - sprite1.y)^2 - (sprite2.x - sprite1.x)^2); }
(provided i got the functions right :P)

Hold on, are we using jQuery or no? If we are, a lot of the blocks should be simple...
I.e.

Code:

function clicked() {
if $().clicked {
report true; }
else {
report false; }
}

It may take me a bit to catch up though, I'm sort of trying to remember... lol..

How would you put a variable in JS in the $().clicked function? (Lol, nevermind. Time to figure this out with JS.  tongue )

Last edited by bbbeb (2011-10-28 15:40:24)


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#8 2011-10-28 00:19:16

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: JsScratch viewer development thread

No, we're not using jQuery. The hard parts are not the blocks at all. They are reading the file, creating all the Morph classes, and making a VM for the scripts.

EDIT: If you didn't notice, above I said I was using Jens morphic.js.

Last edited by MathWizz (2011-10-28 00:22:50)


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#9 2011-10-28 00:21:04

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: JsScratch viewer development thread

We're not? Oh. Okay.
That solves a lot of things. And yeah, that's a pain.
Gonna take me a long while to even get anywhere with this..  tongue


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#10 2011-10-28 00:22:20

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: JsScratch viewer development thread

Check out the current viewer at http://jsscratch.site50.net/.

We need a chat...

Last edited by MathWizz (2011-10-28 00:27:29)


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#11 2011-10-28 00:23:38

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: JsScratch viewer development thread

I see it.  tongue

Technically, I should be in bed, but w.e. I'll see what I can figure out at the moment. That morphic is going to be a pain to figure out.


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#12 2011-10-28 00:25:46

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: JsScratch viewer development thread

http://webchat.esper.net/ chanel: #jsscratch

Lol, I should be too.

Last edited by MathWizz (2011-10-28 00:27:50)


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#13 2011-10-28 09:42:43

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: JsScratch viewer development thread

Your distance formula is wrong.  You've got to square the differences and add them together:

sqrt(  (x1-x2)^2 + (y1-y2)^2  )

And on the other forum Midnightleopard said you were only going to use one canvas.  Are you going to buffer your images on separate canvases?  This makes it faster to render images.  If you're not familiar with the method, you can find it here.  Basically, it is called "off-screen rendering".  You make the image on an invisible canvas and put your images (costumes?) on it. Then, instead of rendering the image onto the visible canvas, you "paste" the invisible canvas on your "real" canvas.  It doesn't make much of a difference in some browsers, but it helps tremendously on others.

Last edited by MoreGamesNow (2011-10-28 09:55:38)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#14 2011-10-28 10:23:38

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: JsScratch viewer development thread

MoreGamesNow wrote:

And on the other forum Midnightleopard said you were only going to use one canvas.  Are you going to buffer your images on separate canvases?  This makes it faster to render images.  If you're not familiar with the method, you can find it here.  Basically, it is called "off-screen rendering".  You make the image on an invisible canvas and put your images (costumes?) on it. Then, instead of rendering the image onto the visible canvas, you "paste" the invisible canvas on your "real" canvas.  It doesn't make much of a difference in some browsers, but it helps tremendously on others.

I don't know for sure, but I think morphic already supports this, so yes, we will be using it.


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#15 2011-10-28 11:38:46

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: JsScratch viewer development thread

I'll join.  smile

Offline

 

#16 2011-10-28 11:44:27

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: JsScratch viewer development thread

ProgrammingFreak wrote:

I'll join.  smile

Hey PF! As I said above, I'll have to wait until midnightleopard comes on to confirm before anyone joins.


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#17 2011-10-28 11:58:34

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: JsScratch viewer development thread

MathWizz wrote:

ProgrammingFreak wrote:

I'll join.  smile

Hey PF! As I said above, I'll have to wait until midnightleopard comes on to confirm before anyone joins.

Thats fine.  smile

Offline

 

#18 2011-10-28 12:48:10

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: JsScratch viewer development thread

Can I join too? I know lots of JS canvas.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#19 2011-10-28 12:50:11

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: JsScratch viewer development thread

YEEESSSSSSSSSSS!!!! I almost completely re-coded everything.  big_smile

Changelog wrote:

Re-coded the reader.

Added:
BinaryStream class
ObjectStream class

Fixed:
FieldObject class

Other:
A lot of tidying up.


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#20 2011-10-28 14:24:30

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: JsScratch viewer development thread

Site updated.

EDIT: You may have to clear your cache.

Last edited by MathWizz (2011-10-28 14:30:20)


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#21 2011-10-28 15:40:02

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: JsScratch viewer development thread

MoreGamesNow wrote:

Your distance formula is wrong.  You've got to square the differences and add them together:

sqrt(  (x1-x2)^2 + (y1-y2)^2  )

My bad.  tongue


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#22 2011-10-29 18:05:57

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: JsScratch viewer development thread

Yeah.
I have been looking around on the forums a lot (i just got back from a scratch break) and I have noticed some projects with giant amounts of people working on them. I can almost guarantee the failure of all of them.
We are going to absolutely keep it small, and we just started so I don't think we are ready to accept applicants yet.

Kayybee:
No thank you, we do not need any help with the website, but thanks anyways!

ProgrammingFreak:
What sort of things can you help with? We could use some help with reading sprites from the files.

HardMath123:
We don't need help with canvas at all right now, but we'll talk to you if your services are needed later.

bbbeb:
I know you are talented at this sort of thing, but did you seriously think jQuery could be used in Canvas???
I have ported lots of blocks into canvas before, and we don't really need help in that area at all. Thank you.

MathWizz:
We could use some testers, but we can just message them and ask if it works instead of adding them to the team. A lot of names on the staff board makes things slow down it seems to be. Also I am a boy, and I don't stay up till midnight.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#23 2011-10-29 18:38:43

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: JsScratch viewer development thread

I think that I might be able to do such a thing. I am pretty good with Javascript and PHP.  smile

Offline

 

#24 2011-10-29 19:26:09

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: JsScratch viewer development thread

midnightleopard wrote:

We could use some testers, but we can just message them and ask if it works instead of adding them to the team. A lot of names on the staff board makes things slow down it seems to be. Also I am a boy, and I don't stay up till midnight.

I was thinking we would have a list of 10 or so testers with what device they had. Not high-priority, but may come in handy. I don't even know if what I have made so works on, say Android.


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#25 2011-10-29 21:27:10

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: JsScratch viewer development thread

midnightleopard wrote:

bbbeb:
I know you are talented at this sort of thing, but did you seriously think jQuery could be used in Canvas???
I have ported lots of blocks into canvas before, and we don't really need help in that area at all. Thank you.

That was my bad,  tongue .

Well, I was thinking about trying to work on the coding for an execution engine using the pre-placed Morphic that Jens made and MathWizz had brought with him.  tongue

Problem is, there aren't any blocks or anything yet. So I'm sort of thinking how to parse the massive array MathWizz made.  tongue


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

Board footer