Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2009
    Posts
    6
    Rep Power
    0

    Default Java Game Program

    Hi everyone
    I am new to java but I need to make a basic game abit like duck hunt I have around 80 days to achieve this. but as I dont really know where to start im very lost. The first question I had is my game is going to have 4 pages to it a main menu, the game itself,your score page and then a highscore page as well. I wanted to know how you can get 4 pages on netbeans I belive it has something to do with Jpanels but dont know anything else. can anybody help me with this question?
    Many Thanks Dan

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    What do you mean by "4 pages"? Do you have an example from a common program that most of us use? If talking about changing panels during different states in the program, then you may wish to look at the CardLayout which allows you to swap JPanels (and other Components) as if they were cards on a deck. You'll find a tutorial here: The CardLayout Tutorial

  3. #3
    Join Date
    Feb 2009
    Posts
    6
    Rep Power
    0

    Default

    What I meant by 4 pages was like the program starts on the main page where you will be able to select new game, highscores and quit. what i wanted was for the user to click on new game which then starts the actual game where they have to shoot sonic the hedgehogs that appear random on the page. and also when the game ends the user would be taken to the page which displays his score. then also from the main page if the user clicks on highscore they will be taken to another page that displays the highscores. does this make anymore sense about the 4 pages.
    cheers Dan

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    OK, then I think a CardLayout should fit your bill nicely here. Check out the link above and I think that you will agree. Good luck.

Similar Threads

  1. Java BattleShip game help
    By mars_red in forum Advanced Java
    Replies: 0
    Last Post: 02-12-2008, 12:58 AM
  2. java game programming
    By gammaman in forum New To Java
    Replies: 1
    Last Post: 12-25-2007, 01:01 AM
  3. Help with java text game
    By silvia in forum New To Java
    Replies: 6
    Last Post: 07-27-2007, 06:58 PM
  4. Help with my game in java
    By lenny in forum New To Java
    Replies: 1
    Last Post: 07-23-2007, 04:40 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
  •