Alice Community  

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

Reply
 
Thread Tools Display Modes
How Do i shoot projectiles properly?
Old
Art
Guest
 
Status:
Posts: n/a
Default How Do i shoot projectiles properly? - 02-19-2009, 09:01 PM

Well i have a project and i want to shoot tennis balls at airplanes and i want it to be like aim and shoot style. Unfortunately the balls can go right through the targets and only register where they end up. I have attached a project file and am wondering if it is possible to do. I dont want the tennis balls to move to the planes i just want the program to register when they pass through the planes and then make the plane fall through the floor.
Attached Files
File Type: a2w alice project.a2w (969.4 KB, 19 views)
   
Reply With Quote
Old
Scott300
Senior Member
 
Status: Offline
Posts: 80
Join Date: Feb 2009
Location: Ohio
Default 02-20-2009, 08:58 AM

Looking at your file really quickly I notised a few things wrong.

1.Your leaveing the tennis balls as the vehicle so if you move the plane after you fire the tennis balls, the balls will follow the way you go, so after there fired remove there vehical to the jet to they continue on there path.

2. Your only checking for a hit right when you fire it, you need it to be called much longer than right after its fired, so stick it in a while, or loop it either or to make sure it checks it more than right when it is fired. (also it might be waiting till the balls are 200 feet away
so stick the check for hit in with the move 200 feet foward in a Do Together.

3.Your only checking for a hit with navy yet 2 none of the others. You could do each one by its self for do a for all together and make a object list with all the jets in it.

4.Lastly when your checking for a hit with both balls it will play the death animation 2 times since it check for both balls to see if it hit, make like a var is_hit set it to false when its hit set it true and make an if statement on the check for hit

if(is_hit==false)
{
do kill
}
else
{
nothing
}

Last edited by Scott300; 02-20-2009 at 09:02 AM. Reason: Forgot something
  Send a message via AIM to Scott300 Send a message via MSN to Scott300  
Reply With Quote
Old
Art
Guest
 
Status:
Posts: n/a
Default 02-20-2009, 06:49 PM

alright i fixed the tennis balls and am about to code the other planes but how exactly do i "stick it in a while, or loop it either or to make sure it checks it more than right when it is fired." I am just barely learning how to use alice (2 weeks).
also how do i make like a var is_hit set it to false when its hit set it true and make an if statement on the check for hit

if(is_hit==false)
{
do kill
}
else
{
nothing
}
thanks
   
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 ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.