forums

TNT Basic Forums > Feedback
Sprite Groups
< Last Thread     Next Thread >
Author
Thread        Post A Reply

01-05-2004 21:08

Posted by:
MapMaker

Location:
Edmonton, Alberta (Canada)

Click Here to Email MapMaker   Find more posts by MapMaker

Ive noticed that alot of people are making RPGs and stuff where you have to check for running into walls and stuff, and that got me thinking.

Its kinda a pain to check for walls if you made the walls out of sprites, doing many sprite cols.

So I was thinking, Is here any way you guys can make it do that we can designate sprites to a unique group, and then perform some of the rugualr operations on the whole group instead of just the individual sprites?

Eg, creating some sprites

sprite 1,x1,y1,0,"alien ship"
sprite 2,x2,y2,0,"alien ship"
sprite 3,x3,y3,1,"kamikaze human ship"

and then performing operations on the whole group,

Eg

if sprite col(3, "alien ship")
...

or

sprite off "alien ship"
'to turn off all the sprites in the "alien ship" group.

Just a thought,
MapMaker


01-06-2004 20:52

Posted by:
JAS

Click Here to Email JAS   Find more posts by JAS

I think you can accomplish this if you give the alien ship sprites a name (sprite alienship,x,y,0) and the use a "for" loop to check for collisions. That way you just put sprite col (humanship, alienship) in the loop and as it goes through the "for" loop it will check each alienship sprite for collision with the human ship.

Get it?

01-06-2004 23:40

Posted by:
MapMaker

Location:
Edmonton, Alberta (Canada)

Click Here to Email MapMaker   Find more posts by MapMaker

Thats interresting

I didn't know sprite ID's could be text strings, or that two or more could be the same...

I'll go try that.

Thanks,
MapMaker

01-07-2004 01:06

Posted by:
DanLurie

Location:
Earth>USA>New Jersey>Clifton>My Chair

Click Here to Email DanLurie   Find more posts by DanLurie

What he's suggesting is more like

int alienships

for alienships=0 to 50

if sprite col(3, alienships)
whatever
end if

next

Then just adjust the number range to whatever one the alien ship sprites occupy.

01-08-2004 19:41

Posted by:
MapMaker

Location:
Edmonton, Alberta (Canada)

Click Here to Email MapMaker   Find more posts by MapMaker

:)
Thats what I'm doing right now.
The reason I suggested it was because I think it would be alot faster that having to run a 'for' loop fifty times.

01-08-2004 22:07

Posted by:
DanLurie

Location:
Earth>USA>New Jersey>Clifton>My Chair

Click Here to Email DanLurie   Find more posts by DanLurie

Probably. Assuming you don't care which ship in particular it hit.

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.