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

#1 2010-01-23 20:42:44

kittenlols
Scratcher
Registered: 2010-01-21
Posts: 31

Flash should be possible..

I think there is a way to convert scratch to flash without doing tons of work. Like converting each block to it's actionscript code. Also enables more features..

Very simple blocks:
Change x by 10
onClipEvent(enterFrame) {
    this._x += 10;
}

Rotate:
this._rotation = 45;

When clicked, rotate
onClipEvent (mouseUp) {
this._mc._rotation = 45;
}

Costumes: Each costume is 1 frame in the movieclip (act like a sprite), put a stop(); on each frame and you need this to change costumes: (first one is to change into next costume, second one is to change into prev costume, third one is to change into 4th.

nextFrame();
prevFrame();
gotoAndStop(4);

Change sprite size - +10%
on (press) {
_xscale=110
_yscale=110
}

One feature scratch does not have is change x  by 10%, y by 10%, which can be possible in flash

on (press) {
_xscale=110
}

Arrow keys movement:

SCRATCH:
when arrow up pressed
change x by 1


FLASH:
onClipEvent (enterFrame) {
    if (Key.isDown(Key.LEFT)) {
        _x--;
    }
}

What about seconds? Flash uses frames.
25FPS, 1frame = 0.04s.

So why flash?
1) Can be uploaded to a lot of other sites. Games here can be uploaded to flash game portals.
2) Faster code-based. AFAIK, the code is given to java and java complies it when started. Like this: Scratch [uploaded to site] [someone views it] -> java -> playable. Flash is Scratch -> Flash [uploaded to site] [someone views it] -> playable.
3) Faster graphics-based. I used this test: http://www.shinedraw.com/image-manipulation/javafx-vs-flash-vs-silverlight/ 8 images for java, 8 images for flash. Go see for your self, flash is smoother.
4) Vector-based. Want to scale it 340x770 without quality loss? You can with vector-based flash.
5) 99% of computers have flash, more than java. Since a lot of people here are children and their parent's (unless techy) may not let them download some software whose name is to do with coffee.

Offline

 

#2 2010-01-24 00:24:58

BruceWaof
Scratcher
Registered: 2010-01-19
Posts: 2

Re: Flash should be possible..

I see that your post is quite recent, but I empathize with that idea a lot and have been doing a lot of Actionscript programming myself lately for a totally unrelated project.

Have you taken this very far?  I've wondered a lot about the issues of porting Scratch and/or its programs quite a bit recently.  When I looked at a Scratch project on my PC, I just saw a series of blocks of various types.  Some were almost text, some seemed patterned binary and others were probably graphic representations of sprites.  I was hoping for, perhaps, XML.  Is there an explanation of these formats and other details somewhere?  I'm new and haven't had a chance to look around much.

I could see a lot of value to at least having a runtime in Flash since Flash seems to be getting to new platforms very much faster than Java.

Bruce

Offline

 

Board footer