Alice Community  

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

Reply
 
Thread Tools Display Modes
Individual item collision from a list?
Old
SpecOpsSammich
Junior Member
 
Status: Offline
Posts: 2
Join Date: Jan 2012
Unhappy Individual item collision from a list? - 01-16-2012, 05:12 PM

I'm making a lawn mowing game that has the player run over 30 ferns to clear a field in 3 minutes, and im having trouble getting the lawnmower interact with the ferns from a list. I have:
For all ferns in list, every ferns in list
If lawnmower distance to items from fernList < 2
then increment world scoreSet by 1
and fern turns invisible
Else nothing
I believe the error is the If part, trying to get the lawnmower to interact with all items from the list, then trying to get the individual item in the list to disappear. Is there an easier way to accomplish this? please help.

If it helps i attatched the world
Attached Files
File Type: a2w FinalProjectthatwontwork.a2w (5.56 MB, 1 views)
   
Reply With Quote
Old
Mr Kidnapper
Senior Member
 
Status: Offline
Posts: 442
Join Date: Feb 2011
Default 01-16-2012, 06:58 PM

Fix'd.
The problem with your world was that you already had two whiles in the same method.
One while can't be started until the things before it are finished, so in your configuration, if you wanted to start cutting ferns then the timer had to run out first. Also: A better function to use in terms of finding bounds is "Object is within threshold"
Attached Files
File Type: a2w FinalProjectthatdoeswork.a2w (5.55 MB, 7 views)
   
Reply With Quote
Old
SpecOpsSammich
Junior Member
 
Status: Offline
Posts: 2
Join Date: Jan 2012
Talking 01-16-2012, 07:09 PM

Aha! I was trying to cram in an example of everything i learned yesterday, thanks! And for some reason people in my class and I can never get within threshold to work

Last edited by SpecOpsSammich; 01-16-2012 at 07:11 PM. Reason: stuff
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 01-17-2012, 10:29 AM

Quote:
Originally Posted by SpecOpsSammich View Post
Aha! I was trying to cram in an example of everything i learned yesterday, thanks! And for some reason people in my class and I can never get within threshold to work
It's probably because the "within" function uses the distance from the center(usually the main axis) of the object. Which this means you have to know the depth of the object on top of the actual distance you want from the object itself.


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Reply

Tags
collision, list

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