Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
Collision ON/OFF
Old
chrytobug
Junior Member
 
chrytobug's Avatar
 
Status: Offline
Posts: 7
Join Date: Jul 2015
Location: Southern California
Default Collision ON/OFF - 08-25-2015, 08:01 PM

I am creating a first person game set in a museum. There are various themed rooms the player moves around in during the game. I have set up a simple collision detection using a list of objects enabled by a While world is running event. If I want the camera to move to another room at the completion of the level, do I have to turn the collision detection off, move the camera, then turn the collision detection back on again or can Alice execute the camera move without the necessity of the collisionON/OFF option.

Thanks for taking time to answer my question.
Chrytobug
   
Reply With Quote
Old
CodeMan
Member
 
CodeMan's Avatar
 
Status: Offline
Posts: 36
Join Date: Aug 2013
Location: Northern Virginia
Default 08-26-2015, 05:07 AM

I did this before in one of my FPS's, its pretty simple.
If there is something that can stop your while loop just turn that off and the collision goes off, and then turn it back on and the collision comes back on.

Also I would suggest using lists for each room and just turning on the room you are in.

Best of luck and if you need any more help I could post a demo or something

-RavenOfCode


Im really RavenOfCode... shhhh....

Currently work on my first app :)
   
Reply With Quote
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default 08-26-2015, 07:45 AM

Codeman is correct. The simple solution is to create a Boolean on/off switch, and then insert an if/else statement into your while loop that checks it for true/false before scanning the list.
   
Reply With Quote
Old
chrytobug
Junior Member
 
chrytobug's Avatar
 
Status: Offline
Posts: 7
Join Date: Jul 2015
Location: Southern California
Smile 08-27-2015, 10:38 PM

Oh good! It sounds like I am on the right track. I created lists of objects for each level/room in the game, the collision detection checks a level number variable that indicates what level the player is on. If the player is one level 1, the method selects the level 1 objects list to use in collision detection. The collision detection is set up with a Boolean variable collisionOn. If the variable is true, then the collision detection checks the level and uses those objects to "bounce"off of. When the player moves to the next level, the moveToLevel method turns off the collision detection, then turns it back on when the camera is in the new location/room.

Thanks for answering my question! I hope to share my work when I complete my game next week.

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