forums

TNT Basic Forums > Programming Q&A
Animating many sprites
< Last Thread     Next Thread >
Author
Thread        Post A Reply

03-28-2002 15:02

Posted by:
Chris

Find more posts by Chris

Still plugging away at this platformer :)

Is there a way to change a sprite's graphic without accessing it's x and y coordinates? I'm drawing a bunch of sprites based on map objects - okay that works fine. Now, I want to add in code so the sprites will either a)blink at random intervals or b) shoot out big pointy sticks. The problem I'm encountering is knowing what the various sprites coordinates are so I can animate them all without "moving" them anywhere. Barring that, is there a way to determine the x and y coords of a sprite? That way I can just reassign the coord values within the animation procedure. Thanks all!

03-28-2002 15:34

Posted by:
John Treece-Birch

Find more posts by John Treece-Birch

Animating Sprites

I think all the parameters (except for the first) are optional in the Sprite statement. So it is perfectly possible to type the line...

Sprite 10,,,1

... which just sets the image for sprite 10 to 1 and leaves the x and y co-ordinates untouched.

John

03-28-2002 15:50

Posted by:
Chris

Find more posts by Chris

Excellent!

Thanks, that's what I needed for the stationary enemies. However, out of curiousity and (attempted) forethought - is there any way to access those coordinates? If I want to use a similar procedure for moving enemies, I will obviously want to increment their positions...

03-28-2002 16:33

Posted by:
Chris

Find more posts by Chris

Further thought

Having considered it further, the ability to access sprite locations is almost essential. In order to trigger enemy actions, they'll have to know the location of the players sprite (e.g. if the player sprite is level with the enemy, the enemy knows to fire). Oh please tell me there's way to do this...

03-30-2002 10:10

Posted by:
Mark Tully

Find more posts by Mark Tully

Sprite X, Sprite Y and Sprite Image...

Are on their way.... TNT Basic 1.03 soon...

Mark

03-30-2002 14:08

Posted by:
ERaZer

Find more posts by ERaZer

Yeah, its good that you add something to check for a spites location, but it aint that hard to have a variable for the sprites locations.

03-31-2002 18:12

Posted by:
Daniel R. Lurie

Click Here to Email Daniel R. Lurie   Find more posts by Daniel R. Lurie

Sure. But, we use BASIC because we don't want to sweat the small stuff.

04-01-2002 18:33

Posted by:
Chris

Find more posts by Chris

No, not hard

No, it's not hard to have a variable to track an object location. But it would be sooo much easier not to have to worry about it, now wouldn't it? My two pennies...

04-18-2002 19:51

Posted by:
Mark Tully

Find more posts by Mark Tully

Moan

I think our new Moan system may be able to help you here...

See the docs for TNT Basic 1.03 :)

Mark

04-18-2002 19:56

Posted by:
Chris

Find more posts by Chris

Is it out?

Two questions: is it the moan system because I was moaning about it? and, when did 1.03 come out?

04-18-2002 22:27

Posted by:
Mark Tully

Find more posts by Mark Tully

TB 1.03

TNT Basic 1.03 was released about 4 hours ago - you should join our mailing list and get the updates :)

As for the name 'Moan', I guess you'll never know... :)

Mark

04-19-2002 01:48

Posted by:
Chris

Find more posts by Chris

I'm on the mailing list! You mean I'm four hours behind everyone already?!?! Good grief...

Well, off to download...

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.