forums

TNT Basic Forums > Programming Q&A
Sprites
< Last Thread     Next Thread >
Author
Thread        Post A Reply

02-18-2003 23:57

Posted by:
Simon

Click Here to Email Simon   Find more posts by Simon

Alright, let's say I'm attempting to make a game basically like the classic Space Invaders. The hero ship has to be a different sprite then the baddies, but can't I make them all the same graphic or do they have to be different sprites? Is there any really easy way to program that or do I have to do them individually? Thanx.

02-21-2003 22:04

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

>Alright, let's say I'm attempting to make a game basically like the classic Space >Invaders. The hero ship has to be a different sprite then the baddies, but can't I make >them all the same graphic or do they have to be different sprites? Is there any >really easy way to program that or do I have to do them individually? Thanx.

Easy!

The command is:

sprite id,x,y,image

Sprite are recognised by IDs, not by images, so different sprites may have the same image. Look at this:

----------------------------------------
int xShip,Yship,xEnemy,yEnemy

while not mouse button

'ship
sprite 1,xShip,yShip,0
'enemy
sprite 2,xEnemy,yEnemy,0

draw frame
wend

----------------------------------------

Hope this helps!

02-21-2003 23:54

Posted by:
Simon

Click Here to Email Simon   Find more posts by Simon

Thanx a lot; that really helps!

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.