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

#1 2012-03-14 21:27:10

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

scratch in Java-official topic

This is the official topic for the collab recreating scratch in the java "oop"

Our goal is to provide all the features of scratch in our own project. We also plan to have more features.

Discuss...


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#2 2012-03-14 21:36:44

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: scratch in Java-official topic

This belongs in the collaborations forum  smile


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#3 2012-03-14 21:37:31

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: scratch in Java-official topic

jji7skyline wrote:

This belongs in the collaborations forum  smile

It's outside of Scratch though, so it belongs here if the Unity3D one does.


Posts: 20000 - Show all posts

Offline

 

#4 2012-03-14 21:44:18

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: scratch in Java-official topic

collab forum is for working together on scratch projects or mods this is its own thing beyond scratch so it belongs here


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#5 2012-03-14 22:05:31

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: scratch in Java-official topic

I won't commit, but may add some code.  smile


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#6 2012-03-14 22:09:35

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: scratch in Java-official topic

ya ill give commitment but for me this is mostly learning


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#7 2012-03-15 02:54:51

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: scratch in Java-official topic

slayerrobe7 wrote:

ya ill give commitment but for me this is mostly learning

same


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#8 2012-03-15 03:06:31

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: scratch in Java-official topic

what namespace should we use for java?


http://i.imgur.com/1QqnHxQ.png

Offline

 

#9 2012-03-15 03:46:31

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: scratch in Java-official topic

namespace - i can't remember what that is
EDIT: Just found out what it is - call it whatever you want to

Last edited by muppetds (2012-03-15 03:47:01)


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#10 2012-03-15 11:55:06

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: scratch in Java-official topic

JVS (Java Scratch
JScratch
Java scratch
JBlocks
JB (java blocks)
or make up our own

Last edited by slayerrobe7 (2012-03-15 12:00:20)


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#11 2012-03-15 11:59:32

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: scratch in Java-official topic

I've made draggable blocks I could give you the code for it.


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#12 2012-03-15 12:00:56

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: scratch in Java-official topic

plz do

is their any specific compiler i should run it in


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#13 2012-03-15 12:09:43

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: scratch in Java-official topic

No. I uses rectangles that adjust to the text length. Give me a little while to buetify it.  smile


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#14 2012-03-15 12:18:54

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: scratch in Java-official topic

Main code:

Code:

    
Block block = new Block("My block", Color.blue, 30,30);
public void paint(Graphics g)
    {
        Graphics2D g2D = (Graphics2D) g;
        g2D.setColor(gray);
        if (change)
            g2D.fillRect(0, 0, jf.getWidth(), jf.getHeight());
        fm = g.getFontMetrics(g2D.getFont());
            g2D.setColor(block.blockColor);
            g2D.fillRoundRect(block.blockX, block.blockY, 10 + fm.stringWidth(block.blockText), 25, 5, 5);
            g2D.fillRect(block.blockX + 10, block.blockY + 25, 20, 5);
            g2D.setColor(gray);
            g2D.fillRect(block.blockX + 10, block.blockY, 20, 5);
            g2D.setColor(black);
            g2D.drawString(block.blockText, block.blockX + 5, block.blockY + 19);
            UpdateBlock(fm.stringWidth(block.blockText), block);
        
    }
    private void UpdateBlock(int blockLength, Block block){
        change = false;
        mouseX = MouseInfo.getPointerInfo().getLocation().x - jf.getX();
        mouseY = MouseInfo.getPointerInfo().getLocation().y - jf.getY();
        blockClicked(mouseX, mouseY, block.blockX,block.blockY,blockLength + 10, mouseDown);
        repaint();
    }
    public void blockClicked(int mouseX, int mouseY, int blockX, int blockY, int blockLength , boolean mouseDown){
        if (mouseDown){
            if((blockX <= mouseX & (blockX + blockLength) >= mouseX & blockY <= mouseY & (blockY + 25) >= mouseY) || mouseDownLastTime){
                mouseDownLastTime = true;
                x = mouseX - (blockLength / 2);
                y = mouseY - 42;
                change = true;
            }
        } else {
            mouseDownLastTime = false;
        }
    }

I was unsuccessful in making multiple blocks at a time but maybe you'll have more luck.

Last edited by poopo (2012-03-15 12:19:26)


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#15 2012-03-15 12:22:13

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: scratch in Java-official topic

what compiler do i run that in all i got from mine was errors


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#16 2012-03-15 12:34:37

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: scratch in Java-official topic

slayerrobe7 wrote:

what compiler do i run that in all i got from mine was errors

I ran it in netbeans. The reason your get errors in it just methods no structure and You need to get mouse input.


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#17 2012-03-15 13:53:20

ZeroLuck
Scratcher
Registered: 2010-02-23
Posts: 500+

Re: scratch in Java-official topic

slayerrobe7 wrote:

what compiler do i run that in all i got from mine was errors

If you can just copy some code, without understanding anything, I don't think you are good enough to do something as complicated as a "Java Scratch".


http://3.bp.blogspot.com/-oL2Atzp0Byw/T465vIQ36dI/AAAAAAAAADo/1vqL4PvhkM0/s1600/scratchdachwiki.png

Offline

 

#18 2012-03-15 14:00:12

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: scratch in Java-official topic

ZeroLuck wrote:

slayerrobe7 wrote:

what compiler do i run that in all i got from mine was errors

If you can just copy some code, without understanding anything, I don't think you are good enough to do something as complicated as a "Java Scratch".

Put bluntly but I agree.  hmm


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#19 2012-03-15 14:03:15

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

Re: scratch in Java-official topic

Contact MathWhiz about this. He'll help you alot. He already has one started and its really good.

EDIT: I hope this is opensource, cause I love looking at code from a language I'm learning.

Last edited by ProgrammingFreak (2012-03-15 14:03:44)

Offline

 

#20 2012-03-15 14:07:44

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: scratch in Java-official topic

ProgrammingFreak wrote:

I hope this is opensource, cause I love looking at code from a language I'm learning.

Me too and that is why I LOVE netbeans go feature!  big_smile


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#21 2012-03-15 14:11:07

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: scratch in Java-official topic

ProgrammingFreak wrote:

EDIT: I hope this is opensource, cause I love looking at code from a language I'm learning.

Totally!


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#22 2012-03-15 14:11:58

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

Re: scratch in Java-official topic

poopo wrote:

ProgrammingFreak wrote:

I hope this is opensource, cause I love looking at code from a language I'm learning.

Me too and that is why I LOVE netbeans go feature!  big_smile

Netbeans is extremely slow for me.
I might switch to Eclipse cause it also has Android plugins.

Offline

 

#23 2012-03-15 14:12:55

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: scratch in Java-official topic

ProgrammingFreak wrote:

poopo wrote:

ProgrammingFreak wrote:

I hope this is opensource, cause I love looking at code from a language I'm learning.

Me too and that is why I LOVE netbeans go feature!  big_smile

Netbeans is extremely slow for me.
I might switch to Eclipse cause it also has Android plugins.

Do you have lots of plugins?
I've never tried Eclipse.


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#24 2012-03-15 22:29:58

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: scratch in Java-official topic

I am here mostly for learning I am not a very good java scripter but i am willing to learn i also help when i can

btw we probably need a website if you guys want i could make one in weebly


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#25 2012-03-15 22:36:04

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: scratch in Java-official topic

PROTIP: java NEEDS a main method. That's a short enough script you should have seen, or at least seen the "no main method" error.


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

Board footer