Tag Archives: Code

mario-ascii

Ascii Art Generator

Sun, beer, volleyball, travel, bathing, swimming, longboarding, and of course… programming! It is the time of year when I have the time to dedicate time to some personal projects. Today has been a long day of coding and the result was a JavaScript Ascii Art Generator. I have been doing some image manipulation using HTML5 […]

Console debugging in PHP

Recently, I have been playing around in PHP again and found that I missed the simplicity of printing whatever object I wanted to the JavaScript console. Guess what? Now we all can! After some fooling around, I ended up with the following class for handling it. Although it requires your code not to crash, I […]

Loading meshes using Assimp in OpenGL

I have been catching up on OpenGL 4.4 lately and realized that there are few working examples on the newer versions of OpenGL. The following code uses Assimp, GLFW and GLEW to load and render all supported Assimp formats and requires OpenGL 3.0 or above. You will be required to set up an OpenGL context, […]

Fast 2D Collision Detection in XNA

As shown in the YouTube video in the post Fast collision detection in XNA, I made a quick way of doing near pixel perfect collision detection in XNA that does not get slowed down by rotating the object. This algorithm first checks the bounds of the object that scales based on the rotation of the […]

Drawing lines in XNA

As there is no built in way of drawing lines in XNA(which is really weird), I thought that I should share this little snippet. public void drawLine(SpriteBatch spriteBatch, Vector2 p1, Vector2 p2, Texture2D texture) { float length = (float)Math.Sqrt((p2x – p1x) * (p2x – p1x) + (p2y – p1y) * (p2y – p1y)); spriteBatch.Draw(texture, new […]