Hitscan in video game design, most commonly in first-person shooters, is a system in which damage is registered instantly once a trigger is pulled.
A weapon, for example, does not launch a projectile the player needs to lead; damage is applied as soon as the player's crosshair is on a target and the fire button is pressed. Internally, this is most commonly done by simulating a ray from the origin of the item along the trajectory of the "projectile" and simply scanning for any objects touching the ray. Games might still show a visual of a projectile although it technically has no effect. In contrast, a projectile-based weapon would launch an actual projectile object that moves through the virtual space at a certain speed and will apply damage only once it has actually touched ("hit") a target.
A projectile weapon which uses unmodified hitscan information to dictate whether or not it has hit its target is often called a hitscan weapon. Shooting the weapon calls the hitscan function, and if an object is detected in the projectile's path, a hit is registered. Since the effect is immediate, the projectiles effectively travel at infinite speed and have a linear or otherwise simple trajectory—a practical approximation of a bullet's speed and accuracy over short distances.
Inheritance is one of the core features of object-oriented programming. It’s a programming procedure that allows you to reuse code by referencing the behaviours and data of an object. In other words, a class that inherits from another class shares all the attributes and methods of the referenced class.