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

#26 2012-04-23 10:02:36

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

Re: Simplicity: Scratch in Processing

Gonna work on rewriting the touching function today in school because the coordinate system changed to be like Scratch.


Posts: 20000 - Show all posts

Offline

 

#27 2012-04-23 10:47:06

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: Simplicity: Scratch in Processing

veggieman001 wrote:

Gonna work on rewriting the touching function today in school because the coordinate system changed to be like Scratch.

Finally


3

Offline

 

#28 2012-04-23 10:55:45

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

Re: Simplicity: Scratch in Processing

Gonna finish the timed say/think functions. :3

Offline

 

#29 2012-04-23 17:46:41

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

Re: Simplicity: Scratch in Processing

puppetadventurer wrote:

veggieman001 wrote:

Gonna work on rewriting the touching function today in school because the coordinate system changed to be like Scratch.

Finally

Still not with the proper alpha though... dunno how to do that.


Posts: 20000 - Show all posts

Offline

 

#30 2012-04-24 15:24:32

scratchisthebest
Scratcher
Registered: 2009-02-08
Posts: 500+

Re: Simplicity: Scratch in Processing

Hey, the timer can be done with the millis function:

Code:

int timer = 0, lastReset = 0;
//stuff
timer = (millis()/100f)-lastReset;
//more stuff
void resetTimer {
  lastReset = millis();
}

Oh, and alpha:
Before you display an image, use tint(255,ghost); . You can use that for the color effect too:

Code:

colorMode(HSB,100,100,100); //set color mode to hue-sat-bri
//Bla bla bla bla
void display() {
  tint(colorEffect,satEffect,briEffect,ghostEffect);
  image(my_image,x,y);
}

bye 1.4, we all loved you. but we all outgrew the site. 2.0 is a welcome change.
http://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.png

Offline

 

#31 2012-04-24 18:57:05

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

Re: Simplicity: Scratch in Processing

scratchisthebest wrote:

Hey, the timer can be done with the millis function:

Code:

int timer = 0, lastReset = 0;
//stuff
timer = (millis()/100f)-lastReset;
//more stuff
void resetTimer {
  lastReset = millis();
}

Oh, and alpha:
Before you display an image, use tint(255,ghost); . You can use that for the color effect too:

Code:

colorMode(HSB,100,100,100); //set color mode to hue-sat-bri
//Bla bla bla bla
void display() {
  tint(colorEffect,satEffect,briEffect,ghostEffect);
  image(my_image,x,y);
}

Thanks for the code.  smile
Is there any specific name you'd like to be credit as.


Posts: 20000 - Show all posts

Offline

 

#32 2012-04-24 22:19:36

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

Re: Simplicity: Scratch in Processing

I compiled it, but it didn't work  hmm


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

Offline

 

#33 2012-04-24 23:53:04

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

Re: Simplicity: Scratch in Processing

jji7skyline wrote:

I compiled it, but it didn't work  hmm

What's the error?


Posts: 20000 - Show all posts

Offline

 

#34 2012-04-25 07:51:04

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

Re: Simplicity: Scratch in Processing

scratchisthebest wrote:

Hey, the timer can be done with the millis function:

Code:

int timer = 0, lastReset = 0;
//stuff
timer = (millis()/100f)-lastReset;
//more stuff
void resetTimer {
  lastReset = millis();
}

Oh, and alpha:
Before you display an image, use tint(255,ghost); . You can use that for the color effect too:

Code:

colorMode(HSB,100,100,100); //set color mode to hue-sat-bri
//Bla bla bla bla
void display() {
  tint(colorEffect,satEffect,briEffect,ghostEffect);
  image(my_image,x,y);
}

Nice code.  smile

Offline

 

#35 2012-04-25 17:35:37

soupoftomato
Scratcher
Registered: 2009-07-18
Posts: 1000+

Re: Simplicity: Scratch in Processing

Scratch is open source.
I know very, very, little about Processing but could you not use Scratch's sound library?


I'm glad to think that the community will always be kind and helpful, the language will always be a fun and easy way to be introduced into programming, the motto will always be: Imagine, Program, Share - Nomolos

Offline

 

#36 2012-04-25 18:12:55

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

Re: Simplicity: Scratch in Processing

soupoftomato wrote:

Scratch is open source.
I know very, very, little about Processing but could you not use Scratch's sound library?

We're probably going to be using SoundCipher for the note blocks, which uses MIDI that is similar, if not the same as, Scratch's.


Posts: 20000 - Show all posts

Offline

 

#37 2012-04-26 20:57:12

scratchisthebest
Scratcher
Registered: 2009-02-08
Posts: 500+

Re: Simplicity: Scratch in Processing

veggieman001 wrote:

scratchisthebest wrote:

Hey, the timer can be done with the millis function:

Code:

int timer = 0, lastReset = 0;
//stuff
timer = (millis()/100f)-lastReset;
//more stuff
void resetTimer {
  lastReset = millis();
}

Oh, and alpha:
Before you display an image, use tint(255,ghost); . You can use that for the color effect too:

Code:

colorMode(HSB,100,100,100); //set color mode to hue-sat-bri
//Bla bla bla bla
void display() {
  tint(colorEffect,satEffect,briEffect,ghostEffect);
  image(my_image,x,y);
}

Thanks for the code.  smile
Is there any specific name you'd like to be credit as.

No, really just copy and paste. That code took me like five entire seconds to write.  wink


bye 1.4, we all loved you. but we all outgrew the site. 2.0 is a welcome change.
http://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.pnghttp://scratch.mit.edu/img/Pico3-med.png

Offline

 

#38 2012-04-27 09:24:28

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

Re: Simplicity: Scratch in Processing

scratchisthebest wrote:

veggieman001 wrote:

Thanks for the code.  smile
Is there any specific name you'd like to be credit as.

No, really just copy and paste. That code took me like five entire seconds to write.  wink

I feel dumb, cause it wasn't working for me when I tried to make one. >.>

Last edited by ProgrammingFreak (2012-04-27 09:24:43)

Offline

 

#39 2012-04-27 09:26:54

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

Re: Simplicity: Scratch in Processing

I'll be working on it this weekend. I took a bit of a break to work on another project which randomly generates music.


Posts: 20000 - Show all posts

Offline

 

#40 2012-04-27 14:59:00

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: Simplicity: Scratch in Processing

What is "Processing?"
What would someone benefit from those two steps in the middle (between scratch and java)?

Offline

 

#41 2012-04-27 17:37:58

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

Re: Simplicity: Scratch in Processing

LiquidMetal wrote:

What is "Processing?"
What would someone benefit from those two steps in the middle (between scratch and java)?

Processing is a very visual Java-based language that is pretty much a simplified Java. Going on this path would help Scratchers learn Java, because Scratch blocks are functions in Simplicity, so it would be a natural progression. Once a user gets better at understanding these, they could move on to more advanced built-in functions of Processing. And eventually, they may want even more advanced things and move into Java, which has the same syntax as Processing.


Posts: 20000 - Show all posts

Offline

 

#42 2012-04-28 09:50:30

soupoftomato
Scratcher
Registered: 2009-07-18
Posts: 1000+

Re: Simplicity: Scratch in Processing

veggieman001 wrote:

LiquidMetal wrote:

What is "Processing?"
What would someone benefit from those two steps in the middle (between scratch and java)?

Processing is a very visual Java-based language that is pretty much a simplified Java. Going on this path would help Scratchers learn Java, because Scratch blocks are functions in Simplicity, so it would be a natural progression. Once a user gets better at understanding these, they could move on to more advanced built-in functions of Processing. And eventually, they may want even more advanced things and move into Java, which has the same syntax as Processing.

What constitutes "visual" because I tried Processing and all I got was colored text commands.


I'm glad to think that the community will always be kind and helpful, the language will always be a fun and easy way to be introduced into programming, the motto will always be: Imagine, Program, Share - Nomolos

Offline

 

#43 2012-04-28 10:35:29

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

Re: Simplicity: Scratch in Processing

soupoftomato wrote:

veggieman001 wrote:

LiquidMetal wrote:

What is "Processing?"
What would someone benefit from those two steps in the middle (between scratch and java)?

Processing is a very visual Java-based language that is pretty much a simplified Java. Going on this path would help Scratchers learn Java, because Scratch blocks are functions in Simplicity, so it would be a natural progression. Once a user gets better at understanding these, they could move on to more advanced built-in functions of Processing. And eventually, they may want even more advanced things and move into Java, which has the same syntax as Processing.

What constitutes "visual" because I tried Processing and all I got was colored text commands.

It's really easy to do graphics and 2D & 3D shapes compared to other languages, requiring mostly no libraries.


Posts: 20000 - Show all posts

Offline

 

#44 2012-05-15 19:15:44

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

Re: Simplicity: Scratch in Processing

I'm still working on this by the way although very slowly.


Posts: 20000 - Show all posts

Offline

 

#45 2012-05-18 23:04:18

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: Simplicity: Scratch in Processing

Is this programmig language supposed to look like C? Because I would make graphics for the say block if you would like me too. Is there any easy way to follow threads without having to remember and check them all?


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#46 2012-05-19 02:00:25

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Simplicity: Scratch in Processing

applejack wrote:

Is there any easy way to follow threads without having to remember and check them all?

You could try clicking Profile -> Show all posts, which is what I use. It only shows threads you've posted on, though.  hmm


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#47 2012-05-19 04:03:45

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

Re: Simplicity: Scratch in Processing

veggieman001 wrote:

jji7skyline wrote:

I compiled it, but it didn't work  hmm

What's the error?

No error. When I run it (I've tried compiling into many different formats) I just get a window of about 20x20 or something. Greyish background.


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

Offline

 

#48 2012-05-19 11:28:58

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

Re: Simplicity: Scratch in Processing

jji7skyline wrote:

veggieman001 wrote:

jji7skyline wrote:

I compiled it, but it didn't work  hmm

What's the error?

No error. When I run it (I've tried compiling into many different formats) I just get a window of about 20x20 or something. Greyish background.

Oh. That's what's supposed to happen. You haven't written any code yet! Try this for a guide to starting out and then you can try and understand the available functions from the Simplicity source.


Posts: 20000 - Show all posts

Offline

 

#49 2012-05-19 23:38:04

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Simplicity: Scratch in Processing

Wow!  It looks great!  1230 lines of code!  I was browsing through your source and wanted to ask a few things:

First of all, I noticed that the "Timer()" function returns an integer.  You might want to change it to return a floating-point value (maybe rounded to 2 or 3 decimals). 

I was looking at the "Join(String sval, String sval2)" function.  Does Processing not have a string concatenation function?  Can't you just do the following?  It looks so much like C# that I wasn't sure. 

Code:

string s1 = "Hello, ";
string s2 = "world!";
string s3 = s1 + s2;

Another thing: Are you intending to start indexing strings at 0, or 1?  So, does the statement

[str(val.value.charAt(loc))]
return the first letter of the string when loc = 0 or loc = 1?

The "toBoolean" function seems to interpret 1, true, True, and TRUE as true, but everything else as false.  Should it specifically use 0, false, False, and FALSE?  Or even throw an exception if you pass an invalid argument? 

Finally, are all sprites represented by rectangular areas on the screen (no transparent pixels)?

Thanks,

amcerbu

Offline

 

#50 2012-05-19 23:47:43

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

Re: Simplicity: Scratch in Processing

amcerbu wrote:

Wow!  It looks great!  1230 lines of code!  I was browsing through your source and wanted to ask a few things:

First of all, I noticed that the "Timer()" function returns an integer.  You might want to change it to return a floating-point value (maybe rounded to 2 or 3 decimals). 

I was looking at the "Join(String sval, String sval2)" function.  Does Processing not have a string concatenation function?  Can't you just do the following?  It looks so much like C# that I wasn't sure. 

Code:

string s1 = "Hello, ";
string s2 = "world!";
string s3 = s1 + s2;

Another thing: Are you intending to start indexing strings at 0, or 1?  So, does the statement

[str(val.value.charAt(loc))]
return the first letter of the string when loc = 0 or loc = 1?

The "toBoolean" function seems to interpret 1, true, True, and TRUE as true, but everything else as false.  Should it specifically use 0, false, False, and FALSE?  Or even throw an exception if you pass an invalid argument? 

Finally, are all sprites represented by rectangular areas on the screen (no transparent pixels)?

Thanks,

amcerbu

Thanks for your interest! I've been working on this for a few months now, and glad to see people like you give comments about it.  smile

1. I will do that. I just directly copy and pasted code on here without really modifying it too much for that.
2. There is a built in string concatenation function, but I'm trying to make this as easy for beginners as possible so I'm using the function name from Scratch. It would also be difficult for someone starting out to have two different functions, + and Join(), for the different datatypes, string and Variable.
3. loc = 0
4. I personally think, based on the current casting Scratch has, that this is how it would be done if it were possible in Scratch.
5. You may have transparent pixels but I haven't finished doing the collision for such images.


Posts: 20000 - Show all posts

Offline

 

Board footer