I'm making a 2D runner game, I made my frames with
public class MainMenu2 {
MainMenu2() throws IOException{
JFrame Main_Menu = new JFrame("Main Menu");
Main_Menu.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
final int widthScreen = screenSize.width;
final int heightScreen = screenSize.height;
every time I created a class I made the JFrames like that every single time, without re-calling the class or whatever. I completed the menu with buttons that connect to other classes but I need to make a level now. It consists on a player moving right,left and up, collisions with platforms and enemies. Kinda like super mario. I'm a beginner in Java so I haven't found any examples that follow my structure, since they all base off from 1 JFrame. I don't know how to make a tile and connect it to a class' JFrame. I'm lost I need help, thank you.