Alice Community make collision with objects in alice
 User Name Remember Me? Password

 Thread Tools Display Modes
 make collision with objects in alice
 whidragon Guest   Status: Posts: n/a make collision with objects in alice - 11-18-2008, 02:01 PM how would i make an object like a car collide with the buildings and other objects and not go through them. also if i could get help with programing the goal line that be apreciated ill upload my world to make it easyer to understand what im trying to do
 No Collision
 dragon_drone13576 Guest   Status: Posts: n/a No Collision - 11-18-2008, 09:01 PM I'm not sure how you could make a goal line, but the object collisions aren't so hard. You need to create an event that checks the distance from the object that you want to move (like a car) and the object that it might collide with (like a building). An example would be something like this: While car is at least (width of building / 2) away from building: Begin: Do nothing During: Do nothing End: Car move backwards [insert number here] meters What happens is that when the car is not touching the building, it will do nothing. When the car reaches the outside wall of the building (the width divided by 2 is to find the radius), it will move backwards. This would act as a bounce back from the collision. Whatever number you choose for the meters should be eqaul to how fast the car travels in one second, that way even if you keep trying to move forward you won't go anywhere. There are two problems that immediately come to mind with this, however. First, it might take forever to figure out the number of meters that the car would need to move backwards. Second, this code only would work for one building. You would need to make one of these for each one of your buildings. I haven't tried this out myself yet, so you should test it with the first building before you go and write all of your code. Good luck! P.S.- One way that you might be able to check for a certain point crossed is to put a large invisible circle across the finish line, that way you could check for something to hit that point to win or whatever. If you just have something that says 'You Win', you could easily just make that become visible when the car hits that spot. Just make the sign start on the screen and vehicle it to the camera.
 the file
whidragon
Guest

Status:
Posts: n/a
the file - 11-20-2008, 11:33 AM

i have uploaded the file i am working on i tryed your sugestion and couldent get it to work maybe you or another member would have better luck please help if any one is able to program any part of it collison with a specific peice i could do the other peices. i have left comments in teh code as to what ide liek to happen
Attached Files
 ice car.a2w (1.80 MB, 59 views)

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge

Copyright ©2021, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.

 Contact Us - Alice.org - Archive - Top