Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Raeding and Writing to a File
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
¿§¥Jåmës¥§¿




PostPosted: Fri Oct 10, 2003 1:19 pm   Post subject: Raeding and Writing to a File

IN the totorials section there is a reading and writing thig but it is an extention where is the first one??
Sponsor
Sponsor
Sponsor
sponsor
hackman




PostPosted: Fri Oct 10, 2003 4:05 pm   Post subject: (No subject)

I think this is what your looking for

http://www.compsci.ca/v2/viewtopic.php?t=5
¿§¥Jåmës¥§¿




PostPosted: Fri Oct 10, 2003 8:47 pm   Post subject: (No subject)

Yup thats the one! Laughing Thanx
Blade




PostPosted: Sat Oct 11, 2003 12:19 am   Post subject: (No subject)

up at the top there's a search button... click that then you can search the tutorials section for 'reading and writing files'
¿§¥Jåmës¥§¿




PostPosted: Mon Oct 13, 2003 4:58 pm   Post subject: (No subject)

That search buttun is handy thatnx Laughing but I have a question bout it. How do you store a pisture to a file?
AsianSensation




PostPosted: Mon Oct 13, 2003 6:50 pm   Post subject: (No subject)

a picture to a textfile?

um.......

well, you can use whatdotcolor to store what color each pixel of the picture is, then store those values in a textfile. When you want redraw the picture, use drawdot to draw each single pixel, and Pic.Save or Pic.ScreenSave to save the picture to a newfile...

But whatdotcolor is really slow, especially if you have to use it in 2 for loops to get every single pixel of a large picture.
Tony




PostPosted: Mon Oct 13, 2003 8:15 pm   Post subject: (No subject)

just save the picture as a .bmp Rolling Eyes

code:

Pic.ScreenSave (x1, y1, x2, y2 : int, fileName : string)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
¿§¥Jåmës¥§¿




PostPosted: Mon Oct 13, 2003 8:39 pm   Post subject: (No subject)

Aw yes thats the ticket 8) thanx tony Very Happy
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Mon Oct 13, 2003 10:24 pm   Post subject: (No subject)

ah.........just a file, should have told me, now you forced me to fill your head with all these junk about whatdotcolor that you should never use, just because it's so slow. Very Happy
¿§¥Jåmës¥§¿




PostPosted: Tue Oct 14, 2003 11:41 am   Post subject: (No subject)

ok I got another question. I'm kinda confused on the Pic.ScreenSve thing.
You wrote
Quote:
Pic.ScreenSave (x1, y1, x2, y2 : int, fileName : string)
So I got the basic consept but where do you specify witch picture you want saved??

I'll give you the problem that I'm trying to do so maybe you could tell me if there is a better way or if I'm just way off. I'm trying to make a random back ground for a horizantal space shooter kinda thing. so I can make the background come but I have to make the space ship move so I have to clear the sceen and the background disapears. So my idea was to save the background that I have just made to a file so I can keep redrawing it. Got any ideas??
naoki




PostPosted: Tue Oct 14, 2003 4:53 pm   Post subject: (No subject)

you could do what my partner and i did:

take a picture the size of your game window and duplicate it so there's 2 of the same. then position the pictures beside each other and make a program to slide them to the left to give the appearance of movement. when one picture is all the way off the viewable screen it reloads its position right beside the 2nd picture
Tony




PostPosted: Tue Oct 14, 2003 8:22 pm   Post subject: (No subject)

Pic.ScreenSave saves the picture on the screen between xy1 and xy2 into a bmp file name specified.

I think you can use Pic.Save to save already existing picture from a pointer (Pic.New)

as for the game... you might want to create a datafile and then just use a tile system to recreate it.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: