forums

TNT Basic Forums > Programming Q&A
Sprite image (spriteid) not working in Hardware Mode
< Last Thread     Next Thread >
Author
Thread        Post A Reply

07-06-2006 01:36

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

Sprite image (spriteid) works in regular mode but in harware mode returns -1 for all sprites.

Is this a known bug?




'CODE BELOW===================

procedure traintest() 'checks next track based on current train direction - returns new direction

repeat


dir = newdir


tracknumber = tracknumber +1




if sprite image (tracknumber) = 026 and dir = "w" then newdir = "n"
if sprite image (tracknumber) = 029 and dir = "w" then newdir = "s"
if sprite image (tracknumber) = 030 and dir = "w" then newdir = "w"

if sprite image (tracknumber) = 031 and dir = "e" then newdir="s"
if sprite image (tracknumber) = 028 and dir = "e" then newdir="n"
if sprite image (tracknumber) = 030 and dir = "e" then newdir="e"

if sprite image (tracknumber) = 029 and dir = "n" then newdir="e"
if sprite image (tracknumber) = 027 and dir = "n" then newdir="n"
if sprite image (tracknumber) = 031 and dir = "n" then newdir="w"

if sprite image (tracknumber) = 026 and dir = "s" then newdir="e"
if sprite image (tracknumber) = 027 and dir = "s" then newdir="s"
if sprite image (tracknumber) = 028 and dir = "s" then newdir="w"

if dir = "w" and newdir = "n" then trainwn()'train anims
if dir = "w" and newdir = "s" then trainws()
if dir = "w" and newdir = "w" then trainww()

if dir = "e" and newdir="s" then traines()
if dir = "e" and newdir="n" then trainen()
if dir = "e" and newdir="e" then trainee()

if dir = "n" and newdir="e" then trainne()
if dir = "n" and newdir="n" then trainnn()
if dir = "n" and newdir="w" then trainnw()

if dir = "s" and newdir="e" then trainse()
if dir = "s" and newdir="s" then trainss()
if dir = "s" and newdir="w" then trainsw()


print tracknumber
print sprite image (tracknumber)



until sprite col (301,601)>-1
end proc

07-06-2006 14:57

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

you should probably post a bug report on the sourceforge page (http://sourceforge.net/projects/tntbasic)

unfortunately right now new versions of TNT are not realeased frequently as it is being ported over to XCode so you should probably not expect a quick fix to this

07-06-2006 17:36

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

Done. =)

07-06-2006 21:40

Posted by:
Jason Anderson

Location:
Doylestown, PA

Click Here to Email Jason Anderson   Find more posts by Jason Anderson

OMG! I thought I was doing something wrong! I was getting, or rather AM getting -1's. I thought I was an idiot. I looked at the code over and over. It is correct! No wonder it isn't working!

Hmm.. well that's a pickle. Non hardware mode sucks. And Hardware mode won't allow me to do what I need to.

When do we get a downloadable "update"?

07-06-2006 22:56

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Fortunately there are easy fixes for this. Instead of letting TNT hold the values and asking it to give them to you, just hold them yourself in an array

07-07-2006 01:22

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

Exactly what I did - works fine - thanks!

07-17-2006 16:54

Posted by:
Jason Anderson

Location:
Doylestown, PA

Click Here to Email Jason Anderson   Find more posts by Jason Anderson

First thing I tried. I still need to get the ID of the sprite to match them together.

I've moved onto a new project since though. Now I'm having crashing problems.

07-17-2006 18:57

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Jason, i'm curious to know what doesn't work... i'm pretty sure the 'sprite image' command isn't necessary...

> I still need to get the ID of the sprite to match them together.

(???) Without a description of your project that doesn't mean much :P

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.