PDA

View Full Version : Sample World replication


talmalee
03-04-2013, 11:54 AM
Hello everyone,

I found my question was asked by two people in 2009 but neither of them were answered. Also, I asked in a different forum but don't seem to be getting any response so I have moved it to this forum to see if it might get noticed here.

In the book "Programming with Alice and Java" on page 78, Figure 4.16 shows the following code in an "event" that has been supplied on the CD in a sample world:

While [left button.depressed] is true
Begin: [Nothing]
During: [Left button.playMusic]
End: [Nothing]

On the next page of the textbook we are asked to create this same "event" for three more conditions but no matter what method I try to use the only choice I get is true or false and I am unable to get [middle button.depressed] is true as an option in the "event" while statement.

I have used version 2.0 and version 2.3 but neither version allows me to use this "[middle button.depressed] is true" while creating an "event". However, this option does appear when creating a "method" using a "while" statement.

The textbook example works and plays the music for the left button while the world is running and the left button is depressed because there is a boolean variable called depressed. The textbook is asking me to use the same method to create an "event" that will play music while the center button and the right button are depressed. As stated above, it works in a "method" but not an "event". Obviously Alice is supposed to allow this or the sample world could not have an "event" like the above example already working.

Why won't it let me do this the exact same way as the sample world? What am I missing? Hopefully my explanation has made sense and someone will be able to tell me what I am doing wrong.

Thank you in advance!

bob3584
03-04-2013, 02:50 PM
Post the world, wait one or two days, and I'll send you a video tutorial on what you did wrong.

talmalee
03-05-2013, 11:46 AM
Here is the sample world from the textbook. You will see that the original file has an "event" that allows the music to play when the button is depressed using "left button.depressed". I have created the "events" for the middle and right buttons but cannot find a way to enter "middle button.depressed" or "right button.depressed".

When those work the next step is to create an "event" where the crowd cheers if all three buttons are depressed.

Thank you again!

bob3584
03-05-2013, 01:06 PM
Neither can I...

talmalee
03-05-2013, 01:28 PM
Thank you for trying. Is there a way to submit a problem with Alice developers?

bob3584
03-05-2013, 04:58 PM
Ahhh, no. I can fix it, but not in the way you have it set up. I would need to erase several of the functions and make new ones. I'm not saying you did anything wrong, just that I don't understand how you did what you did.

talmalee
03-05-2013, 05:02 PM
I didn't do it.

This is a sample world supplied with the textbook. The assignment is to replicate what they did with the other two buttons. I can think of other ways to do it as well but I was trying to follow the textbook assignment.

bob3584
03-05-2013, 05:25 PM
Ok.