Topics / Building a game
Building a game
We built a small village game in the browser with an AI doing most of the coding, and kept hitting words we did not know: sprite, collider, shader, tick. Each term here says what it is, what it changes about the game you are making, and how to ask your AI about it so the next conversation goes faster.
2D graphics
Sprite
A sprite is a flat picture the game draws on screen: a villager, a tree, a coin. Animation is several sprites shown one after another.
Sprite sheet and texture atlas
A sprite sheet packs the frames of one animation into a single image. A texture atlas packs many different sprites into one image. Both exist so the game loads one file and draws from it instead of juggling hundreds.
Tilemap
A tilemap builds the ground and walls out of small square tiles repeated on a grid, like a mosaic. The map is a grid of numbers saying which tile goes where.
Core concepts
Camera and viewport
The camera decides which part of the world is on screen and from what angle. The viewport is the rectangle it draws into. Zooming, following the player and screen shake are all camera changes.
Delta time
Delta time is how much time passed since the last frame. Movement is multiplied by it so a character moves at the same speed on a fast computer and a slow one.
Game loop and tick
The game loop is the heartbeat: many times a second the game reads input, updates the world, then draws it. One pass is a tick or a frame.
Scene, node and prefab
A scene is everything loaded at once (a level, a village). A node or game object is one thing in it, and nodes sit in a tree: a house holds a door that holds a handle. A prefab is a saved node tree you can stamp out many times.
State machine
A state machine is a way to say a thing is in exactly one state at a time (idle, walking, talking, sleeping) with rules for moving between states. It keeps character behaviour from turning into a tangle of ifs.
Graphics
Material and texture
A texture is an image wrapped onto a 3D model's surface. A material is the texture plus the rules for how light treats it: shiny, matte, glowing, see-through.
Shader
A shader is a tiny program that runs on the graphics card and decides the colour of every pixel it draws. Lighting, water, glow, cartoon outlines and day-night tint are all shaders.
Performance
Draw call and batching
A draw call is one instruction from the game to the graphics card: draw this thing. Batching groups many things into one call. Fewer calls means a smoother game.
Frame rate (FPS)
Frames per second is how many times a second the game draws a new picture. Sixty is smooth, thirty is acceptable, below twenty feels broken.
Physics
Collider and hitbox
A collider is an invisible shape attached to a game object that says where its edges are for bumping into things. A hitbox is the same idea used for hits and pickups.
Raycast
A raycast shoots an invisible line from a point in a direction and reports the first thing it hits. It is how a game asks 'what is in front of me?'
Rigidbody (physics body)
A rigidbody is the part of a game object that the physics engine moves: it has mass, velocity and gravity. A collider gives the shape; the rigidbody gives the motion.