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

#1 2011-11-06 11:14:21

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

OOP Blocks

I am starting a new mod. It is called OOP Blocks because it will support object-oriented programming. You will be able to make classes by defining the sprite and methods, then make instances which you can alter. It will have blocks such as "make new instance of ( )" and possibly, if it was more like java, "garbage-collect heap". It would be a good introduction to OOP for scratchers, and would help them move into real languages. Designing methods would work like block-building in BYOB. I need at least two other programmers, a block-maker, and a website designer. I will be a programmer and a block maker.

programmers:
  samtwheels


blockmakers:
  samtwheels
  Daroach


website designers:
  samtwheel
  mcsugarface
  robinp

Last edited by samtwheels (2011-11-16 17:22:29)

Offline

 

#2 2011-11-06 11:17:12

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

Re: OOP Blocks

I can help with the website.


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

Offline

 

#3 2011-11-06 11:22:29

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

Hardmath123 wrote:

I can help with the website.

ok, you're in.

Offline

 

#4 2011-11-06 11:55:33

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

sometime today I'll start experimenting.

Offline

 

#5 2011-11-06 13:52:37

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

bump

Offline

 

#6 2011-11-06 15:10:03

maxskywalker
Scratcher
Registered: 2008-01-27
Posts: 1000+

Re: OOP Blocks

Before I can ask to join your programmer team, I need to know some things.  Please put a small description in the post, and maybe a template entry.

1. Which language is it written in?
2. How do we share the source code?
3. Describe how OOP works with blocks.

Offline

 

#7 2011-11-06 15:36:51

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

1. Which language is it written in? Like all scratch mods, squeak.

2. How do we share the source code? Mediafire, or a similar file sharing site.

3. Describe how OOP works with blocks. Blocks will do things available in object oriented languages. One example would be "new instance." this block would make a new instance of this class. If it was in class 'dog', it would make a new dog sprite, with all dog scripts.

Offline

 

#8 2011-11-06 17:30:54

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

added a few blocks, such as clone. nothing OOP yet, because I haven't figured out how to design classes.

Offline

 

#9 2011-11-06 17:56:38

legoscratch
Scratcher
Registered: 2010-06-18
Posts: 100+

Re: OOP Blocks

uhm... isn't scratch already object-oriented?


If you are having trouble with simple counting, use the following mnemonic device: 1 comes before 2 comes before 5,280 comes before 523,860,759 comes after the square root of -153 comes before π. This will make your previous counting problems seem like no big deal.

Offline

 

#10 2011-11-06 17:56:57

maxskywalker
Scratcher
Registered: 2008-01-27
Posts: 1000+

Re: OOP Blocks

legoscratch wrote:

uhm... isn't scratch already object-oriented?

Not really.

Offline

 

#11 2011-11-06 18:25:33

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

legoscratch wrote:

uhm... isn't scratch already object-oriented?

no. by "object", it doesn't mean sprite, but a system of classes and instances. google it if you want to learn more.

Offline

 

#12 2011-11-06 18:32:05

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

maxskywalker, are you going to apply?

Offline

 

#13 2011-11-06 21:39:45

scratcher7_13
Scratcher
Registered: 2011-02-09
Posts: 1000+

Re: OOP Blocks

Sounds cool...


♫ 90% of teens can't do math. If you are one of the 40% of teens who can, copy and paste this into your signature. ♫♪
http://dl.dropbox.com/u/6273449/BlockLibraryTitle.pnghttp://i.imgur.com/mr9Hf.gif

Offline

 

#14 2011-11-06 22:15:19

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

scratcher7_13 wrote:

Sounds cool...

do you want to join?

Offline

 

#15 2011-11-07 15:51:58

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: OOP Blocks

legoscratch wrote:

uhm... isn't scratch already object-oriented?

no. Object oriented allows for unlimited instances of a sprite. There are 2 types of object oriented programing: class/instance OOP and prototyping OOP. Search them up.



To designer:
The |make new instance of ()| block should actually be
|make new instance of () at x:() y:()|

We need a way to set a variable to a perticular instance, and a block that reports the current instance in use. We also need a c block called
|make () do|
|
|
||||||||||||
and the bit in brackets is a dropdown which you can select a class of sprites and it will make EVERY instance of that sprite run the script in the c-block but also in the dropdown there will be a special option called "all" and when that is selected, every instance of everything will do it, and there will be an option called "stage" that makes the stage run it. Also, you can put a variable into the dropdown and if that variable reprisents an instance, ONLY that instance will run the script, otherwise (if the variable is not reprisenting an instance) the c block is ignored entirely.

Also, there should be a block called |delete()| with a similar input, exept without the option of selecting the stage, that will run the deletion method of the class/instance and delete the class or instance it is given as an input, and if it was a variable given as an input, the variable is set to 0.

Finaly, there should be a block called |change me into an instance of ()| which changes the instance this block is run in into another instance but preserving position, direction, costume, and any personal variables with the same name, but will NOT trigger the deletion method of the current instance or the creation method of the instance that is changed into.

Last edited by joefarebrother (2011-11-07 16:12:09)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#16 2011-11-07 17:43:49

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

joefarebrother wrote:

legoscratch wrote:

uhm... isn't scratch already object-oriented?

no. Object oriented allows for unlimited instances of a sprite. There are 2 types of object oriented programing: class/instance OOP and prototyping OOP. Search them up.



To designer:
The |make new instance of ()| block should actually be
|make new instance of () at x sad ) y sad )|

We need a way to set a variable to a perticular instance, and a block that reports the current instance in use. We also need a c block called
|make () do|
|
|
||||||||||||
and the bit in brackets is a dropdown which you can select a class of sprites and it will make EVERY instance of that sprite run the script in the c-block but also in the dropdown there will be a special option called "all" and when that is selected, every instance of everything will do it, and there will be an option called "stage" that makes the stage run it. Also, you can put a variable into the dropdown and if that variable reprisents an instance, ONLY that instance will run the script, otherwise (if the variable is not reprisenting an instance) the c block is ignored entirely.

Also, there should be a block called |delete()| with a similar input, exept without the option of selecting the stage, that will run the deletion method of the class/instance and delete the class or instance it is given as an input, and if it was a variable given as an input, the variable is set to 0.

Finaly, there should be a block called |change me into an instance of ()| which changes the instance this block is run in into another instance but preserving position, direction, costume, and any personal variables with the same name, but will NOT trigger the deletion method of the current instance or the creation method of the instance that is changed into.

you sound like a good programmer. Do you want to join?

Offline

 

#17 2011-11-07 18:53:37

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

working on the "make class do ()" block, but I'm having trouble converting the code from the "run" block.

Offline

 

#18 2011-11-07 21:58:54

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

that is innacurate. if you want to argue, this isn't the right forum.

Offline

 

#19 2011-11-08 15:29:53

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: OOP Blocks

samtwheels wrote:

joefarebrother wrote:

legoscratch wrote:

uhm... isn't scratch already object-oriented?

no. Object oriented allows for unlimited instances of a sprite. There are 2 types of object oriented programing: class/instance OOP and prototyping OOP. Search them up.



To designer:
The |make new instance of ()| block should actually be
|make new instance of () at x sad ) y sad )|

We need a way to set a variable to a perticular instance, and a block that reports the current instance in use. We also need a c block called
|make () do|
|
|
||||||||||||
and the bit in brackets is a dropdown which you can select a class of sprites and it will make EVERY instance of that sprite run the script in the c-block but also in the dropdown there will be a special option called "all" and when that is selected, every instance of everything will do it, and there will be an option called "stage" that makes the stage run it. Also, you can put a variable into the dropdown and if that variable reprisents an instance, ONLY that instance will run the script, otherwise (if the variable is not reprisenting an instance) the c block is ignored entirely.

Also, there should be a block called |delete()| with a similar input, exept without the option of selecting the stage, that will run the deletion method of the class/instance and delete the class or instance it is given as an input, and if it was a variable given as an input, the variable is set to 0.

Finaly, there should be a block called |change me into an instance of ()| which changes the instance this block is run in into another instance but preserving position, direction, costume, and any personal variables with the same name, but will NOT trigger the deletion method of the current instance or the creation method of the instance that is changed into.

you sound like a good programmer. Do you want to join?

No, I don't think so. I can't think of a way to make theese blocks work with squeak because I don't know uch about squeak. All I know is that theese functions exist in Game Maker.

Last edited by joefarebrother (2011-11-08 15:33:14)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#20 2011-11-10 17:21:45

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

bump.

Offline

 

#21 2011-11-10 17:22:51

Daroach1
Scratcher
Registered: 2011-09-11
Posts: 1000+

Re: OOP Blocks

sign me up as block maker (I am somewhat new to it but I have good block ideas) also, list me as Daroach not Daroach1 because I prefer it.

Last edited by Daroach1 (2011-11-10 17:23:24)


http://i47.tinypic.com/v83mhl.png

Offline

 

#22 2011-11-11 11:45:21

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

Daroach1 wrote:

sign me up as block maker (I am somewhat new to it but I have good block ideas) also, list me as Daroach not Daroach1 because I prefer it.

ok. can i see some of those ideas?

Offline

 

#23 2011-11-11 12:01:00

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

here's the website: oopblocks.comlu.com
how should I get you the username/password?

Offline

 

#24 2011-11-12 02:50:15

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

Re: OOP Blocks

Ummm... can you sorta count me out? I doln't think I have time. Sorry  sad .


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

Offline

 

#25 2011-11-12 16:30:59

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: OOP Blocks

Hardmath123 wrote:

Ummm... can you sorta count me out? I doln't think I have time. Sorry  sad .

ok. I'll handle website.

Offline

 

Board footer