forums

TNT Basic Forums > Programming Q&A
Help with a color pen on a map
< Last Thread     Next Thread >
Author
Thread        Post A Reply

08-31-2003 14:10

Posted by:
Martin

Click Here to Email Martin   Find more posts by Martin

I an adding color to a 50 tile square map consisting of 9 pixel square tiles in sections. Each of the sections if run without the others works fine.

The results below illustrate the problem. Section Two with a loop works after Section One without a loop, but Section Three doesn't work. If I arrange the order to be Section Two, Section One, and Section Three, nothing works except Section Two.

' Section One Color Coding Test One - WORKS FINE

Set Pen Color Make Color (231,140,198)
Set Pen Transparency 20
Fill Rect 306,441 to 450,450
Draw Frame 'Bottom right corner


' Section Two Color Coding Loop A-0 - WORKS FINE

Set Pen Color Make Color (255,255,255)
Set Pen Transparency 40
y=0
x=0
xx=144
yy=9

for n=0 to 16
Fill Rect x,y to xx,yy
y=y+9
xx=xx-9
yy=yy+9
n=n=1
Draw Frame
next


'Section Three Color Coding Loop C-1 - DOESN'T WORK

Set Pen Color Make Color (255,204,255)
Set Pen Transparency 20
y=9
x=153
xx=251
yy=0

for n=0 to 11
Fill Rect x,y to xx,yy
y=y+9
x=x-9
xx=xx-9
yy=yy+9
n=n=1
Draw Frame
next


Why can't I run loops one after another?

Martin

08-31-2003 14:14

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

What do you want to do with this code? I'td make some kind of opaque square in one corner and blurry squares in other corners I think?

I don't know about the error but couldn't it be n=n=1 that should be n=n+1 ?

08-31-2003 19:17

Posted by:
Martin

Click Here to Email Martin   Find more posts by Martin

Thank you very much, Mathew for picking up the error. That was the problem. Before I send code in next time, I'll check it the way I used to proofread. - backwards ( line by line) the final time.

As for what I'm doing - I 'm creating a landscape similar to Sugarscape.

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.