I've been making a snake game, and everything works, tho the algorythm of the snake movement isnt that good, but its fine.
Now, I also have an apple on the screen, and the problem is i can't figure...
Type: Posts; User: 123099
I've been making a snake game, and everything works, tho the algorythm of the snake movement isnt that good, but its fine.
Now, I also have an apple on the screen, and the problem is i can't figure...
I tried using the PrintWriter and the BufferedReader but it just waits for me to input something, but thats not what I want.
I want it to send data automatically without me having to input anything....
The problem is that I can't fully understand how the communication between the socket and the serversocket works.
What I understood is that for example the server waits for me to write something and...
I've read this article before posting but I didn't understand how the communication is working, because how i see it, it scans input from the keyboard and sends it to the server
but I need that...
you might want to try this:
for(int port=1;port<=65535;port++){
try{
Socket s = new Socket("127.0.0.1",port);
} catch(IOException e){
System.out.println("port " + port + " is being...
Hey all,
I am making a multiplayer game and I need to always send the place and state of the character from the client to the server and from the server to the client.
The question is, how to do...
I haven't programmed using gui a long time so I was making this project to remember coding tricks and the best ways to make some things.
and yes the 30 is the decoration height which i included in...
I have both windows xp and windows 7.
Once I've put the JPanel then it didnt include the decoration in the windows height and width as with the JFrame.
I've written all my code including the...
Because I've already written the code using the Jframe's width and height, once I tried what you suggested it made border problems, and some bugs.
I do agree that it does make the painting better,...
So instead of extending JFrame in the Main class I should extend JPanel?
Or am I supposed to create a new class that extends JPanel?
and how am I supposed to call the paintComponent method? or is...
hey there,
some of you might have seen my latest post in which i've asked for hep with my pong project.
Well I've finished it and its working all right, but the problem is that its running corectly...
Thank you all for your help.
I've finally finished my project.
Thanks a lot for all your help!
The problem was this line:
if(ball.getX() - (ball.getDiameter()/2)<p1.getX() + p1.getWidth() || ball.getX() + (ball.getDiameter()/2)> p1.getX()){
The expression was always true because i...
From the debugging I found the problem.
It always draws the ball at x - 0, y-1 and it never changes although the other functions are executed till the end.
The problem was that I've sent to the...
I'm always doing this, and when I did this all the ball methods execute normally till the end, but it just wont show on the screen.
And the results after modifying the code again were that the ball...
Oh right, I was using it before I have modified the code.
Ill check it and I'll post the results.
But the problem is, that I'm also using the drawMe function inside the class itself, thus I'll need to send a Graphics object within the class itself also each time I'm using the drawMe() function....
Here is the code.
But I have a problem, the ball won't draw, although it moves.
Main Class:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
...
never mind solved this bu sending the main object to the racket class through the racket's constructor.
But if you have a better way to solve this please share.
ok thanks, but now I have another problem.
How can I use the reapint method through the Racket class without causing a recursion?
The problem is that I need to create a new Main object and then use...
I've changed the code as you said, but the rackets still refuse to move
this is the new codes(not a lot of difference)
Main:
/*
* To change this template, choose Tools | Templates
* and...
Main:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pongnew;
I'm making a small pong game, in which there are 2 rackets - 1 of them is moved y the up and down arrows by the user.
Now, the problem is that when I'm pressing the up and down keys the racket won't...