Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

[java] Reading pre-defined data into an array??

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 nowan   Members   

122
Like
Likes
Like

Posted 07 June 2001 - 04:48 AM

Hi, I want to be able to read a list of predefined x positions into a two dimensional array, the x relating to the horizontal position of an object. Is it possible to read these in from an external text file or will I have to hard code them. Thanks for any help. nowan

#2 nowan   Members   

122
Like
Likes
Like

Posted 07 June 2001 - 04:51 AM

Ugh, sorry, not a two dimensional array a ''one'' dimensional array.

#3 Anonymous Poster_Anonymous Poster_*   Guests   

Likes

Posted 07 June 2001 - 09:10 AM

yeah, use java.io.BufferedReader to read files, the argument in the constructor should be a new FileReader with the argument for that constructor being the filename. However you will need a way to figure out how big to make the array. You can either read it in first or read into a Vector and get an array out of that.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.