Alice Community  

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

Reply
 
Thread Tools Display Modes
Why isn't this working?
Old
homerungus
Junior Member
 
Status: Offline
Posts: 3
Join Date: Mar 2012
Exclamation Why isn't this working? - 03-19-2012, 10:36 PM

I have an assignment and I can't for the life of me figure out why this isn't working.
I need the Compfish to go invisible if the Playerfish crosses the flagpole first, and vice-versa.
If one of the fish are within 0.1 meters of the flagpole, why isn't the losing fish going invisible?
The distance from the Playerfish to the Flagpole is: 2.607361415980672
This is all my code except what was given, just don't know where I'm going wrong.

Thanks in advance.
Attached Images
File Type: jpg Upload1.jpg (68.6 KB, 26 views)
File Type: jpg Upload2.jpg (85.5 KB, 26 views)

Last edited by homerungus; 03-19-2012 at 10:39 PM.
   
Reply With Quote
Old
room14
Senior Member
 
room14's Avatar
 
Status: Offline
Posts: 549
Join Date: Nov 2009
Location: Auckland New Zealand
Default 03-19-2012, 10:39 PM

you need to loop the If method.


:D
   
Reply With Quote
Old
homerungus
Junior Member
 
Status: Offline
Posts: 3
Join Date: Mar 2012
Default 03-19-2012, 10:49 PM

I tried that and it didn't make any difference. Any other ideas?
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 03-19-2012, 11:46 PM

It probably doesn't get close enough.

Increase the distance to 1 meter and see if it works.

Then shrink the distance until it's exactly the size it needs to be.


(')>
   
Reply With Quote
Old
homerungus
Junior Member
 
Status: Offline
Posts: 3
Join Date: Mar 2012
Default 03-20-2012, 12:20 AM

Yes that was the problem, it wasn't getting close enough to the flagpole.
Also the loop on the if statement did make it work after all. No loop = no invisible fish.
Think I'll find another function than "in front of" too. It doesn't necessarily need to be in front of the fish to be close enough to the flagpole to win. Although it does seem to work that way.

Thanks so much for your help, it's very much appreciated.
   
Reply With Quote
Reply


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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.