Stardew Valley

Fun2 min read

Stardew Valley, or should I say the new Harvest Moon? When I first knew the game when I open twitch to watch some starcraft stream, I can’t help but get the familiar feeling with the Harvest Moon game that I play when I was a child. Well, at least without the RPG elements in Stardew Valley, I will think it is the new Harvest Moon game with the different name. For you who never play Harvest Moon, you may don’t get…

Avoiding SQL Injection in PHP

Development3 min read

Recently, I’m reviewing some web project that made using PHP. It nice website, responsive and can support both PC and mobile display. But, it seems that they didn’t keep security in mind when they develop that website. By security, I didn’t mean that unauthorized people can access certain login-only page or something. But it seems that they still trust user input naively. Of course, they still have some sort of validation, but it only work on username or password. I…

Generate Your PHP Documentation

Development2 min read

In my last post, I tell you to make your code well documented, for a reason. But sometimes, making your code documented wasn’t that much help at all. I mean, to know what your code docs, you need at least code hinting that shows docs like IntelliSense, or you must open the source code. Of course, this can be inconvenient. Especially if your IDE/Editor doesn’t have that feature at all. In a language like PHP, it seems that I can’t…

Make Your Code Documented People

Development2 min read

In the last couple years, while working on collaborations projects with some companies. Working with different frameworks, people, database, and APIs. I notice several thing that doesn’t really suit me and I consider them as ineffective or bad practice. One of them is documentation. Some people I work with (not all), consider it as a waste of time, no one will read it. Well, it does make sense. Just like the user manual, no one bothers to read it. But…

How to Run .phar Files

Development1 min read

Couple days ago, when I working on a web project for some developer company. They ask me if I can tell them how to create API documentation like the one I use in my own framework. By API documentation, I mean like this one They know that I use apigen to generate the documentation but they don’t know how to use it since it not an executable file like exe or bat which you can just run on click. I know there is…

Basic Game Math: Vector Length

Development3 min read

In the last couple post, I write about basic Vector operation addition, subtraction, multiplication, and division. Not only that, but I also give an example of how to use them in game development. Now, in this post, I will write about Length on Vector. Vector, as far as I know, mostly used to represent a position of some point or some object, relative to one point or another object. That mean because of how vector work, a vector has a length…

Basic Game Math: Vector Multiplying or Dividing

Development1 min read

In the 2 previous post, which is about vector addition and subtraction. Right now, I will write about how to multiply or divide vector with some number (scalar). I combine them both since they are pretty easy and quite similar in the calculation and in the practical use. By multiplying a vector with some number, you will make it’s growing or shrinking depend on how big the number is. So, if you multiply it vector with 2, then it will…

Basic Game Math: Vector Subtraction

Development<1 min read

Substracting vector, like addition vector, is basic and easy equation to do. Since you just need to subtract each axis from both vector. This can be expanded to: By subtracting a vector with vector, the result you get is vector direction from vec2 to vec1. See image: So if you do this equation: In vector c, you can get vector direction form vector B to the vector A. And if you want to do subtraction on a 2-dimensional vector, you…

Basic Game Math: Vector Addition

Development1 min read

Usually, this is used to move object position to other position by some vector that represents directions in game object movement. Like if you want to move the object to some direction using vector or push object to the x-axis or anything. To do this, you just need to add both vector and the result is final position. Here’s the equation: Which can be expanded to: Adding a vector is like put the tail of the second vector on the head of…