forums

TNT Basic Forums > Programming Q&A
Collision detection:how?
< Last Thread     Next Thread >
Author
Thread        Post A Reply

09-19-2006 12:48

Posted by:
appleide

Click Here to Email appleide   Find more posts by appleide

making a simple 2d shoot-em-up game, everything is done, except this collision bit, which I can't find anywhere documented properly.

[code]
if sprite Col (129,130)=true
sprite off 130
end if
'if bullet collides with robot, kill him
[/code]

129 is my bullet
130, is my robot which I want to kill when my bullet hits him.

09-19-2006 13:00

Posted by:
appleide

Click Here to Email appleide   Find more posts by appleide

Currently I am reduced to this:
T_T
'''''''''''''If robotmove is 1, then robot moves, otherwise, he doesn't, so when he is hit, he freezes. I did this because the robot won't disappear with sprite off... sprite 131 is an explosion picture.

if bulletx>=robotx
if bulletx<=robotx+20
if bullety>=roboty
if bullety<=roboty+20
sprite off 130
robotmove=0
sprite 131,robotx,roboty,001
end if
end if
end if
end if

09-19-2006 22:55

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

the correct syntax is:

if sprite Col (129,130)=130

i understand '=true' makes more sense in this case - but that's the way it is ;)

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.