What's new

Closed Restart button or restart key

Status
Not open for further replies.

PHC-B L 4 C K

Honorary Poster
Joined
Mar 23, 2015
Posts
382
Reaction
152
Points
218
Help po kung sino po nakakaalam ng RESTART game once po na dead yung player
 
while(true)
{
code
code


//gameOver
Do you want to continue?
if(no)
break;
}

who sir?


upload_2018-10-14_1-9-25.png
 

Attachments

boss gising ka ?
paano maclose yung old program kasi once nag spacebar ako mag rrun ulit yung file pero naiiwang bukas yung naunang file
Initialize mo yung jframe sa labas para madispose sa Restart function.
Taos dispose mo, then setvisible mo again.
Code:
public static void Restart()
    {
        ex.setVisible(false);
        ex.dispose();
        EventQueue.invokeLater(() -> {
           ex = new Snake();
           ex.setVisible(true);
        });
    }
 
Initialize mo yung jframe sa labas para madispose sa Restart function.
Taos dispose mo, then setvisible mo again.
Code:
public static void Restart()
    {
        ex.setVisible(false);
        ex.dispose();
        EventQueue.invokeLater(() -> {
           ex = new Snake();
           ex.setVisible(true);
        });
    }

wait boss analyze ko lang to code mo ^_^ thanks po
 
Status
Not open for further replies.

Similar threads

Back
Top