forums

TNT Basic Forums > Bugs!
Sprite Collision Bug
< Last Thread     Next Thread >
Author
Thread        Post A Reply

02-23-2006 21:15

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

Code:
load images 128
canvas 1
sprite 0, 4, 4, 6
sprite 1, 4, 4, 6
if sprite col(0, 1)=1
dialog("Collision detected!")
end if


The code I'm using isn't exactly that but it's something similar and it dosen't display a dialog.

02-23-2006 23:11

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

hum... as far as i know, there's no command called "dialog" in TNT

02-23-2006 23:43

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

I know, I made the procedure called 'Dialog' and that works fine.

02-24-2006 07:29

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Isn't zero the mouse?

I know it's not documented anywhere (that I can find) but isn't sprite 0 the mouse cursor?

Try it with sprite 1 and 2 and see if this works, or waggle the mouse about and see if you get a hit.

Danny (nods)

02-24-2006 12:29

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

Draw Frame

The code works if I put a draw frame before the sprite col(2, 1). I don't know why that should do anything.

02-24-2006 12:54

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

It's an update issue...

'Draw Frame' updates the sprite positions. You refresh the display and you get a collision.

Danny (nods)

02-24-2006 15:56

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

That's not always true, at least if I've already made the sprite and drew the frame once.
Are you saying that it dosen't create the sprite until I call draw frame?

Well anyway I'll try making the sprite in the beginning of the game and try that.

Thanks for giving me that idea.

02-24-2006 16:56

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

Yup! That Worked.

02-25-2006 20:56

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

Sprite 0 has no special meaning, it isn't the mouse cursor by default or anything.

Mark

02-26-2006 08:35

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Oops...

Sorry people, showing my age... Sprite 0 was traditionally assigned the mouse cursor.

Danny (nods)

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.