Learn how to program
by playing video games.

All Articles

How To Send Inputs to Multiple Windows and Minimized Windows with Python
Let's explore using SendMessage to send automated inputs to multiple windows at once, or to windows that are minimized or in the background. I'll share …
AP Computer Science A - Study Session
Get prepared for the AP Computer Science A exam! I'll let you know what to expect and go through some example questions from the official …
How to make a Video Game in Java (2D Basics)
This project will get you making your first game in Java! Take my starter code (I explain how it works) and build your own game! …
The Joy of Coding
In this beginner friendly Java project, we create a simple Bob Ross inspired painting using the Java Swing Graphics library. I go step-by-step through each …
How To Get Started with Java Development using VS Code on Windows
This is a quick tutorial on how to get started with Java development on Windows using Visual Studio Code. Here we'll go through all the …
Staying Motivated and the Cycle of Programmer Burnout
It seems every programmer faces burnout eventually. But as a new programmer, this sudden exhaustion can be confusing and very discouraging. Maybe programming is just …
How To Build a Bot with OpenCV
Learn how to combine OpenCV object detection with PyAutoGUI and Threading to build a custom Python video game bot. Using the OpenCV image recognition techniques …
Training a Cascade Classifier
In this tutorial, we train an OpenCV Cascade Classifier entirely on Windows to detect objects in a video game in real-time. Making your own Haar …
Canny Edge Detection? ORB Feature Matching?
Learn from my explorations with using Canny Edge Detection and ORB Feature Matching to detect objects in video games in real-time. Links Grab the code …
HSV Color Range Thresholding
Improve your object detection by using the HSV Thresholding technique in OpenCV. I'll also show you how to use the OpenCV GUI builder to adjust …
Real-time Object Detection
Learn how to detect objects inside a game window in real-time using OpenCV. Links Grab the code on GitHub: https://github.com/learncodebygaming/opencv_tutorials In the first three parts …
Gladiabots Review & Tips for New Programmers
Gladiabots is an AI strategy game where you write code for a team of robots and send them into battle against other teams. Matches are …
Fast Window Capture
Learn how to capture window data in real-time as a video stream for processing with OpenCV. We try several different methods searching for the fastest …
Grouping Rectangles into Click Points
Learn the trick to using OpenCV groupRectangles() for multiple object detection. This is part 3 in the OpenCV Python tutorial for gaming. Links Grab the …
Thresholding with Match Template
Detect multiple objects with OpenCV's match template function by using thresholding. In this tutorial, we dig into the details of how this works. Links GitHub …
OpenCV Object Detection in Games Python Tutorial #1
OpenCV is an open source computer vision library with hundreds of functions for processing and understanding images. In this tutorial, I'm going to show you …
Perfecting our Woodcutting Bot
Today we finish coding our woodcutting RuneScape bot! In part 4 we use our pixel color matching skills to confirm when logs appear in our …
Color Botting Basics
Our JavaScript RuneScape bot continues with part 3. Here we learn how to automate dropping logs from our inventory, how to use basic computer vision …
RobotJS Tutorial for Beginners
Part 2 of this tutorial will teach you the basics of how to automate mouse inputs using RobotJS. We go over require statements, functions, how …
How To Code a RuneScape Bot with RobotJS
In this tutorial series, I'm going to teach you how to program a simple Runescape bot in JavaScript. More specifically, we're going to be using …
Starbase - Programming In Space? Pre-Alpha YOLOL Guide
There's a new programming video game in development that's caught my eye, and that game is Starbase. In this video, I want to do an …
PyAutoGUI not working? Use DirectInput
Since my video game botting tutorial, where we used PyAutoGUI, multiple people have told me that PyAutoGUI doesn't work with the video game they're playing. …
The SIMPLEST Screeps Tutorial
If you're new to programming, or you're new to JavaScript, but you think Screeps is cool and you really want to play it, in this …
The SIMPLEST Screeps Code Possible
What is the simplest, yet fully-functioning Screeps code we can possibly write? To answer this question, we first need to define it well. Let's start …
Codewars Review & Tips
In this Codewars review, I talk about the pros and cons of using it to improve your programming skills. I also offer some tips for …
Coding by Voice with Voice Attack: a Practical Guide for Programmers
Programming with voice recognition is something I've wanted to try for a while. In this video, I let you know what I think and how …
Coding a simple Artificial Intelligence for Rocket League
Basic video game AI is built up from many simpler components whose actions are coordinated by decision making logic. Complex behavior emerges as we add …
Your First Rocket League Bot: BoostHog!
Let's write the code for our basic boost stealing bot! Conceptually it's simple: 1. Figure out where the boosts are located on the pitch and …
Learn Python by playing Rocket League
RLBot is a framework for making Rocket League bots. In this tutorial, I show you how to get started with Rocket League bot programming by …
Complete Botting Loop
Here's what the completed Earth & Beyond automated trading loop should look like once you've finished the PyAutoGUI Video Game Bot Tutorial! If you want …
Basic Image Recognition
PyAutoGUI's image matching features allow us to get information from the screen. In this video, I show you how to use these simple image recognition …
Automate Your Bot Script Creation
In this video, I show you how to use pynput to capture mouse and keyboard inputs in the game, and then use those recordings to …
Your First PyAutoGUI Game Bot
Let's create our first simple video game bot, a timing bot! We'll be learning the basics of PyAutoGUI mouse and keyboard input controls. Links GitHub …
Get Started with a Great Beginner AI Project!
In this tutorial series, I'll show you how to use PyAutoGUI to write a video game bot in Python. This is a great beginner AI …
Defending Your Room
Screeps tutorial step number five: defending your room. We learn about safe mode, and how to build towers and use them to attack enemy creeps. …
Auto-Spawning Creeps
Screeps tutorial step number four: auto-spawning your creeps. We learn how to automatically spawn creeps after they die. We are also introduced to room visuals, …
Building Structures
Screeps tutorial step number three: building structures. We build extensions to increase the amount of energy available in our room for spawning creeps. This will …
Upgrading Your Controller
Screeps tutorial step number two: upgrading your room controller. We learn to use the creep memory to differentiate between creep roles. Our new upgrader creep …
Game UI & Basic Scripting
Screeps tutorial step number one: the game interface and basic scripting. We learn how to spawn a creep, tell our harvester creep to gather energy, …
Screeps Tutorial Introduction
In this series I want to introduce you to a programming video game called Screeps. I'm going to walk you through the official tutorial, so …
Ben Johnson My name is Ben and I help people learn how to code by gaming. I believe in the power of project-based learning to foster a deep understanding and joy in the craft of software development. On this site I share programming tutorials, coding-game reviews, and project ideas for you to explore.