Proanimation wrote:
Thanks I will add it to the converter.
Though I had the converter add the imports only when they were necessary
adding them as nessessary will work but those three will be necessary of almost every project
Offline
for the green flag i need to know do you want it to be auto clicked when project starts or do you actually want a green flag..
Offline
slayerrobe7 wrote:
for the green flag i need to know do you want it to be auto clicked when project starts or do you actually want a green flag..
I was thinking that we would not show the green flag and that when the program starts it will be auto clicked. In other words we could have that the when green flag clicked block could mean that it would start another method. But if we do that is there a way to call multiple methods at one time with out waiting for one to finish.
Offline
Proanimation wrote:
slayerrobe7 wrote:
for the green flag i need to know do you want it to be auto clicked when project starts or do you actually want a green flag..
I was thinking that we would not show the green flag and that when the program starts it will be auto clicked. In other words we could have that the when green flag clicked block could mean that it would start another method. But if we do that is there a way to call multiple methods at one time with out waiting for one to finish.
hmm so when the project starts it auto clicks the green flag. This could work if that every very simply i will work on a code... mean while i will keep this thread up with other blocks until my new book arrives Thursday... when that book arives i will likely have the nessessary knowlage to make the green flag code..
Offline
bump
Offline
slayerrobe7 wrote:
alright here is a code that all games will need to run inside for it opens the window..
note: the symbol <> in this means that these areas will be different for every projectCode:
//First it would be best to have the necessary imports defined.. import javax.swing.*; import java.awt.event*; import java.awt.*; //this code may get confusing public class <projectNAME> extends JFrame implements KeyListener, ActionListener { //code will go here <name here>d() { super("<nameHere>"); setSize(SIZE HERE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //code will go here setVisible(true); }
Though one thing I don't get is the one function that does the GUI I don't get why you have a letter D floating around. Typo maybe?
Offline
Proanimation wrote:
slayerrobe7 wrote:
alright here is a code that all games will need to run inside for it opens the window..
note: the symbol <> in this means that these areas will be different for every projectCode:
//First it would be best to have the necessary imports defined.. import javax.swing.*; import java.awt.event*; import java.awt.*; //this code may get confusing public class <projectNAME> extends JFrame implements KeyListener, ActionListener { //code will go here <name here>d() { super("<nameHere>"); setSize(SIZE HERE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //code will go here setVisible(true); }Though one thing I don't get is the one function that does the GUI I don't get why you have a letter D floating around. Typo maybe?
http://i46.tinypic.com/2873f55.png
yep typo
Offline
I think I found some errors in the code you gave me (I fixed them) :
//First it would be best to have the necessary imports defined..(I added the imports) import javax.swing.*; import java.awt.event.*; //forgot the . in event.*; import java.awt.*; //this code may get confusing public class <projectNAME> extends JFrame implements KeyListener, ActionListener { //code will go here <name here>() { //had a floating d around (was a typo) super("<nameHere>"); setSize(700, 700); //added default size setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //code will go here setVisible(true); } Public static void main(String[] args) { <name of project here> pr = new <name of project here>(); //you didn't add the (); part. }
I also added some things. I was thinking that we could have that each block has it's own function exept for C blocks hatblocks and broadcast blocks.
Last edited by Proanimation (2012-08-29 16:58:54)
Offline
alright what is the next block you want me to duplicate
Offline
slayerrobe7 wrote:
alright what is the next block you want me to duplicate
Any block you want. Though try to make the most used blocks first.
Offline
YMIBANWAH wrote:
I was wondering how do you type in the code for multiple sprites and the stage, and how will the code process things in brackets like say [hello] for example?
We will worry about that once we are able to make it able to convert with one sprite. Though I think we will make another function or class for each sprite.
Offline
I have an idea for the + - * and / operator blocks. first you declare 2 new variables. Then you set them to the values that you are operating on. Next you use the java operator that matches the scratch operator you are using on the variables. Then you set a third variable to the result and put that variable in to the code wherever you needed the operator.
Offline
Yes we could do it that way but then we have to have the converter reconise the first time it declared the variable/int/float whitch would be even more work. I was thinking of having the + and - as separate functions with the first and second float/int as it's parameters and it would report the answer.
Example:
public static int add { //Sorry I forget if the static part should be in it or not read note#3 float x; //first input float y; //second input float z == (x*y); //answer Sorry if I didn't assign the value right I haven't been on return(z); //while and won't be for a week or more :( } //So when the + block is used you just call this function and set the floats.
Offline
YMIBANWAH wrote:
I think we should have the set variable block where it simply sets the variable, and if the converter detects that it is the first time you used the variable it declares it before use.
I will add it to the converter once I am able to. Also I has the converter ask for all the variables in the beginning.
Offline
Proanimation wrote:
YMIBANWAH wrote:
I think we should have the set variable block where it simply sets the variable, and if the converter detects that it is the first time you used the variable it declares it before use.
I will add it to the converter once I am able to. Also I has the converter ask for all the variables in the beginning.
http://i46.tinypic.com/2873f55.png
coul you please stop with that pic it takes up alot of room
Offline
slayerrobe7 wrote:
coul you please stop with that pic it takes up alot of room
OK I will try to find a smaller one or edit it.
Offline
Sorry I haven't been on for a while I just got lucky to even get this post on scratch. I probibly won't be on for a long time (hopefully not)
Offline
YMIBANWAH wrote:
Oh wow this is back I might be able to help you a little bit more still.
Thanks all help will be needed.
Offline