Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
need help with a variable in my game
Old
eyearby12
Guest
 
Status:
Posts: n/a
Default need help with a variable in my game - 12-02-2008, 10:24 AM

ok so i am making a game where it is a race game and when the car is off the track it spins and is back on the track. i made a variable with all the pieces to the track (road 1,2,3.....turn 1,2,3....) so my question is how can i make it in a function so it will be if car is atleast __meters away from (all the parts to the variable). please help, my games due tommorow
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 12-02-2008, 05:47 PM

To my knowledge, you can't, you can however make a bunch of separate distance checks for each part and set all durations to zero to decrease time taken in the video to do things (don't do too many, however, as it will cause sluggishness). You might be able to use a for all in order method to check each variable part (put them all in a list), but I've never tried it before so I'm not sure.

I'll give it a shot.

It works. Make a list of all objects the car needs to be close to, then make a function where, for all in order, the distance between the car and the item_from_list is checked (object is at least _ meters away from object, car as first object and parameter item_from_list as second object), and have it return true if the car is too far away.

Last edited by x2495iiii; 12-02-2008 at 05:56 PM.
   
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 ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.