Lua
Lua for Games
Learn the patterns that game scripts and game servers are built on, such as events, entities, timers and state machines.
Start the trackFree, no sign-up needed
What you'll learn
- An event systemSubscribe with on and fire with emit
- Entities and componentsAn update loop that safely removes the dead
- The player's inventoryCapped stacks and returning the overflow
- CooldownsThe canUse, use and remaining functions
- A state machineClear transitions with enter and exit hooks
- A coroutine schedulerPause with yield and continue with resume
- Vectors with metatablesWrite pos + vel * dt just like in math
- Collision detectionRectangles, circles and shapes that only touch
- Calculating damageArmor, critical hits and dying only once
- Saving and loading the gameFrom table to text and back without load
Track contents
10 lessons, 2.5 hours in total- 1An event systemLuaSubscribe with on and fire with emit14 min
- 2Entities and componentsLuaAn update loop that safely removes the dead14 min
- 3The player's inventoryLuaCapped stacks and returning the overflow15 min
- 4CooldownsLuaThe canUse, use and remaining functions12 min
- 5A state machineLuaClear transitions with enter and exit hooks14 min
- 6A coroutine schedulerLuaPause with yield and continue with resume16 min
- 7Vectors with metatablesLuaWrite pos + vel * dt just like in math13 min
- 8Collision detectionLuaRectangles, circles and shapes that only touch13 min
- 9Calculating damageLuaArmor, critical hits and dying only once14 min
- 10Saving and loading the gameLuaFrom table to text and back without load16 min