Results 1 to 2 of 2
  1. #1
    lenny is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default Help with my game in java

    I'm trying to make a game using java like minesweeper.
    where it's on a grid and you have to find random squares.
    I'm also imposing a 5 click limit until game over.
    If you hit the gold within that time, you win, and if you hit the coal, you lose (yellow and black squares).
    Only thing is, despite all my attempts with for statements and if statements, I can't seem to get it working and I'm tearing my hair out!

    Java Code:
    {
    // Counts to 5 mouse clicks then if no gold or coal found it will say GAME OVER!
    int i;
    for (i=0; i<=5; i=i+1)
    System.out.println("GAME OVER!");
    }
    Java Code:
    int i;
    if (i < 5)
    {
    // Don't interrupt game (less than 5 clicks)
    System.out.println("");
    i++;
    }
    else
    {
    System.out.println("GAME OVER!");
    }
    Thanks

  2. #2
    cruxblack is offline Senior Member
    Join Date
    Jul 2007
    Posts
    130
    Rep Power
    0

    Default

    Where's the GUI codes for ur game lenny?:confused:
    Java Code:
    // Counts to 5 mouse clicks then if no gold or coal found it will say GAME OVER!
    int i;
    for (i=0; i<=5; i=i+1)
    System.out.println("GAME OVER!");
    }
    If u write it that way, isn't it going to print GAME OVER each time u click the mouse?:confused:

Similar Threads

  1. Replies: 2
    Last Post: 08-05-2010, 04:49 AM
  2. Help with game applet in java
    By barney in forum Java Applets
    Replies: 3
    Last Post: 02-13-2008, 05:26 AM
  3. Java Battleship Game Help PLEASE
    By mars_red in forum New To Java
    Replies: 0
    Last Post: 02-12-2008, 01:09 AM
  4. Java BattleShip game help
    By mars_red in forum Advanced Java
    Replies: 0
    Last Post: 02-12-2008, 12:58 AM
  5. Help with java text game
    By silvia in forum New To Java
    Replies: 6
    Last Post: 07-27-2007, 06:58 PM

Posting Permissions

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