Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help needed with collision initiation.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
chimerix




PostPosted: Sat Nov 28, 2009 10:22 pm   Post subject: Help needed with collision initiation.

What is it you are trying to achieve?
I have a tank shooting a bullet at another tank, and have allowed collision. However the explosion only happens at the exact point i set it to. I was wondering if you could change that point to a wider radius so the bullet would initiate the explosion if it came into a certain space.


Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat Nov 28, 2009 11:14 pm   Post subject: RE:Help needed with collision initiation.

use less-than and greater-than comparison, instead of equals-to, to define ranges.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
andrew.




PostPosted: Sat Nov 28, 2009 11:33 pm   Post subject: RE:Help needed with collision initiation.

Here's a hint:
"1 < x < 50" in Turing would be "x > 1 and x < 50".
Tony




PostPosted: Sun Nov 29, 2009 12:19 am   Post subject: RE:Help needed with collision initiation.

You can even keep the same order
code:

1 < x and x < 50
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
chimerix




PostPosted: Sun Nov 29, 2009 11:19 am   Post subject: RE:Help needed with collision initiation.

Um, I'm still a bit wonky on this subject. I tried it out, however the "<"s and ">"s don't work. It says syntax error.
I'm too noob guys.
andrew.




PostPosted: Sun Nov 29, 2009 1:17 pm   Post subject: RE:Help needed with collision initiation.

That means that you are using the < and > wrong. It should be used like this:
Turing:
if 1 < x and x < 50 then
    % there was a collision
end if
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: