Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Page 1 of 2 12 LastLast
Results 1 to 25 of 47

Thread: Rush hour game

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Rush hour game

    Hey,

    I'm supposed to create the game rushhour with the program IntelliJ, but i'm totally stuck with it.
    I need it tonight so some fast help would be much appreciated.
    I'm very unskilled in programming since this is my first year.
    There should be 4 difficulty levels: beginner, intermediate, advanced and expert.
    I need to use an enum for the difficulty levels and also an enum for the driving direction for the cars.
    For the board i should use an 2-dimensional array and showing the board should be done with the help of a toString method.
    Also, the board should be read from an extern txt file. There should be an extern txt file for every board (I'm not sure i'm using the right word for it, but with board i mean the cart where u can see how the vehicles are presented).
    I need to save the score in an txt file names score.txt.
    The score is based on the amount of moves you needed to do to complete the board/cat.
    In the score.txt file is for each board/card the best score saved together with the name of the player.

    This is how it should go:
    - ask the user the wanted level and cartnumber.
    - show the gameboard.
    - ask which care should be moved and in which direction.
    - Check the input and when there is a problem tell the user what problem there is.
    - move the car and show the changed playboard.
    - ... keep doing this until the red car could leave the board.
    - show the end score


    TY and pls help


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,010
    Thanks
    52
    Thanked 2,276 Times in 2,247 Posts

    Default Re: Rush hour game

    Do you have any specific questions about your assignment?
    Please post your code and any questions about problems you are having.

    What have you tried?


    Is this a joke: I need it tonight?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member
    Join Date
    Apr 2012
    Posts
    161
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Default Re: Rush hour game

    Rule number one: Start early.

  4. #4
    Junior Member
    Join Date
    Jan 2013
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    i started a month ago but i trusted my partner to finish it, now it seems he hasnt been doing anything.
    so i have some serious problems now
    mostly im stuck with moving the cars

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,010
    Thanks
    52
    Thanked 2,276 Times in 2,247 Posts

    Default Re: Rush hour game

    Post the code and ask questions about the problems you are having.
    If you don't understand my answer, don't ignore it, ask a question.

  6. #6
    Junior Member
    Join Date
    Jan 2013
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    im new here, i don't even know how to post it :s
    i do have the .rar file

  7. #7
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,010
    Thanks
    52
    Thanked 2,276 Times in 2,247 Posts

    Default Re: Rush hour game

    Please copy and paste the code on the forum. Not a link.
    Be sure to wrap your code with
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

  8. #8
    Junior Member
    Join Date
    Jan 2013
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    ok so i started with this
    first class is the board, second the cars
    as i said im very unskilled so i have no idea what to do now

    public class Spelbord
    {
        public static void main(String[] args)
        {
     
                {int[][] board = { {8,88,88,88,88,88,88,8},
                        {8,22,22,22,37,23,36,8},
                        {8,33,34,34,37,23,36,8},
                        {8,33,10,15,15,23,10,11},
                        {8,30,30,36,10,10,10,8},
                        {8,10,39,36,10,31,31,8},
                        {8,10,39,35,35,32,32,8},
                        {8,88,88,88,88,88,88,8}
                };
     
                    for (int i = 0; i < board.length; i++)
                    {
                        for (int j = 0; j <board [i].length; j++)
                            System.out.print(board[i][j] + " ");
                        System.out.print("\n");
     
                    }
     
     
     
                }
            }
        }
     
    public class Voertuigen
    {
     
        private String orientatie;
        private int xPos;
        private int yPos;
        private final int breedte = 1;
        private int voertuigNummer;
     
        public Voertuigen(int xPos, int yPos, int voertuigNummer)
        {
            this.xPos = xPos;
            this.yPos = yPos;
            this.voertuigNummer = voertuigNummer;
        }
     
        public Voertuigen (int nummer)
        {
            switch(nummer)
            {
                case 1: this.voertuigNummer = 1; break;
                case 2: this.voertuigNummer = 2; break;
                case 3: this.voertuigNummer = 3; break;
                case 4: this.voertuigNummer = 4; break;
                case 5: this.voertuigNummer = 5; break;
                case 6: this.voertuigNummer = 6; break;
                case 7: this.voertuigNummer = 7; break;
                case 8: this.voertuigNummer = 8; break;
                case 9: this.voertuigNummer = 9; break;
                case 10: this.voertuigNummer = 10; break;
                case 11: this.voertuigNummer = 11; break;
                case 12: this.voertuigNummer = 12; break;
                case 13: this.voertuigNummer = 13; break;
                case 14: this.voertuigNummer = 14; break;
                case 15: this.voertuigNummer = 15; break;
                default:
                    throw new IllegalArgumentException("Ongeldige nummer");
            }
            this.voertuigNummer = nummer;
        }
     
        public int getNummer()
        {
            return voertuigNummer;
        }
    }
     
        public void voertuigen (int x, int y, String o)
         {
            this.xPos = x;
            this.yPos = y;
            this.orientatie = o;
    }
       public void setPosX(int xPos)
            {
                this.xPos = xPos;
            }
     
            public int getPosX()
            {
                return xPos;
            }
     
            public void setPosY(int yPos)
            {
                this.yPos = yPos;
            }
     
            public int getPosY()
            {
                return yPos;
            }
     
            public int getBreedte()
            {
                return breedte;
            }
     
            public void SetOrientation(String orientation)
            {
                this.orientatie = orientation;
            }
     
            public String getOrientation()
            {
                return orientatie;
            }
     
    }

  9. #9
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,010
    Thanks
    52
    Thanked 2,276 Times in 2,247 Posts

    Default Re: Rush hour game

    What does that code do? How is it related to the assignment?
    If you don't understand my answer, don't ignore it, ask a question.

  10. #10
    Junior Member
    Join Date
    Jan 2013
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    it should be looking like this, but of course it doesnt
    rush hour.jpg

  11. #11
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,010
    Thanks
    52
    Thanked 2,276 Times in 2,247 Posts

    Default Re: Rush hour game

    Please copy and paste text here, not images.

    Is that all the code for the project?
    If you don't understand my answer, don't ignore it, ask a question.

  12. #12
    Junior Member
    Join Date
    Jan 2013
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    sorry i only have the image as an example
    yes thats it, that should be the output.
    It's just the fact that im totally stuck and i don't even know what i should be asking for.

  13. #13
    Junior Member
    Join Date
    Jan 2013
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    Do you go to Karel-de-Grote hogeschool?

  14. #14
    Junior Member
    Join Date
    Jan 2013
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    No, i don't. Why?

  15. #15
    Junior Member
    Join Date
    Jan 2013
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    I also have to do the same project by tonight.
    Only difference is that I'm done.

  16. #16
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,010
    Thanks
    52
    Thanked 2,276 Times in 2,247 Posts

    Default Re: Rush hour game

    Look at the assignment, make a list of the features the program needs to do. Make a list of what steps the code needs to take to implement each feature and work on the steps one at a time.

    When you have a problem with one of the steps, post your code and ask some questions about the problems you are having with that step.
    If you don't understand my answer, don't ignore it, ask a question.

  17. #17
    Junior Member
    Join Date
    Jan 2013
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    oh waw
    yea my deadline isn't tonight but i have no more time to work on it except for today so..

  18. #18
    Junior Member
    Join Date
    Jan 2013
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    Zerocos, What country are you from?

  19. #19
    Junior Member
    Join Date
    Jan 2013
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    holland, or how do you say that in english >.<

  20. #20
    Junior Member
    Join Date
    Jan 2013
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    Zerocos, hebt ge skype/teamspeak/fb? Ik wil u wel helpen.

  21. #21
    Junior Member
    Join Date
    Jan 2013
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    neej sorry :s
    strikte familie, geen chats.
    ik heb wel mail maar dat is het dan ook..

  22. #22
    Junior Member
    Join Date
    Jan 2013
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    Kan je bewijzen dat je in Nederland woont. Ik heb het idee dat je wel op Karel-de-Grote hogeschool zit en ik wil geen plagiaat aan m'n been

  23. #23
    Junior Member
    Join Date
    Jan 2013
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    hmm nee, ik zie geen manier
    maar als je dat te riskant vind hoef je dit niet te doen hoor, ik zoek nog wel verder

  24. #24
    Junior Member
    Join Date
    Jan 2013
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    Ok, veel succes

  25. #25
    Junior Member
    Join Date
    Jan 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Rush hour game

    Ik neem aan dat je een opgave hebt gekregen?
    Stuur deze even naar ErikPeeters90atgmaildotcom

Page 1 of 2 12 LastLast

Similar Threads

  1. Help with Snake Game Java Code: It's Impossible to Lose the Game
    By haruspex_icis in forum What's Wrong With My Code?
    Replies: 20
    Last Post: December 17th, 2012, 11:21 AM
  2. Replies: 0
    Last Post: December 9th, 2012, 08:45 PM
  3. Simple game that requires me to load game settings from a file
    By 14fenix in forum Java Theory & Questions
    Replies: 5
    Last Post: December 1st, 2011, 08:21 PM
  4. Help with Clock (advance and reverse day,hour,minute)
    By whyld4900 in forum What's Wrong With My Code?
    Replies: 9
    Last Post: November 13th, 2011, 01:39 AM
  5. Array month/day/hour/min/sec incomplete java code
    By mightyking in forum Collections and Generics
    Replies: 12
    Last Post: September 18th, 2011, 08:46 PM