DEV Community

aldrin312
aldrin312

Posted on

Zooming and Panning

This time I worked on adding a zooming and panning feature for aibyss, an AI based game where the user can input how the AI should behave in game. The main game is the AI needs collect food in order to live, each time it eats a food it gains a score. How this AI behave is that the user can add more to the base AI code to make the AI more effective at collecting food. The game itself is currently in development but the main feature is working.

Issue Zooming and Panning

This one was particularly tricky to work on, considering that their wasn't any specifications at first. Though it was nice that they responded fairly quickly when I asked to worked on the issue and add the specification they need. But it was still a bit vague. After I showed the first iteration of my work, the specification he wanted got more defined. After several conversation, all specified features was addressed and I can fully work on the issue with direct idea of what I need to do. We ended up splitting the work into two different feature, zooming on mouse location and panning, and another feature zooming on the player and closely follow it.

As for working on the zoom in and panning issue itself. It took me a while to figure out. Needed to research how to zoom in on the game screen canvas and and learn how to pan on it. Then after I figured it out, I have to follow their coding style and worked on the requests they asked me to do when they reviewed my pull request. After everything is done it got merged into main.

Though their was some small issue that came out when working on this. One of which is that game is not designed to pan outside of the predefined spawn locations of the food. So outside of it is just nothing, no food spawned. Maybe on another issue the spawn food location can be expanded as it wasn't an issue when the map is on a fixed view.

Top comments (0)