Beginning a game
<p>I started a game, but there is something wrong with it. It actually don't shows anything and neither give me an error. It just run it and do nothing else.</p>

<p>Here are my codes:</p>

<p>CLASS</p>

<pre><code>    package Game;

    import java.awt.Canvas;
    import java.awt.Dimension;

    import javax.swing.JFrame;

    public class Window extends Canvas{

        private static final long serialVersionUID = -2408406005333728354L;

        public Window(int height, int width, String title, Game game){
              JFrame tit = new JFrame(title); 

              tit.setPreferredSize(new Dimension(width, height));
              tit.setMaximumSize(new Dimension(width, height));
              tit.setMinimumSize(new Dimension(width, height));

              tit.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  //It make the game close up to the end without bugs
              tit.setResizable(false);   //not able to resize
              tit.setLocationRelativeTo(null);   //put the frame in the middle of the screen, originaly it starts up left
              tit.add(game);    // adding pur game class to the frame
              tit.setVisible(true);  //to make it visible
              game.start();  // makes the game start
        }


    }
</code></pre>

<p>Here is the MAIN</p>

<pre><code>    package Game;
    import java.awt.Canvas;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.image.BufferStrategy;

    public class Game extends Canvas implements Runnable{

        private static final long serialVersionUID 

= 1550691097823471818L;

    public static final int WIDTH = 640, HEIGHT = WIDTH / 12*9;
    private Thread thread;
    private boolean running = false;
    public Game(){
        new Window(WIDTH, HEIGHT, "TITLE OF THAE GAME", this);
    }

    public synchronized void start(){
     thread = new Thread(this);
     thread.start();
     running = true;
    }
    public synchronized void stop(){
    try{
        thread.join();
        running = false;
    }catch(Exception e){
        e.printStackTrace();
    }
        }

    public void run(){
        long lastTime = System.nanoTime();
        double amoutOfTicks = 60.0;
        double ns = 1000000000.0/amoutOfTicks;
        double delta = 0;
        long timer = System.currentTimeMillis();
        int frames = 0;
        while(running){
            long now = System.nanoTime();
            delta += (now-lastTime) / ns;                      
            lastTime = now;
            while (delta&gt;=1){
                tick();
                delta--;
            }
        if(running)
            render();
        frames++;

        if(System.currentTimeMillis() - timer &gt; 1000){
            timer += 1000;
            System.out.println("FPS: "+ frames);
            frames = 0;
        }
        }
        stop();
    }

    private void tick(){

    }

    private void render(){
        BufferStrategy bs = this.getBufferStrategy();
        if(bs == null){
            this.createBufferStrategy(3);
            return;
        }
        Graphics g = bs.getDrawGraphics();

        g.setColor(Color.black);
        g.fillRect(0, 0, WIDTH, HEIGHT);

        g.dispose();
        bs.show();
    }
public static void main(String[] args){

}
}
</code></pre>

<p>Actually there is something that I don't understand and it is the <code>serialVersionUID</code>. I don't know what this stuff is. I just copied it from this source: <a href="https://www.youtube.com/watch?v=1gir2R7G9ws&amp;index=4&amp;list=PL3j6S0UUuVMRSD1_wCzr2-Yd8h48rUvhs&amp;t=647s" rel="nofollow">https://www.youtube.com/watch?v=1gir2R7G9ws&amp;index=4&amp;list=PL3j6S0UUuVMRSD1_wCzr2-Yd8h48rUvhs&amp;t=647s</a></p>

<p>It is also the source i use to build those codes (copied).</p>

<p>Thank you for your time.</p>