forums

TNT Basic Forums > Programming Q&A
Extra object being drawn
< Last Thread     Next Thread >
Author
Thread        Post A Reply

03-28-2002 17:50

Posted by:
Chris

Find more posts by Chris

I'm drawing sprites on the screen with this loop:

int n, o, obj_x, obj_y
'print "Map object: "; map object count

for floor_baddies = 0 to (Map Object Count - 1)
'if Map Object Type (floor_baddies) = 0
obj_x = (map object x(floor_baddies)) * 32
obj_y = (map object y(floor_baddies)) * 32

n = (50 + floor_baddies)
set image bank n, 129
sprite n, obj_x, obj_y, 0

etc...

But I'm getting one extra sprite draw in the upper left hand corner that I can't seem to get rid of. is this a bug, a glitch, a programming error? Help, please.

03-30-2002 10:08

Posted by:
Mark Tully

Find more posts by Mark Tully

I assume you've checked you don't have an object at that location in the map!

I suggest adding the following line to your loop, to let you find out what's going on:

print "Floor baddie= ";as string(floor_baddies);" x= ";as string(obj_x);" y= ";as string(obj_y)

See what it looks like, you might have an object at (0,0).

Mark

04-01-2002 18:30

Posted by:
Chris

Find more posts by Chris

Indeed...

I did try that (I attempt to not be one of those guys who runs to the forum at the first sign of trouble.. not always successful) and I thought I had it fixed because there was an object beign drawn at location 0,0. However, even after changing the number of elements, changing the range of elements being drawn, reviewing the map objects, and reducing the number of map objects to one, that ghost sprite is still there. And the funny thing is, while it was printing the location of the ghost sprite, leading me to think I could eliminate it, after changing the code so that sprite info was no longer printing that sprite still appears in the same spot. Not sure how ell I explained that...

05-09-2002 03:19

Posted by:
Chris

Find more posts by Chris

Okay, seriously, I need help

I thought for sure I had this fixed but I can't for the life of me figure out what the heck my code is doing to draw that extra sprite. My guess is it's something simple that I'm totally missing, but I'd be much appreciative if one of you guys with some more experience could volunteer to look at my code. I'd be happy to e-mail you the file. This is driving me flippin' nuts...

05-13-2002 11:53

Posted by:
Mark Tully

Find more posts by Mark Tully

I can take a look at it Chris, it would be great if you could strip it down as much as possible before sending it though as I have a slow connection.

Cheers!

Mark

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.