Alice Community  

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

Reply
 
Thread Tools Display Modes
To Keep an object from crossing other objects...
Old
Plangam
Junior Member
 
Plangam's Avatar
 
Status: Offline
Posts: 3
Join Date: Apr 2012
Location: Mexico
Default To Keep an object from crossing other objects... - 04-14-2012, 10:32 PM

I'm doing my final project, I wanted to make kind of an RPG... You can control a little girl with the keyboard, and she is able to enter some buildings, but then there's that problem I'm dealing with, there's nothing that keeps the girl from going through walls and other characters. And there's even a part in which she's to go through a maze... What would you do?

I like Alice pretty much. I know it's quite basic, but it's the first time in school that we use something like that...

I could create a boolean variable, and place hundreds of invisible objects in rows along the walls. when the girl came too close to any of the objects, or to any of the other characters, the variable would turn to false, and the character wouldn't be able to move any further... That's the best I've come to... Is there not a property to tell Alice to avoid an object from going through another object? As if they really were 'solid'...? Or some other alternative to this...?

Thank you, in advance, of course...

Last edited by Plangam; 04-15-2012 at 02:12 PM.
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 04-15-2012, 10:59 AM

Unfortunately, one of biggest problems with Alice is that it contains no inborn collision detection, which makes it very hard to do what you're asking. However, some forum members have made a few collision detection programs, which you may be able to implement in your world.

Try this one

Or this one.


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Old
Plangam
Junior Member
 
Plangam's Avatar
 
Status: Offline
Posts: 3
Join Date: Apr 2012
Location: Mexico
Default 04-15-2012, 02:10 PM

Thank you! If I'm right, in the first one the program prevents the radii of the two objects from colliding, right? But even if I fully understood the code, I think it wouldn't help me... The second one is great! But I don't know what he did... he also used cylinders, though... Do you understand how he made it work? I think I could do the same in my game, but... He also used variables... maybe it's kind of what I came to, but more complex... Thank you, though! For your reply...

Last edited by Plangam; 04-15-2012 at 02:21 PM.
   
Reply With Quote
Old
Plangam
Junior Member
 
Plangam's Avatar
 
Status: Offline
Posts: 3
Join Date: Apr 2012
Location: Mexico
Default 04-15-2012, 04:42 PM

I could do it like this... I just wonder if there would be a limit to the number of objects I can place in the world... I would need to place tons of cylinders and make the code a hundred times larger, but I think it would work, ha...
Attached Files
File Type: a2w draftIII.a2w (830.6 KB, 7 views)

Last edited by Plangam; 04-15-2012 at 04:57 PM.
   
Reply With Quote
Reply

Tags
movement of objects

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