01062004 00:15
Posted by:
puffin

i'm using tnt basic to prototype a little game and i'm having trouble with sprites. here's an example of the kind of problem i'm having.
graphics mode 800, 600
hide mouse
load images 128
int ballx = 1
int bally = 1
float dx = 10
float dy = 1
while not pressed(12)
if ballx >= 800
dx = dx * 1
dx = dx * 1.01
beep
else if ballx <= 0
dx = dx * 1
dx = dx * 1.01
beep
end if
if bally >= 600
dy = dy * 1
dy = dy * 1.01
beep
else if bally <= 0
dy = dy * 1
dy = dy * 1.01
beep
end if
ballx = ballx + dx
bally = bally + dy
sprite 0, ballx, bally, 128 '<
draw frame
wend
i see nothing but i can hear the system beep when the ball hits the wall. what's the deal?

01062004 04:55
Posted by:
eekaydee
Location:
CA, USA

quote: sprite 0, ballx, bally, 128 '<
The last number should be the image number, not the number of the bank. I doubt that you have an image 128 in your image bank, so you probably just need to change it to 0, or whatever image you have, and it should work.
