Alice Community  

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

Reply
 
Thread Tools Display Modes
How do I make it so that the camera cant go through the maze walls?
Old
TheWhiteGuy
Guest
 
Status:
Posts: n/a
Unhappy How do I make it so that the camera cant go through the maze walls? - 03-16-2011, 11:41 AM

Ok so i have created this big maze with zombies and a few other things but i wasnt able to figure out how to make it so that the camera was unable to go through the walls before the project was due. But now I want to fix it but i still cant figure it out can anyone help me?(I hope i attached the file right)
Attached Files
File Type: a2w The Good MAze.a2w (17.89 MB, 15 views)
   
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 03-16-2011, 02:11 PM

Quote:
Originally Posted by TheWhiteGuy View Post
Ok so i have created this big maze with zombies and a few other things but i wasnt able to figure out how to make it so that the camera was unable to go through the walls before the project was due. But now I want to fix it but i still cant figure it out can anyone help me?(I hope i attached the file right)
have you tried setting up an if/else statement to say if camera is "blank" meters from maze wall, and have the camera move "meters" away from the maze wall?
   
Reply With Quote
Old
TheWhiteGuy
Guest
 
Status:
Posts: n/a
Default 03-17-2011, 11:21 AM

yeah and nothing happens i also tried to add a square next to the wall and tried it with that too and it still didn't work
   
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 03-17-2011, 01:32 PM

Quote:
Originally Posted by TheWhiteGuy View Post
yeah and nothing happens i also tried to add a square next to the wall and tried it with that too and it still didn't work
well making a working collision detection is tough to do, try the box method that you did again, but this time make a copy of that box, and move it towards the camera, but leave it level with the other box that is in the maze wall, then set the method up with the two boxes, that should be more effective.
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 03-18-2011, 07:10 PM

I believe if you choose the event that allows the user to control the camera via (I forget whether it was the arrow keys or mouse), the camera has a built-in collision detection.


Projects
-Escape the Kitchen
-That ninja animation
-Hill Collision

Upcoming Projects
-Some penguin adventure game?
   
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 03-18-2011, 10:37 PM

Quote:
Originally Posted by reuben2011 View Post
I believe if you choose the event that allows the user to control the camera via (I forget whether it was the arrow keys or mouse), the camera has a built-in collision detection.
not with all objects though, i thought the same thing, but it only works with a few buildings and some objects. which is useful in some cases but not the best resort to fall back on, that is in my experiences atleast.


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
Left something out
Old
Matchewawa
Member
 
Status: Offline
Posts: 32
Join Date: Feb 2011
Default Left something out - 03-21-2011, 06:10 PM

I think you're leaving out a detail. Up in the events tab, make sure the event with the method for collision is set to 'while the world is running', not 'when the world starts'. Otherwise, it just reads the 'if' the moment you start the animation.
   
Reply With Quote
Old
JeSukC
Guest
 
Status:
Posts: n/a
Default 03-22-2011, 02:20 PM

The easiest method to detect whether the object is colliding with the wall is to detect its distance. However, you can also choose the route to add square panels all around the maze and use an if/else statement.

One of the main things to note here is distance. For what you are trying to accomplish, use an if/else statement and compute the distance from the camera to the wall of the maze. Then, if the distance is 0 or close to the wanted number, stop the camera from moving.
   
Reply With Quote
Old
TheWhiteGuy
Guest
 
Status:
Posts: n/a
Default 03-28-2011, 11:19 AM

Quote:
Originally Posted by Matchewawa View Post
I think you're leaving out a detail. Up in the events tab, make sure the event with the method for collision is set to 'while the world is running', not 'when the world starts'. Otherwise, it just reads the 'if' the moment you start the animation.
im using the version for the mac and i dont see this in the create a new event
   
Reply With Quote
Old
TheWhiteGuy
Guest
 
Status:
Posts: n/a
Default 04-01-2011, 11:19 AM

nvm found it
   
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.