i wanna create a game in java(net beans)...please help me out with code part.....my game is all about player guessing the number which is randomly picked by the program....firstly the main concept is 1.There will be 9 boxes appearing on the screen with numbers from 1 to 9 assigned to them randomly. 2.All the boxes will be hiding the numbers which are assigned to them. But one of the box will show its number. 3.Now its time for the player to select any one of the box except the box which is showing its number. 4.When the player picks up his desired box and clicks on it, two buttons gets highlightened on the screen named UP or DIP. 5.Now the player should think logically and guess whether the number in the box which the player has picked is just more or less than the number which is already shown. 6.If the player has guessed it correctly then the player will be awarded +50 points else -50 points. 7.In the same manner the player continues to play the whole game until there are no more boxes hiding their numbers. please i want help about the code:confused::confused::confused::confused::confu sed::mad::mad::mad::mad::mad::mad:

August 16th, 2012, 04:46 PM

jps

Re: java game code

Looks likey you have a good start so far.

Split up what you have into a list, like you have started doing with the numbers. From there you can work on one part at a time. If you run into problems as you go post more questions. I (and many others here) will continue to provide assistance, but not really just write code for you.

jTextArea2.setBackground(new java.awt.Color(153, 255, 255));
jTextArea2.setColumns(20);
jTextArea2.setFont(new java.awt.Font("Papyrus", 0, 13)); // NOI18N
jTextArea2.setRows(5);
jTextArea2.setText("1.There will be 10 boxes appearing on the screen wiyh numbers from 0 to 9 assigned to them.\n2.All the boxes will be hiding the numbers which are assigned to them. But one of the box will show its number.\n3.Now its time for the player to select any one of the box except the box which is showing its number.\n4.When the player picks up his desired box and clicks on it, two buttons gets highlightened on the screen named UP or DIP.\n5.Now the player should think logically and guess whether the number in the box which the player has picked is just more or less than the number which is already shown.\n\n");
jTextArea2.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
jScrollPane2.setViewportView(jTextArea2);

jTextArea3.setColumns(20);
jTextArea3.setFont(new java.awt.Font("Kristen ITC", 1, 13)); // NOI18N
jTextArea3.setRows(5);
jTextArea3.setText("1.There will be 9 boxes appearing on the screen with numbers from 1 to 9 assigned to them.\n2.All the boxes will be hiding the numbers which are assigned to them. But one of the box will show its number.\n3.Now its time for the player to select any one of the box except the box which is showing its number.\n4.When the player picks up his desired box and clicks on it, two buttons gets highlightened on the screen named UP or DIP.\n5.Now the player should think logically and guess whether the number in the box which the player has picked is just more or less than the number which is already shown.\n6.If the player has guessed it correctly then the plyer will be awarded +50 points or else -50 points.\n7.In the same manner the player continues to play the whole game until there are no more boxes hiding their numbers.\n");
jTextArea3.setEnabled(false);
jScrollPane3.setViewportView(jTextArea3);

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

What specific questions do you have about your code? There is way too much code posted for most of us to go through without something specific to look for. If you are having a problem with one part of the code, try to extract the code for that problem into a small program that compiles, executes and shows the problem.