Alice Community  

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

Reply
 
Thread Tools Display Modes
Collision Detection with variables
Old
FatRefrigerator
Member
 
FatRefrigerator's Avatar
 
Status: Offline
Posts: 28
Join Date: Aug 2010
Location: 5000 feet up
Default Collision Detection with variables - 09-28-2011, 12:33 PM

How does one make a collision detection system that doesn't involve simply making an event the involves 2 objects?

I want to be able to define a set list of objects that will be the only ones that are detecting.

Ex: a car with a bunch of buildings around it, making it react when it collides with the buildings, but without making a separate method for each building.
   
Reply With Quote
Old
GameKid
Senior Member
 
GameKid's Avatar
 
Status: Offline
Posts: 467
Join Date: May 2011
Location: My magnificent castle
Default 09-30-2011, 12:06 AM

If [Car] (Collision with building one here)
If: [Car] Move back [0.1] meters Duration=0
Else:
If [Car] (Collision with building two here)
If: [Car] Move back [0.1] meters Duration=0
Else:
If [Car] (Collision with building three here)
If: [Car] Move back [0.1] meters Duration=0
^Use that sort of thing.


[COLOR=e4eaf2]Your text here[/COLOR]
Come on, you know you want to try it.
   
Reply With Quote
Old
FatRefrigerator
Member
 
FatRefrigerator's Avatar
 
Status: Offline
Posts: 28
Join Date: Aug 2010
Location: 5000 feet up
Default 09-30-2011, 12:32 PM

What you said is what I can already do...

Quote:
Originally Posted by FatRefrigerator View Post
without making a separate method for each building.
Is there any other way?
   
Reply With Quote
Old
Mr Kidnapper
Senior Member
 
Status: Offline
Posts: 442
Join Date: Feb 2011
Default 09-30-2011, 05:27 PM

Make a list or array variable with a series of objects that are to be your collision proxy.
Then, make an if statement containing a do for all together that detects if your object is near the collision proxy.
   
Reply With Quote
Old
InsertName
Senior Member
 
InsertName's Avatar
 
Status: Offline
Posts: 341
Join Date: Jun 2011
Location: In a house
Default 09-30-2011, 07:52 PM

Click here to veiw a Thread on the same thing


__№_₤⅞__
Handguns: http://www.alice.org/community/showthread.php?p=45349
MINECRAFT IN ALICE: http://alice.org/community/showthread.php?p=48208
My Stupid Animations: http://alice.org/community/album.php?albumid=119
   
Reply With Quote
Old
GameKid
Senior Member
 
GameKid's Avatar
 
Status: Offline
Posts: 467
Join Date: May 2011
Location: My magnificent castle
Default 10-01-2011, 02:04 AM

Quote:
Originally Posted by FatRefrigerator View Post
What you said is what I can already do...



Is there any other way?
That's entirely different.
You said methods, but I apologize for misunderstanding.


[COLOR=e4eaf2]Your text here[/COLOR]
Come on, you know you want to try it.
   
Reply With Quote
Old
FatRefrigerator
Member
 
FatRefrigerator's Avatar
 
Status: Offline
Posts: 28
Join Date: Aug 2010
Location: 5000 feet up
Default 10-03-2011, 12:28 PM

Quote:
Originally Posted by GameKid View Post
You said methods, but I apologize for misunderstanding.
Apology accepted, I realized after that I had indeed asked for methods, which is what you gave me, but thank you all for your help. Perhaps now I can inch closer to finishing this project...
   
Reply With Quote
Argh...
Old
FatRefrigerator
Member
 
FatRefrigerator's Avatar
 
Status: Offline
Posts: 28
Join Date: Aug 2010
Location: 5000 feet up
Default Argh... - 10-04-2011, 01:08 PM

Tried to implement what you suggested...and it didn't work. Not sure if I didn't do what you had in mind or if Alice just doesn't like me, but I'm attaching the world I put it in. You might wanna take a look at the other methods and events I have and see if they might be affecting it.

thanks,
Fatrefrigerator
Attached Files
File Type: a2w collision detection.a2w (17.40 MB, 21 views)
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 10-05-2011, 08:56 PM

I made a maze world a long time ago to demonstrate collisions with a bunch of walls that are all in a list. It just checks to see if the person is touching anything in the list and it pushes it back if it is. The problem is though that it only works if you put up walls, rectangles. You would have to tweak it to make it work with other objects, but it works fine if you just put a bunch of walls around the objects where you don't want it to pass through.

Thread is here


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
gilhritrobin
Junior Member
 
Status: Offline
Posts: 5
Join Date: Oct 2011
Default 10-09-2011, 03:08 AM

This message has been approved by GameKid

   
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.