public void move() {
        //this is the method that constntly updates the object. It checks for collision and updates the x and y values 
        y += dy;
        x += dx;

        x2 += dx2;
        y2 += dy2;


        //floor collision
        for (int count = 0; count < Game.getFloorHitBox().size(); count++) {
            Rectangle r = (Rectangle) Game.getFloorHitBox().get(count);
            //on floor
            if (r.inside(x, y + height)) {
                dy = 0;
            }
        }
        if (numPlayers == 2 || player1type == 2) {
            for (int count = 0; count < Game.getFloorHitBox().size(); count++) {
                Rectangle r = (Rectangle) Game.getFloorHitBox().get(count);
                //on floor
                if (r.inside(x2, y2 + height2)) {
                    dy2 = 0;
                }
            }
        }

    }