Flooding is one of the most frequent disasters. There are many risks due to flood incidents. Floods can cause a lot of damage and casualties. Flood prevention measures are needed to reduce the impact of flooding. Throwing the garbage in its place, making tree planting movements and making Bio-pore are some examples that can be done in maintaining the surrounding environment. Our game proposes an alternative tool that can be used to educate and motivate people to take appropriate action in protecting the environment to avoid flooding. This paper discusses the design and implementation of game creation of environmental maintenance. The Flood Disaster Prevention Game developed with Unity. This paper proposes the firefly algorithm as an algorithm in a flood rescue simulation game. The proposed firefly algorithm will be used to pathfinding. The fire-fly algorithm is simulated with MATLAB R2016a. The simulation result shows the best position that can be reached is (0.00006, -0,00045) with the final value is 12. This position is assumed as the rescue location of flood victims.