Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
Sample World replication
Old
talmalee
Member
 
Status: Offline
Posts: 17
Join Date: Dec 2012
Default Sample World replication - 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!
   
Reply With Quote
Old
bob3584
Senior Member
 
Status: Offline
Posts: 180
Join Date: Jan 2013
Location: In a Cardboard Box.
Default 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.


My avatar will always be a preview of what I am currently working on.
   
Reply With Quote
Thank you
Old
talmalee
Member
 
Status: Offline
Posts: 17
Join Date: Dec 2012
Default Thank you - 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!
Attached Files
File Type: zip stadium.zip (1.54 MB, 1 views)
   
Reply With Quote
Old
bob3584
Senior Member
 
Status: Offline
Posts: 180
Join Date: Jan 2013
Location: In a Cardboard Box.
Default 03-05-2013, 01:06 PM

Neither can I...


My avatar will always be a preview of what I am currently working on.
   
Reply With Quote
Wonder what the Alice developers would do?
Old
talmalee
Member
 
Status: Offline
Posts: 17
Join Date: Dec 2012
Default Wonder what the Alice developers would do? - 03-05-2013, 01:28 PM

Thank you for trying. Is there a way to submit a problem with Alice developers?
   
Reply With Quote
Old
bob3584
Senior Member
 
Status: Offline
Posts: 180
Join Date: Jan 2013
Location: In a Cardboard Box.
Default 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.


My avatar will always be a preview of what I am currently working on.
   
Reply With Quote
Old
talmalee
Member
 
Status: Offline
Posts: 17
Join Date: Dec 2012
Default 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.
   
Reply With Quote
Old
bob3584
Senior Member
 
Status: Offline
Posts: 180
Join Date: Jan 2013
Location: In a Cardboard Box.
Default 03-05-2013, 05:25 PM

Ok.


My avatar will always be a preview of what I am currently working on.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.