forums

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

02-13-2003 23:10

Posted by:
Ashlin Aronin

Click Here to Email Ashlin Aronin   Find more posts by Ashlin Aronin

I have made a basic game with TNT. here's my code:
graphics mode 1024,768
int targetSpeed=5
int targetImage=0
int targetX=0,targetY=0
int currentBullet=0
int numBullets=1
int BulletholeX[115],bulletholeY[115]
set pen color make color (203,232,0)
fill rect 0,0 to 1024,768
load images 128
load sounds 128
fade down
hide mouse
fade up
while not mouse button

' --BEGIN TARGET--'
If Pressed (126)
targetY=targetY-targetSpeed
Else if Pressed (123)
targetX=targetX-targetSpeed
Else if Pressed (124)
targetX=targetX+targetSpeed
Else if Pressed (125)
targetY=targetY+targetSpeed
Else if space
play sound 000
bulletholeX[currentBullet]=targetX+15
bulletholeY[currentBullet]=targetY+15
numBullets=numBullets+1
currentBullet=currentBullet+1
end if
sprite 2,bulletholeX[currentBullet],bulletholeY[currentBullet],002

sprite 0,targetX,targetY,targetImage
Sprite 1,300,300,1
draw frame
wend

It's a very simple shooting game where there's only one big baddie in the middle of the screen. When the player shoots, it just makes a noise, and the bullet does not display. What's wrong? Can someone please help me?

Thanks,
Ashlin

02-13-2003 23:56

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

I didn't have time to study your code in depth, still I found this mistake:

play sound 000

should be:

play sound (000)

or simply

play sound (0)

02-13-2003 23:58

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Hum, I guess this is not the entire code, isn't it? Do you have a for construct?

PS: for better visual effect put fade down before graphics mode.

If you really can't solve you could send me your project so I can see.

02-14-2003 15:23

Posted by:
Ashlin Aronin

Click Here to Email Ashlin Aronin   Find more posts by Ashlin Aronin

how should I go about making a for construct? I'm a SUPER beginner. Thats all my code.

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.