Creative Problem Solving and Programming - My Experience
- Suguru Chhaya
- Oct 22, 2020
- 5 min read
Updated: Oct 23, 2020

Creativity + problem-solving = the children in the image (the boy is me, by the way)
Ok, the boy isn't me, but I am happy when I solve problems. I want to touch on a recent self-discovery I made.
I have been programming for a while now and I had always believed that PROGRAMMING was what I liked to do. But I recently realized that it wasn't PROGRAMMING that was interesting to me. As a matter of fact, actually writing code was more of an additional component.
What I really liked to do was creative problem solving (CRP).
Since probably most of you reading this blog code, I want to share one of the moments that impacted me the most since I started programming.
I was recently working on a Pygame project in which I was trying to make a clone of a 1v1 aspect of a game called mope.io (I will probably make a tutorial on this soon! Subscribe to me at https://www.youtube.com/channel/UCqnubua38JoJNCCADcG1s4w and stay tuned!) and I was struggling on how to check whether an animal has gotten outside of a circular arena. If you know how to use Pygame, you probably know how masks can be used to check for pixel collisions. Even though I was struggling, I came up with some basic ideas using my prior knowledge, documentation, and creativity. Here are some ideas I came up with:
Use an image of a red ring (without anything in the middle) and apply a mask to it. Apply a mask to the animal image as well and check whether the two collided.
Instead of using a ring, use a regular black circle as the arena. Apply masks to both the arena and the image. Use the pygame.mask.Mask.overlap_area() method to see how much of the image is overlapping with the arena. If the area overlapping goes below some point, I will consider the animal to be outside the arena.
Select some points covered by the animal and check which color the points have. If red, the animal is outside the arena.
I tried implementing all these cases but they failed due to not being able to apply Pygame masks in ideal locations, overlapping areas fluctuating due to image resizing, inability to find points that can accurately tell whether the animal is outside the ring, etc. Even though I kept trying, I couldn’t implement the strategy. I eventually just thought of giving up and making the arena a square (because things are easier that way). I took a break and went to talk to my brother.
Note that my brother had little prior experience in coding. I simplified the problem I was facing (without using complex terminology) and explained it to my brother. I wasn’t expecting any ideas, but I thought some sympathy could help. But then he said,
“If the arena is a circle, why can’t you use the distance between the center of the screen and the center of the animal image?”
コメント