Alice Community  

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

Thread Tools Display Modes
Object is within Threshold of Object
Posts: n/a
Exclamation Object is within Threshold of Object - 09-03-2009, 08:52 PM

I'm attempting to make a simple game with Alice 2.0. The game is the player controlling a tank's turret
(Left arrow key rotated it left, right arrow key rotates it right. at this point I dont suggest uing up and down)to shoot at
targets out in front of the tank.

Right now when the tennis ball that is shot out reaches the target i placed, nothing happens. I used "If/Then"
with the "Object is within Threshold of Object" function and the If method is not performed when the tennis
ball enters the threshold specified.

So now here it is.
How do I...
Make this method so that when the moving tennis ball enters defined threshold of "target". The action
specified in "If" is performed?

Last edited by Kosire; 09-03-2009 at 08:58 PM.
Reply With Quote
Posts: n/a
Question 09-04-2009, 11:19 PM

Gah. I just can't figure out what's wrong with this. Does it not recognize it as threshold when arrow keys are controlling the objects movement either?
Reply With Quote
Senior Member
dubastot's Avatar
Status: Offline
Posts: 661
Join Date: Apr 2009
Location: Two Steps From Hell
Default 09-10-2009, 02:48 AM

THis is a little latte to answer, but the problem with your code is you need an infinte loop. You can look at the bottom of the alice window and right beside the if/else statement, you will see the loop option. Just drag it to the command board AND SELECT INFINITE LOOPS. Sorry for the caps. It should look something like this.

Loop infinite times
tennis ball is within 2 metres of random guy2
random guy2 roll left .2 revolutions duration=2 seconds
Reply With Quote

function, game, tank, threshold

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.