Results 1 to 7 of 7

Thread: Game in Eclipse file Path Problem :) ??

  1. #1
    Join Date
    Dec 2012
    Beans
    5

    Game in Eclipse file Path Problem :) ??

    Hello ubuntu familly ,
    i am kinnda new in ubuntu .. ))
    i am working on this game in eclipse but my stupid question is how is the path format in ubuntu. for Example in order to open file or an image or something i copied the file location for the proprieties but it's not working any help Please . ))

    thanks in advance ))

  2. #2
    Join Date
    Dec 2012
    Beans
    5

    Re: Game in Eclipse file Path Problem :) ??

    it is a stupid question please help ) ??? 21 views and no one know this :/ please i need to reply ASAP
    Last edited by omar farouk lakhdhar; December 12th, 2012 at 02:15 PM.

  3. #3
    Join Date
    Jul 2007
    Location
    UK
    Beans
    16,815
    Distro
    Ubuntu Development Release

    Re: Game in Eclipse file Path Problem :) ??

    moved tp programming forum.

  4. #4
    Join Date
    Jul 2008
    Location
    England
    Beans
    860

    Re: Game in Eclipse file Path Problem :) ??

    Hi

    Are you trying to use absolute paths or relative paths? I would recommend that you use relative paths so that you are able to distribute your game. Are you using Java? If so, have you looked at including the images as resources in your JAR files?

    Paul
    My current project: http://apps.facebook.com/beatthetexan - Creating an artificial poker player using neural networks and genetic algorithms.
    My blog: http://pm-gaming.blogspot.com

  5. #5
    Join Date
    Dec 2012
    Beans
    5

    Re: Game in Eclipse file Path Problem :) ??

    hi Paul ,
    this project is developed locally , it is kind of a final exam , i am creating this game using java , so absolute path will be good , relative or absolute is not the issue here , the form of the path what matter in windows it like "c://test//map.txt" something like that , how is
    it in Ubuntu , sorry for this stupid question cause i am kinna of a newbie here

    and thanks .

  6. #6
    Join Date
    Jul 2008
    Location
    England
    Beans
    860

    Re: Game in Eclipse file Path Problem :) ??

    If you use relative paths they will be the same in Windows and Ubuntu, so I would strongly recommend that you use them since you won't run into compatibility issues.

    If you are using an absolute path on linux you want to do something like:
    /home/yourname/yourfile.txt
    for example. You have a "/" rather than the standard C:\ that you would get on Windows.

    But, as I have said, if you start coding like this you will have issues when you come to hand in your project in that it might work on one OS and not the other. You should look at using a relative path, or use resources if you are using Java.

    Paul
    My current project: http://apps.facebook.com/beatthetexan - Creating an artificial poker player using neural networks and genetic algorithms.
    My blog: http://pm-gaming.blogspot.com

  7. #7
    Join Date
    Dec 2012
    Beans
    5

    Re: Game in Eclipse file Path Problem :) ??

    So i am using the path as follow :

    /home/user/Documents/Game/map.txt

    but still not reading the file wish is driving me crazy i tried every possible form that exists but still not reading the file ??? anyone know why ???

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •