My first open source project

Introduction

I’ve started building my first open source project back in November 2017. I actually thought to write it for fun, I didn’t know that I’ll be extending this idea, It was supposed to be a 30 min project. But many ideas came to my mind and this is how it’s started. Also, Pixi (this is how I named it) was a closed-source at first.

Heavy Squares.

When I was learning Microsoft’s GUI Framework called WPF I decided to make a very simple program to color pixels on click. Yes. Something very similar to MS Paint, but on a smaller scale, like a 3×3 grid. This idea came to me when I was reading about rectangles from WPF’s toolbox. Young stupid me thought “What if I’ll connect 9 rectangles and color them on click”. I quickly started to construct my brilliant idea. It was working. I can even say, that it was working perfectly. But don’t forget that it was just 9 rectangles. I saw potential in this project, so I started expanding it. This is when It’s getting funny, when canvas with squares began to be bigger (1024×1024 for instance) program was eating resources like stupid. A huge amount of ram (about 3 GB) just to create a 1024×1024 grid with squares. And of course, the code was messy too.

Refactoring

I started having troubles in understanding what was going on in the code. It was caused by my unconcern. Quality of code caused my fear to do any changes, so I stopped working on Pixi for half a year. After that time I got motivated again, and I started refactoring the code. In fact it wasn’t refactoring, it was rewriting program from scratch. I took me about a month to finish rewriting it, I’ll write more about refactoring in other post.

Current state

After successful refactoring, I decided to publish PixiEditor to github. You can contribute, download and modify the code. First usable version is available on releases page. Stay tuned!

Screenshot from first release of program

My first game

How it started

As I mentioned in My programming story I made a game. Bad one of course, but from scratch, by myself. And it was a HUGE milestone to me. It was the time when I stopped copying the code from videos/articles and built something mine. It’s worth to notice that I was 13 years old while building this game.

What was it about?

It is a labyrinth game called Potato Labyrinth, where you move a guy that is a potato (literally) to find a way to the exit. But it isn’t all. There are “fancy” mechanics in it, like portals, gates and I even made a dark level, where you only can see a few meters away.

First level

Dark level

Building

I made this game using Unity game engine and C# programming language, It’s a really powerful piece of software. Here is a short snippet of the game code that is responsible for the pause menu:

public class PauseMenu : MonoBehaviour {
    public GameObject pauseMenu;
    public static bool pauseMenuActive = false;
    // Use this for initialization
    void Start()
    {
        pauseMenu.SetActive(false);
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.Escape)&&pauseMenuActive == false)
        {
            pauseMenu.SetActive(true);
            pauseMenuActive = true;
        }
        else if (Input.GetKeyUp(KeyCode.Escape)&&pauseMenuActive==true)
        {
            pauseMenu.SetActive(false);
            pauseMenuActive = false;
        }    
    }
   public void BackToMenu()
    {
        SceneManager.LoadScene("Menu");
        Points.points = 0;
        LevelPointsRequired.activelvl = 1;
        pauseMenuActive = false;

    }
}

The code is terrible, as you can see, but it was my first true creation.

Summary

My first game was a bad one, but that’s okay! Everybody has to start somewhere, even a bad game like that is the next step for something better, bigger and more ambitious. I’ve decided to share this game if you want to check it out here.