Skip to main content

Posts

Real time chat server with nodejs socket.io and expressjs

Do you want to get to know about real-time chat server with node.js socket.io and express.js?  Random chat sites are well popular among people these days, not only among young but also among elder people. Creating a random chat site or an app is an exhausting task and would take several weeks or months to develop something attractive while having a fast API. A chat API is a server-side code that handles user registration and delivering messages between users. One of the hardest parts amateur developers face in creating a chat API is to create the user presence system which broadcasts the information to users about who is online and who has left. Node.js framework is designed to develop live API s which can keep data in variables and let other connections access em without saving the data in a database or saving in a hard drive. And Node.js has a huge community of developers and there are tons of packages that we can install using the node package manager for free which makes it super e
Recent posts

How to make a first person character controller - Unity

A first-person character controller script is the starting point of any fps shooter game. Even new Unity game developers tend to write their own fps controller script before learning anything else as it is challenging and very exciting. In this article, we gonna create two simple fps controllers from scratch and will guide you step by step on how it works. First, let's understand the basic concept of an fps controller. You should have a rotating camera that rotates in the x-axis to look up and down and the character should rotate on the y-axis to look around. There are two ways to create an fps controller in the Unity Engine.  Using Character controller component Using the RigidBody component Both have different advantages and disadvantages when using them. It depends on your game to select the best fps controller according to your needs.  Character controller based fps controller Pros: Is grounded check is built-in Has its own methods to move the chara

Singleton design pattern in unity - technoob

Singleton design pattern is one of the simplest and widely used design patterns. Singleton simply means that the class cannot be instantiated and there should be only one instance of that class. The singleton instance is created using the static keyword as we need to access it without creating a new instance.  Creating singletons is a bit different from la nguage to language. But the concept is still the same.  In Unity creating a singleton is a bit different from other languages as there are scenes and we need to make sure our instance gonna persist in between every scene. How we create a singleton in Unity is pretty easy. public class ManagerClass { public static ManagerClass instance; void Awake () { if (instance == null ) instance = this ; else if (instance != this ) Destroy(gameObject); DontDestroyOnLoad(gameObject); } } We create a variable of the class called instance. In the awake me

Save System for Unity - Technoob Technology

Unity API has a class called ‘PlayerPrefs’ which allows saving basic data types with a string key. But when a game becomes complex ‘PlayerPrefs’ can't save all the data and it's so hard to access them as you have to remember all the keys and call one by one. To avoid this we can create a custom save system which can save a class at once which contains all the data values. We need two scripts for this save-system.             01.SaveSystem class             02.SaveData class Save system class will contain all the methods to save and retrieve data and ‘SaveData’ class is used as the base class for the classes we going to create to store data.   ‘SaveData’ class doesn’t contain any methods and not extended by any other classes or interfaces. Make sure to mark this class as ‘[System.Serializable]’ in order to make sure this is serializable. [System.Serializable] public class SaveData { } ‘SaveSystem’ class contains 3 methods. One for

Unity Native Toast - Technoob Technology

Unity engine is an awesome game engine but it doesn't contain a toast system within its API. In this article, you gonna learn how to create a toast system like the native Android toast system in Unity Engine. To accomplish this we need a tween engine and for this tutorial, we are using LeanTween which is available in the Unity asset store for free. You can change this to whatever tween engine you would like to use. Let's get started.  This module contains only a single script and pretty easy to understand. Let's call the class as 'Toast' to give a taste of what this is for. First, we need to create canvas prefab with a rounded rectangle and a text element. Then We create the script called Toast and this should be a singleton in order to keep this toast canvas in every scene without destroying. The singleton pattern is simple and what it does is check if there is another toast canvas and if there is another one destroys the current o