rubiks_cube_guy238 wrote:
If it's not too late, I think you should base this of of BYOB3. It's basically already object-oriented. The only thing it's missing is making the sprites object-oriented.
How so?
(The part about BYOB being and OOP; I've never heard of that before)
Offline
Here, I dug it out for you:
I wrote:
Hmm... I've seem to run into another problem!
![]()
The Instance Scripts pane won't evaluate the blocks in it. I built the pane by adding another instance variable to the ScriptableScratchMorph called "instanceBlocksBin", and in initialize I addedCode:
self instanceBlocksBin := ScratchScriptsMorph new.and changed the method in:
Code:
Scratch-UI-Panes >> ScratchScriptEditorMorph >> accessing >> category:from
Code:
currentCategory: aString | xOffset | currentCategory _ aString. self target ifNil: [^ self]. xOffset _ 0. World activeHand newKeyboardFocus: nil. currentCategory = 'Scripts' ifTrue: [ pageViewerMorph contents: self target blocksBin]. currentCategory = 'Costumes' ifTrue: [ pageViewerMorph contents: (self target costumesPage: xOffset)]. currentCategory = 'Sounds' ifTrue: [ pageViewerMorph contents: (self target soundsPage: xOffset)]. pageViewerMorph contents color: ScratchFrameMorph scriptsPaneColor. self world ifNotNil: [self world startSteppingSubmorphsOf: pageViewerMorph contents].to
Code:
currentCategory: aString | xOffset | currentCategory _ aString. self target ifNil: [^ self]. xOffset _ 0. World activeHand newKeyboardFocus: nil. currentCategory = 'Class Scripts' ifTrue: [ pageViewerMorph contents: self target blocksBin]. currentCategory = 'Instance Scripts' ifTrue: [ pageViewerMorph contents: self target instanceBlocksBin]. currentCategory = 'Costumes' ifTrue: [ pageViewerMorph contents: (self target costumesPage: xOffset)]. currentCategory = 'Sounds' ifTrue: [ pageViewerMorph contents: (self target soundsPage: xOffset)]. pageViewerMorph contents color: ScratchFrameMorph scriptsPaneColor. self world ifNotNil: [self world startSteppingSubmorphsOf: pageViewerMorph contents].Anyone have any idea to fix this?
Help would be appriciated!
![]()
Last edited by Jwosty (2010-08-26 18:38:37)
Offline
Do not worry. Everyone has a right to creativity.
Offline
rdococ wrote:
Do not worry. Everyone has a right to creativity.
I know!
Daffy22 wrote:
Sorry but something similar to this is aleady in the making and will be released in a few months called Atom. Sorry.
![]()
I looked at the Atom thread and it didn't look like it has anything to do with Blocktalk.
1. It is actually a Scratch program, not an actual Scratch Modification
2. It dosen't use classes and instances
Offline
May I ask, do instances act as sprites attatched to the original instance sprite? And you could move where they are attatched? If so, then creating body parts would be easier in Blocktalk than Scratch!
Offline
rdococ wrote:
May I ask, do instances act as sprites attatched to the original instance sprite? And you could move where they are attatched? If so, then creating body parts would be easier in Blocktalk than Scratch!
I think that's pretty much what he means.
EDIT: I was just thinking, how about instead of a [create a new instance of me] block as you mentioned before, a [create a new instance of []] the input being the name of the class script that you made.
Last edited by ScratchReallyROCKS (2010-08-30 16:15:58)
Offline
rdococ wrote:
May I ask, do instances act as sprites attatched to the original instance sprite? And you could move where they are attatched? If so, then creating body parts would be easier in Blocktalk than Scratch!
No, the class will not be an actual object on the stage. Think of the class as being an idea, but it would be able to create new instances of itself.
Offline
ScratchReallyROCKS wrote:
EDIT: I was just thinking, how about instead of a [create a new instance of me] block as you mentioned before, a [create a new instance of []] the input being the name of the class script that you made.
Yea! Great idea!
Blocktalk is supposed to be modeled off Smalltalk, and Smalltalk can doo that. So I might as well!
Offline
Jwosty wrote:
rdococ wrote:
May I ask, do instances act as sprites attatched to the original instance sprite? And you could move where they are attatched? If so, then creating body parts would be easier in Blocktalk than Scratch!
No, the class will not be an actual object on the stage. Think of the class as being an idea, but it would be able to create new instances of itself.
Not the class, but the instnances. What is an instance and a class?
Offline
rdococ wrote:
Jwosty wrote:
rdococ wrote:
May I ask, do instances act as sprites attatched to the original instance sprite? And you could move where they are attatched? If so, then creating body parts would be easier in Blocktalk than Scratch!
No, the class will not be an actual object on the stage. Think of the class as being an idea, but it would be able to create new instances of itself.
Not the class, but the instnances. What is an instance and a class?
Okay. See, a class is like an invisible box factory, and the instances are like the boxes the factory produces. But the boxes do have their own attributes. EX: Instances have their own position at first, but you can change how they look, where they are and variables. Does that help?
Offline
Jwosty wrote:
rdococ wrote:
Jwosty wrote:
No, the class will not be an actual object on the stage. Think of the class as being an idea, but it would be able to create new instances of itself.
Not the class, but the instnances. What is an instance and a class?
Okay. See, a class is like an invisible box factory, and the instances are like the boxes the factory produces. But the boxes do have their own attributes. EX: Instances have their own position at first, but you can change how they look, where they are and variables. Does that help?
![]()
It's kind of like the clone blocks in Panther.
Offline
ScratchReallyROCKS wrote:
Jwosty wrote:
rdococ wrote:
Not the class, but the instnances. What is an instance and a class?
Okay. See, a class is like an invisible box factory, and the instances are like the boxes the factory produces. But the boxes do have their own attributes. EX: Instances have their own position at first, but you can change how they look, where they are and variables. Does that help?
![]()
It's kind of like the clone blocks in Panther.
Yes, kinda.
Offline
ScratchReallyROCKS wrote:
Jwosty wrote:
rdococ wrote:
Not the class, but the instnances. What is an instance and a class?Okay. See, a class is like an invisible box factory, and the instances are like the boxes the factory produces. But the boxes do have their own attributes. EX: Instances have their own position at first, but you can change how they look, where they are and variables. Does that help?
![]()
It's kind of like the clone blocks in Panther.
No, not really.
Okay, a class is kind of like a blueprint--it is a design of something, not one of those things itself. From it, you can create as many of whatever it is that the blueprint shows (instances), and each of those can have its own unique properties like its materials, position, etc. These are called instance variables. The blueprint can have things written on it, such as a note about which type of steel to use. These are class variables, which can be accessed by any instance but aren't unique to that instance--they are shared by all instances, and belong to the class itself--the blueprint.
Offline
nXIII wrote:
ScratchReallyROCKS wrote:
Jwosty wrote:
Okay. See, a class is like an invisible box factory, and the instances are like the boxes the factory produces. But the boxes do have their own attributes. EX: Instances have their own position at first, but you can change how they look, where they are and variables. Does that help?
![]()
It's kind of like the clone blocks in Panther.
No, not really.
Okay, a class is kind of like a blueprint--it is a design of something, not one of those things itself. From it, you can create as many of whatever it is that the blueprint shows (instances), and each of those can have its own unique properties like its materials, position, etc. These are called instance variables. The blueprint can have things written on it, such as a note about which type of steel to use. These are class variables, which can be accessed by any instance but aren't unique to that instance--they are shared by all instances, and belong to the class itself--the blueprint.
That make sense. I still don't get it completely, but that makes sense.
EDIT: Oh, I think I get it! So it's kinda like having an architectural drawing for some mass-building chain. You take that drawing and photocopy it, but add separate annotations and additions to each one. Does that sound right?
Last edited by ScratchReallyROCKS (2010-09-02 19:57:06)
Offline
nXIII wrote:
ScratchReallyROCKS wrote:
Jwosty wrote:
Okay. See, a class is like an invisible box factory, and the instances are like the boxes the factory produces. But the boxes do have their own attributes. EX: Instances have their own position at first, but you can change how they look, where they are and variables. Does that help?
![]()
It's kind of like the clone blocks in Panther.
No, not really.
Okay, a class is kind of like a blueprint--it is a design of something, not one of those things itself. From it, you can create as many of whatever it is that the blueprint shows (instances), and each of those can have its own unique properties like its materials, position, etc. These are called instance variables. The blueprint can have things written on it, such as a note about which type of steel to use. These are class variables, which can be accessed by any instance but aren't unique to that instance--they are shared by all instances, and belong to the class itself--the blueprint.
Great explanation!
But just for more info, this is what my BotsInc book says:
BotsInc-OriginalEnglish wrote:
[b]Creating a New Robot
The environment already contains a robot, but now I am going to show you how to create new robots. If you are not satisfied with having only one robot, you can create a new one by sending the appropriate message to a robot factory. A robot factory is graphically represented as an orange box surrounded by a light blue box, in the middle of which the word Bot is written,
as shown in Figure 1-9. In Squeak jargon, and in general in the jargon of object-oriented programming, a robot factory is called a class. Classes (factories that produce objects, such as robots) have a name starting with an uppercase letter. Hence this is the class Bot and not bot.
EDIT: Outposted by ScratchReallyRocks... :S
Last edited by Jwosty (2010-09-02 19:54:48)
Offline
nXIII wrote:
ScratchReallyROCKS wrote:
Jwosty wrote:
Okay. See, a class is like an invisible box factory, and the instances are like the boxes the factory produces. But the boxes do have their own attributes. EX: Instances have their own position at first, but you can change how they look, where they are and variables. Does that help?![]()
It's kind of like the clone blocks in Panther.
No, not really.
Okay, a class is kind of like a blueprint--it is a design of something, not one of those things itself. From it, you can create as many of whatever it is that the blueprint shows (instances), and each of those can have its own unique properties like its materials, position, etc. These are called instance variables. The blueprint can have things written on it, such as a note about which type of steel to use. These are class variables, which can be accessed by any instance but aren't unique to that instance--they are shared by all instances, and belong to the class itself--the blueprint.
And just to be confusing (Myself atleast) what about structs? (Structures) ... and example of one of those would be a Vector3, they're sort of like classes aren't they?
Offline
markyparky56 wrote:
nXIII wrote:
ScratchReallyROCKS wrote:
It's kind of like the clone blocks in Panther.
No, not really.
Okay, a class is kind of like a blueprint--it is a design of something, not one of those things itself. From it, you can create as many of whatever it is that the blueprint shows (instances), and each of those can have its own unique properties like its materials, position, etc. These are called instance variables. The blueprint can have things written on it, such as a note about which type of steel to use. These are class variables, which can be accessed by any instance but aren't unique to that instance--they are shared by all instances, and belong to the class itself--the blueprint.And just to be confusing (Myself atleast) what about structs? (Structures) ... and example of one of those would be a Vector3, they're sort of like classes aren't they?
Well, I've never heard of those...
Offline
markyparky56 wrote:
nXIII wrote:
ScratchReallyROCKS wrote:
It's kind of like the clone blocks in Panther.No, not really.
Okay, a class is kind of like a blueprint--it is a design of something, not one of those things itself. From it, you can create as many of whatever it is that the blueprint shows (instances), and each of those can have its own unique properties like its materials, position, etc. These are called instance variables. The blueprint can have things written on it, such as a note about which type of steel to use. These are class variables, which can be accessed by any instance but aren't unique to that instance--they are shared by all instances, and belong to the class itself--the blueprint.And just to be confusing (Myself atleast) what about structs? (Structures) ... and example of one of those would be a Vector3, they're sort of like classes aren't they?
Structures are just groups of data; you can make classes with them, but it would be a fair amount of extra work.
Offline
I'm a decent squeaker. If you want to see my best work, check this out.
Engine Block. I have learned a lot just from reading the scratch source, so all I know how to do is mod scratch. I can make new blocks and features though. IDK if you want someone like me.
Last edited by midnightleopard (2010-09-17 13:10:17)
Offline
midnightleopard wrote:
I'm a decent squeaker. If you want to see my best work, check this out.
Engine Block. I have learned a lot just from reading the scratch source, so all I know how to do is mod scratch. I can make new blocks and features though. IDK if you want someone like me.
Well thanks, but I can't except your help. I really want to, but my dad doesn't want me to be working with total strangers.
Offline