Power lines down - my third Ludum Dare entry
That was a pretty relaxed Ludum Dare this time. I spent around 20 hours on the game, 10 hours on Saturday and 10 hours on Sunday.
The most complicated parts during development were certainly the algorithms to generate a path between power plant and city and to check if a power plant (windmill, solar panel, wind turbine) is connected to the city.
I solved the first issue using GameMaker Studio 2's mp_grid feature. To simplify code I created a 15x15 grid with a cell size of 1 pixel and just used the function mp_grid_add_cell() to mark the plants and the landscape elements as blocked. From then it was easy to traverse the result path and create the cable elements on each path tile, mapping pixels to tiles.
To generate a playable level it was just calling some random "rotates" on each cable or plant to rotate their connections.
So I could finish the Saturday with a working random level generation algorithm which always found and built proper routes from the plants to the city.
The second issue - checking if a plant is connected to the city - was a bit more complicated. It's basically a recursive algorithm that tries to find a way from any plant to the city. But I wasted 1 or 2 hours before I realized that I not only had to check if there was a cable in the direction I wanted to walk, but there also had to be a valid connection (for example current cable tile has a connection to the east and the tile to the right has a connection to the west. After realizing that little brain twister it was easy.
I spent the rest of Sunday generating bad sound effects, adding some programmer's art and do the menu, ingame dialog and instructions stuff.
I uploaded everything around 10 PM german time. I could have spent some more hours (5 hours left) for juicing up the game or dabbling with self made music (you wouldn't want to hear that!) but I wanted to go to the gym in the morning so I called it a night.
Have fun playing my game and feel free to give some feedback, suggestions for improvements, etc.
Get Power lines down
Leave a comment
Log in with your itch.io account to leave a comment.