Hi guys!
I'm doing a little game in Java and I would like to insert a background music managed by a JButton. When the button is pressed, the music starts and then, to stop it, the button is pressed...
Type: Posts; User: Nemesis89
Hi guys!
I'm doing a little game in Java and I would like to insert a background music managed by a JButton. When the button is pressed, the music starts and then, to stop it, the button is pressed...
Thanks for the tips. Unfortunately it is not easy to understand the problem. I can say that this class is activated once the player reaches a maximum score in the GamePanel. Then you will have the...
This is the panel of the winner after the game :
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Insets;
import java.awt.event.ActionEvent;...
Hello! In carrying out my little game I made a panel "Winner" in which I have two JButton plus I would like to add a blinking text to indicate the victory of the player("You win!").
Currently this...
I solved:
long totalSeconds = 150;
long minutes = totalSeconds / 60;
long seconds = totalSeconds % 60;
//minutes -> 2
//seconds -> 30
I created my countdown thread!
The manufacturer of the thread as a parameter will have the time in seconds (eg 120) and then be shown divided into minutes and seconds. In this case, doing 120/60 I...
And the switch panel who should do it?
Could you show me an example if possible?
With regard to the ActionListener I would like to add it to the JButton "Start Game" .
public String show="";
JButton startGame = new JButton(new ImageIcon("start.png");
startGame...
This is the class Game
public Game(final MainFrame mainFrame, final GameManager gameManager, ImageProvider imageProvider) {
this.setLayout(null);
dragX=0;
dragY=0;...
By studying the example in the link Swing Timers - Tutorials - Static Void Games
I noticed that the class "MyListener" implements ActionListener. In my case I will have action on the part of...
Unfortunately I could not write anything yet because I do not know where to start.
Thanks anyway for the suggestion
Hi, I'm making a small play in java in which you have a limited time to make as many moves as possible (with the aim of achieving a maximum score), like this: ...
The example is very clear, that's fine and I understand, but do you think I can / is correct that I want my object point in the red dot in the image?
And if I can, how do I determine the point (for...
I agree with what you said.
This image is loaded and displayed as a normal cursor.
If I had this same image of size 32x32 I could have the point of hotspots at the point indicated by me in the...
Now it is visible?
2730
Thanks anyway for the clarification, but I don't want the cursor has this dimension, I wrote for information, in fact, writing code on the back has been adapted to the classical size of the cursor....
Hello! I'm doing a little play and among the many things I decided to change the mouse cursor based on the theme of the game.
This is the code that I wrote for the declaration of the cursor:
...
Hi programmers! I just signed up to the site. I hope to compare with you and improve my skills as a programmer Java. :-h