Posts

Showing posts with the label Tutorials

Game development live blogging - Part 2

Image
Alright yesterday I left a body-less snake alone in Part 1. Today I am going to make it attach with its body, and have you test-drive the snake in the editor, even in "Edit mode"... Fancy! I know, that's one of the strength's of Unity3d's editors. Recap : So far, in the editor, edit mode, I am able to drag the snake's head GameObject, and snap it to the grid. Now its time to link them together. Usually in the past, I always hold them all in a single array like data structure and keep updating their position using code, by shifting their position data from head to body 1, and body 1 to body 2 and so on. This time I am going to try a new approach. Let's do it the Unity3d's way. First I am going to declare a new variable called "nextPart" of type SnakePart. I realised, each part's responsibility is only to pass its old position to the next body part. This will be a chain effect and the entire snake will move. Also we never use th...

Game development live blogging - Part 1

Image
I'm starting a project called "Snake On Acid" using Unity3d engine. Its the classic old Nokia snake game, but with all the game development magic I have learnt so far in my career. It is going to have what I believe are some interesting time based twists, amazing sound and flashy graphics with lot of juicyness! Much in line with super hexagon's style. Lets start.. I have setup a basic project with some graphics inspired from Neave snake. I hope to change the graphics later. I have a "gameboard" background graphic object (with sorting layer : background), a snake game object with three snake body objects (sorting layer : foreground) and a main camera object. Oh I also have Demigiant's DoTween plugin added to the Unity project. There's going to be some amazing tweening :) Now to make the snake move, but with some tween magic. I am going to focus only on the head snake object and attach a script to the body. Body part will be a prefab, and w...

Lets learn pixel shaders - Chap 2 - Basics

Image
Important - To move forward open another tab in your browser and open the URL  http://www.iquilezles.org/apps/shadertoy/ , I will refer to this tab simply as 'Shader Toy' Chapter 2 - Basics of pixel shader with 'Shader toy' Let us write some code, switch to the shader toy and notice that the " Deform " shader is already loaded and is running by default. On the right side bottom you see the source code, and on the left is the rendered effect. Take some time to notice the various details/controls shown to you like 1) fps , time, play/pause button, restart button on top of render area (place where the effect is played). 2) Dimensions panel - Width and height of the render area on top it. You can change it if you want. 3) The textures passed to the pixel shader are given right to the width/height box. You can pass up to 4 textures and use them in the pixel shader. The texture used in deform shader is given in the box 'unit 0'. Copy paste that UR...

Lets learn pixel shaders! - New Series - Chapter 1

Image
This is the beginning of a series of tutorials, about pixel shaders (aka fragment shaders) with WebGL. I will start by assuming you are someone who has "absolutely no experience in graphics programming", but you should know what pixels are, what their components are. And optionally if you have basic 3d texturing knowledge, it will help a lot, but again not compulsory. Without more blah, blah, let us start learning fellow programmers! Thanks to  http://www.iquilezles.org/apps/shadertoy/ without which I would have never even started this! All our tutorials will be explain with reference to that web app. You will need one of the latest browser to run it. Chapter 1 - Pre-requisite (for the n00b graphics programmer) Pixels (skip if you know) Everything you see on your monitor is made of pixels. If you zoom into your computer monitor, basically it is made of basic blocks (usually square shaped) called pixels. But as they are very small and closely packed, you ar...