hi guys!:) ....first I'm new friend for u :$:$:$:$
and for first time I wanna to tell u that I wanna some help ....:S ..In the programming java...
I have a game and I want to finish it....who can help me ???:S:S:S:S


thx alot
u r friend
touma

Recommended Answers

All 22 Replies

First, read the site rules and pay extra attention to this one
"Do not write in all uppercase or use "leet", "txt" or "chatroom" speak"

Then post specific questions about the portions that you are having trouble with along with relevant code and error messages.

Write the problem.
and be specific about the problem...

I had a programme Assault fleet
I want the code for this game to help me in my project
thx

commented: No effort at all for his/her homework +0

... and? I don't really see how anyone here can help you with that. You want code for some random program that you have?

I want the code for this game to help me cz I want to do the same game in other shape
??

Well, contact the game author then.

We don't know what this "Assault fleet" game is, even if we were willing to write the code for you.
Explain what you want to do and wait for our suggestions

thx javaAddict


I want to make a Planet ships protected by two spacecraft and shoot all the ship that want to get on the planet

this is the game

How can we help you write your program without any code from you or questions from you about the program you are trying to write?

I'm tring to do it...,and I put the moon and stars background of the page but when I put the spacecrafft on the background the background moved and near it the spacecraft set...
what shall I do?

import javax.swing.*;
import java.awt.*;
import java.io.IOException;

public class AssaultFleet extends JFrame {
	
	//private Image moon = (new ImageIcon("moon.jpg")).getImage();
    
	
	JPanel jp=new JPanel();
	ImageIcon icon = new ImageIcon("moon.jpg"); 
	//ImageIcon icone =new ImageIcon("large.jpg");			
	//ImageIcon icone1 =new ImageIcon("large.jpg");
	public AssaultFleet(){
		

		jp.setBackground(Color.white);
		this.setTitle("AssaultFleet Game");
	    this.setSize(1500,700);
	    
		JLabel label = new JLabel(); 
		//JLabel label1=new JLabel();
		//JLabel label2=new JLabel();	
		label.setIcon(icon); 
		//label1.setIcon(icone);
		//label2.setIcon(icone1); 
		//jp.add(label1);
	//	jp.add(label2); 
		jp.add(label); 
		this.getContentPane().add(jp); 

	    this.add(jp);
	    

	}
	



	public static void main(String[]args)throws IOException{
		

		AssaultFleet p= new AssaultFleet();
		p.show();
		
	}

}

Looks like you need to add some more code. Most of what you have posted has been commented out.


Please surround your code with code tags to preserve formatting. Use the icon above to the right of the input area.

I know that I need more codes...!
cz I have two projcet and this is the first I had to give it for our Dr. on sat....

import javax.swing.*;

import java.awt.*;
import java.io.IOException;

public class AssaultFleet extends JFrame {

	ImageIcon icon = new ImageIcon("moon.jpg"); 
	ImageIcon icone =new ImageIcon("large.jpg");			

	JPanel jp=new JPanel();

	
	public AssaultFleet(){
	

	   jp.setBackground(Color.black);
	    this.setTitle("AssaultFleet Game");
	    this.setSize(990,700);
		JLabel label = new JLabel(); 
		JLabel label1=new JLabel();
		JLabel label2=new JLabel();	
		label.setIcon(icon); 
		label1.setIcon(icone);
 		jp.add(label);
		jp.add(label1);
		this.getContentPane().add(jp); 
	    this.add(jp);
	    

	}
	 		
	public static void main(String[]args)throws IOException{


		AssaultFleet p= new AssaultFleet();
	    p.show();
		
	

}
}

you mean like this????
cz I didn't understand ..

thx javaAddict


I want to make a Planet ships protected by two spacecraft and shoot all the ship that want to get on the planet

this is the game

That is very ambiguous, or in other words you are not clear and explaining your self to well.

You should take the time to explain in good detail what is the game and how it is to be played out.
That will end up being your case study, your games walk through for what needs to happen. You can then use that to help you recode the game and we can give you some suggestions.
Also, we will be able to help you easier when we know how much experience you have in programming and java.

Also it is better to use the setVisible(true) method instead of the show method in your main.

Does the code that you have compiles and runs successfully? If yes what is your question?
Do you know how to use Listeners ?

I've put the background image of the moon
And placed him one spacecraft to protect it
I want this Esfiny space to move and aim shots??
How I will make a move???

and u mean MouseInputListener???I know it but it canot work can u help me??

Moving could require either a Timer or a Thread.
You would also need a keylistener for key events if you want to move with the keyboard. Have you studied these classes yet?

then I told you that the game is ((Assault Fleet Game)) I should do like the same of this game....!
you can know the what is the game in the google..

If you want to make a game where a spaceship moves and fires, you will require skills far beyond that simple code that you wrote.

Do you know how to handle events in GUI?

It is not something that you can do in a day, or expect others to give you a little hint and then do the entire thing. You will need lots of code. Code that none of us is willing to write for you.

Even if you want to write it by yourself, you need to show more effort and more code on your behalf. Check some tutorials on how to handle events and control moving objects.
There are a lot of things that can not be told here and you need to study them.

Also if you say that MouseInputListener doesn't work what code did you write to use it?

yes that's right I wanna the code of the keyListener???
and moving could be timer..

yes that's right I wanna the code of the keyListener???
and moving could be timer..

Code For KeyListener

You could have also found that on the net

thx I will try

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.