In the area of artificial intelligence, automatic driving is a significant study area. Self-driving cars are vehicles that can sense and respond to surrounding environments to guarantee a safe and machine-controlled drive. However, the cost of a driverless car is considerably higher than a typical car, preventing the further promotion of such technology. The situation could be improved if there is a way to reduce the cost of sensors. This paper uses Machine Learning Agents to create a self-driving agent. The agent is trained under the Proximal Policy Optimization policy. In addition, a randomly generated map is constructed to improve the robustness of the agent. After training, the agent can drive the car without hitting walls and obstacles with six sensors. As tracks and blocks are randomly created, the driver agent applies to real-life situations and could be used as simulations for real self-driving cars.