package dk.itu.mario.engine;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;

public class Play {

	public static void main(String[] args) {
		
		JFrame frame = new JFrame("Mario Experience Showcase");
		ParsedArgs parsedArgs = ArgParser.parse(args);
		MarioComponent mario = new MarioComponent(640, 480, parsedArgs.isCustom(), parsedArgs.createLevelGenerator());

		frame.setContentPane(mario);
		frame.setResizable(false);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.pack();

		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		frame.setLocation((screenSize.width - frame.getWidth()) / 2,
				(screenSize.height - frame.getHeight()) / 2);

		frame.setVisible(true);

		mario.start();
	}

}