Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Why Did the Chicken Cross the Road?
Old
nicnicman
Guest
 
Status:
Posts: n/a
Default Why Did the Chicken Cross the Road? - 11-10-2009, 10:40 PM

I'm working on the Why Did the Chicken Cross the Road? Project 1 Chapter 8 from the book. I would like the game(traffic) to stop immediately when the chicken is within a specific distance from any of a list of cars.

I wanted to use the BDE While event but I'm not sure how to get Alice to check if the chicken is within the distance from all cars in the list. I can get it to work with one car but I am using a number of cars in the program.

If anyone has any suggestions on how to accomplish this please let me know.
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 11-11-2009, 01:19 AM

Have you tried putting all of the cars in the list and then using the "for all together" structure?
   
Reply With Quote
Old
nicnicman
Guest
 
Status:
Posts: n/a
Default 11-11-2009, 09:05 AM

The For all together structure doesn't seem to work with in the BDE event. Also, it is not an available control structure when creating a function.

Unless, I'm not doing it right; Which is definitely possible.

Thanks for the suggestion. Please keep them coming.
   
Reply With Quote
Old
nicnicman
Guest
 
Status:
Posts: n/a
Default 11-11-2009, 11:15 AM

I think I've solved this using an Object function in the BDE to specify which car will be moving and trying to hit the chicken.

Still working on it though.
   
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 ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.