bharvey wrote:
14God wrote:
Sorry I seem to speak in picture.
Those look like good ideas. Don't hold your breath, though -- we're going to have trouble getting OOP really ready by next month.
Next month... that is pretty close.
Offline
My dad has made kinda a cool agreement with me: If I can program something I can use it from time to time to help with my school work. He says its good practice since I want to be a programmer and it makes me think through a process more thoroughly. (forgive any typing/spelling errors I might have made I feel dizzy and borderline sick)
Offline
@ bharvey & Jens
Some hints from the tinkery ...
1- if you <Clone> a sprite with one Initialization script you have a better control than using <Duplicate>
2 - by doing so you can precisely define which method you like to implement into the New cloned sprite
3 - The scripts defining a Class library are Set into "method variables" .
4 - When you instantiate a New sprite, the initialization script CLONE + ATTRIBUTE sets and defines methods used by New.
5 - "method" variables allow a better control than with blocks.
5 - the initialization script of a new sprite can use methods coming from several Class libraries.
etc
Offline
Today's exciting experimental version getting us closer to the ultimate design goal:
Jens wrote:
This experimental release includes the bugfix from 3.0.9 and features a complete pass through all built-in attributes except costumes and sounds (but including the costume #).
If a sprite is the instance of another one you can use the DELETE block to remove the instance's attribute, in which case two things happen:
- the instance's reporter block for the deleted attribute becomes "ghosted" in the palette
- the instance now dynamically (!) inherits the deleted attribute's /value/ from its prototype
You can also disable most built-in attributes through their corresponding reporter block's context menu in the palette by selecting "inherit" or "disinherit".
If the inherited attribute is a visual one, such as X POSITION, SIZE, DIRECTION or COSTUME # etc., any changes which occur in the prototype are automatically propagated to all instances, regardless whether through the GUI or via blocks or scripts.
The dynamic value look-up/propagation link gets broken once the instance again shadows the attribute, by assigning a value to it (again either through the GUI or via a script).
This allows for surprisingly complex dependencies and turtle movements, so it'll hopefully take you a while to play through all levels :-)
Enjoy!
--Jens
Offline
Jens wrote:
If a sprite is the instance of another one you can use the DELETE block to remove the instance's attribute, in which case two things happen:
- the instance's reporter block for the deleted attribute becomes "ghosted" in the palette
- the instance now dynamically (!) inherits the deleted attribute's /value/ from its prototype
Not sure what DELETE block your talking about or how to do that.
Offline
14God wrote:
Not sure what DELETE block your talking about or how to do that.
Clone a sprite and do this in the clone.
EDIT: But I'm having trouble getting the inheriting to remain active when the parent's attribute is changed.
EDIT2: New version in post below fixes that bug.
Last edited by bharvey (2011-02-09 10:48:41)
Offline
What is new in BYOB 3.0.9?
Offline
I remade the (list->sentence) block!
What do you think?
EDIT: The background of the block editor is the same color as the forum.
EDIT2: Alternate code:
list->sentence (L) script variables (a)> set [a] to (copy of (L)) replace item (last) of (a) with (join (item (last) of (a) [ ]) report (letters (1) through ((length of ((a) as text)) - (1) of ((a) as text))
The (letters () through () of []) can be made like this: (variables are shown with * on each side unless it is clearly obvious that it is a variable. (*var*) )
letters (1) through (2) of (text) script variables (report)(count)<> set [report] to [] set [count] to (*1*) repeat until <(*count*) = ((*2*) + (1)> set [report] to (join (*report*)(letter (*count*) of (*text*)) change [count] by (1) report (*report*)
EDIT3: Just realized I uploaded a picture of the (letters () through () of [] ) block:
But it's slightly primitive, use the above script.
Last edited by scimonster (2011-02-09 07:03:43)
Offline
New experimental version fixes bug in last night's version:
Jens wrote:
Take this one instead of last night's :-)
This version fixes a bug in last night's experimental release's sprite cloning mechanism that would prevent inherited attributes from staying inherited.
I'm also including your "sine-wave drawing by inheritance" experiment as demo project in the zip file.
Enjoy!
--Jens
Last edited by bharvey (2011-02-09 14:43:39)
Offline
scimonster wrote:
I remade the (list->sentence) block!
Huh, good point, I'd forgotten that "as text" puts spaces between the words. You can just use it instead of list->sentence. I don't see why you have to do all that copying and stuff.
And by a remarkable coincidence, to answer your other message, 3.0.9 fixes a bug in list->sentence.
Offline
bharvey wrote:
scimonster wrote:
I remade the (list->sentence) block!
Huh, good point, I'd forgotten that "as text" puts spaces between the words. You can just use it instead of list->sentence. I don't see why you have to do all that copying and stuff.
And by a remarkable coincidence, to answer your other message, 3.0.9 fixes a bug in list->sentence.
The copying is in case they are all 1 character.
Offline
bharvey wrote:
scimonster wrote:
The copying is in case they are all 1 character.
Oh, how interesting! I had no idea AS TEXT did that! Too clever for its own good.
It is exactly the same as the scratch block (list), no?
Offline
Jens wrote:
This one creates the clone, deletes its yPos property and starts it off drawing in a single script. It even makes the clone delete itself upon hitting the wall.
I'm beginning to enjoy this!
P.S. The zip file in #2688 now contains this new version so if you see this message in the same session as that one, you already have the new project and don't have to download it from this message!
Last edited by bharvey (2011-02-09 14:48:19)
Offline
Hello everyone, I thought you might all be interested in my new project, FractalDesigner. This project not only creates (almost) any fractal, but it does so with simulated recursion! This is even more impressive when you consider that I made this in a program like BYOB called Scratch which doesn't have any custom procedures.
Offline
Lightning1234 wrote:
Is there a way to make BYOB projects into EXE's?
Not actual exe but yeah there called exe and they are not editable and go straight to presentation mode. Under share click compile this project.
Offline
scimonster wrote:
bharvey wrote:
Oh, how interesting! I had no idea AS TEXT did that! Too clever for its own good.
It is exactly the same as the scratch block (list), no?
Yes. But I never used that Scratch list block!
Offline
rubiks_cube_guy238 wrote:
my new project, FractalDesigner.
O. M. G! That's incredible.
Offline