forums

TNT Basic Forums > Feedback
just downloaded tnt-basic
< Last Thread     Next Thread >
Author
Thread        Post A Reply

12-10-2001 22:02

Posted by:
James D. Jarvis

Find more posts by James D. Jarvis

I just downloaded tnt-basic and i am failry impressed.
I've been a hobbyist programmer for about 20 years and TNT-basic looks really exciting to me.
I'll have to give this baby a serious test drive and if it is even half as good as it looks so far i'd say you have a winner.


12-11-2001 00:42

Posted by:
Mark Tully

Find more posts by Mark Tully

Cheers!

Let us know how you get on!

12-11-2001 13:37

Posted by:
James D. Jarvis

Find more posts by James D. Jarvis

1st program

I knocked out my first program with tnt-basic in a about 10 minutes, sure it was a hello world style program
with cycling color terminated by a mouse click , all with code , nothing amazing but really easy to whip up.





12-11-2001 14:15

Posted by:
James D. Jarvis

Find more posts by James D. Jarvis

hello world in a rect


' this little program places a short message in a box
' the box moves down and across the screen
' the colors cycle as well
fade down
hide mouse
graphics mode 640,480
fade up
vbl sync off ' for smoother graphics change this to -> vbl sync on
set framerate max

int c,k,x,y
c = 0
k = 0
x = 70
y = 70


while not mouse button
set pen color make color (0,0,0)
paint canvas

c = c + 1
if c = 10
k = k + 1
c = 0
if k =256 then k = 0
end if
set pen color make color (255,k,0)
frame rect x,y to x+80,y+50
set pen color make color (255,0,k)
frame rect x+5, y+5 to x+75, y+45
set pen color make color (k,k,k)
frame rect x+10,y+10 to x+70, y+40
set pen color make color (255,255,255)
draw text x+20,y+30, "Hello !"
draw frame
x = x + 1
y = y +1
if x= 500
x = 1
y = 1
end if
wend

fade down
text mode
fade up
show mouse

01-16-2002 19:19

Posted by:
Jasoco@Jasoco.com

Click Here to Email Jasoco@Jasoco.com   Find more posts by Jasoco@Jasoco.com

I just got it the other day too. I'm playing around right now. Mostly transparency and such.

Here's mine:

'------------------------
global int X1, Y1, XI, YI

Fade Down 0
graphics mode 640,480
Fade up 0

XI = random (2,8)
YI = random (2,8)

set random seed timer

while not mouse button
X1 = X1 + XI
Y1 = Y1 + YI
if X1 > 640 - 30-1
XI = 640 - 30 - 1
XI = -random (2,8)
end if
if X1 <= 0 then XI = random (2,8)
if Y1 > 480 - 30 - 1
Y1 = 480 - 30 - 1
YI = -random (2,8)
end if
if Y1 <= 0 then YI = random (2,8)

set pen color make color (0,0,0)
paint canvas

'Red Bar
set pen transparency 0 : set pen color make color (255,0,0)
fill rect 0,40 to 640,70

'Moving Translucent Green Box
set pen transparency 50 : set pen color make color (0,255,0)
fill rect X1,Y1 to X1 + 30,Y1 + 30

'Translucent Blue Bar
set pen transparency 50 : set pen color make color (0,0,255)
fill rect 200,0 to 230,480

'White Bar
set pen transparency 0 : set pen color make color (255,255,255)
fill rect 0,140 to 640,170

draw frame
wend
'------------------------

Anyone think my code could be compressed to do the same in less 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.