<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[hackeuc]]></title><description><![CDATA[hackeuc]]></description><link>https://hackeuc.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Nov 2026 18:09:14 GMT</lastBuildDate><atom:link href="https://hackeuc.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[The Hidden Maths Behind Subway Surfers, Asphalt 9 and Moto Race Go]]></title><description><![CDATA[I have played mobile games for years, but always just as a player. Recently I tried something different. I played three games like a game developer would…]]></description><link>https://hackeuc.hashnode.dev/the-hidden-maths-behind-subway-surfers-asphalt-9-and-moto-race-go</link><guid isPermaLink="true">https://hackeuc.hashnode.dev/the-hidden-maths-behind-subway-surfers-asphalt-9-and-moto-race-go</guid><dc:creator><![CDATA[Uchechukwu Ezeibe]]></dc:creator><pubDate>Fri, 13 Nov 2026 13:20:31 GMT</pubDate><content:encoded><![CDATA[<p>I have played mobile games for years, but always just as a player. Recently I tried something different. I played three games like a game developer would and looked for the maths that makes them work. I spent time with <strong>Subway Surfers</strong>, <strong>Asphalt 9: Legends</strong> and <strong>Moto Race Go</strong>, took screenshots and wrote down everything I noticed.</p>
<p>What surprised me most is that all three games use the same six ideas, even the simple ones.</p>
<h2>The Six Things I Looked For</h2>
<ul>
<li><strong>Distance:</strong> how far objects are from each other</li>
<li><strong>Direction and vectors:</strong> how things move and which way they face</li>
<li><strong>Algebra:</strong> numbers that change through calculations, like score and coins</li>
<li><strong>Dot product:</strong> whether something is in front of you or behind you</li>
<li><strong>Cross product:</strong> left or right, and rotation</li>
<li><strong>Linear interpolation (lerp):</strong> smooth changes from one value to another</li>
</ul>
<p>I don't have the source code for any of these games, so everything here is based on what I saw while playing.</p>
<hr />
<h2>1. Subway Surfers</h2>
<p><strong>Mobile · Endless runner · SYBO Games and Kiloo · 2012</strong></p>
<h3>What it's about</h3>
<p>You play as a graffiti kid running through the subway tracks to escape the Inspector and his dog. You keep running until you crash. The goal is to run as far as possible, dodge trains and barriers, collect coins and get the highest score. You also complete missions to increase your score multiplier.</p>
<p>The controls are very easy. Just swipe left, right, up or down. The game gets faster the longer you run, so it keeps getting more exciting. Power-ups like the coin magnet, the sneakers and the pogo stick make every run different. My best score was 5,432 and I kept playing to beat it.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/b5d157a2-8412-43c0-8be7-48b41218f686.jpg" alt="Inspector chasing me" style="display:block;margin:0 auto" />

<h3>How a run goes</h3>
<p>Launch → Main Menu → Run → Crash → Continue? → Results → Upgrade → Next Run</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/a8a59838-79c3-4fb4-b65f-57bc106fd47f.jpg" alt="Subway Surfers gameplay loop" style="display:block;margin:0 auto" />

<h3>The maths behind it</h3>
<p><strong>Distance.</strong> I noticed distance in three places. When the run begins, the Inspector stays right behind me. If I hit something he catches up, so the game is checking the distance between us. The coin magnet only pulls coins that are close to me. And when the distance between me and a train becomes zero, I crash and the run ends.</p>
<p><strong>Direction and vectors.</strong> The character always moves forward along the track. When I swipe left or right, it moves sideways into the next lane. When I swipe up, it jumps and then falls back down. The game also gets faster over time, so the forward speed keeps growing. With the pogo stick, the character is sent high into the air and follows a curved path over the trains.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/5b2c01b5-40da-427d-9e34-8bb33de3e0e2.jpg" alt="Three lanes and the swipe hint" style="display:block;margin:0 auto" />

<p><strong>Algebra.</strong> The numbers on the screen keep changing because of calculations. Every coin adds 1 to my coin count. My score is multiplied by the multiplier (x1, x2 or x3), and the multiplier goes up when I complete a mission set. Missions show progress like 6/500, which is my value divided by the target. When I crashed, the game told me "Only 20,973 points to enter this week's Top Run", which is the Top Run score minus my score.</p>
<p><code>Score = points × multiplier</code></p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/f5c0f146-2e28-4e80-b889-16d9c3e13421.jpg" alt="Mission progress" style="display:block;margin:0 auto" />

<p><strong>Dot product.</strong> The game needs to know what is in front of me and what is behind me, and I think it uses the dot product for this. In the screenshots below, the Inspector and his dog are behind me while the train and the coins are in front. In the second one, a train is coming straight at me in my lane. The game has to know that train is directly in front so it can tell if I am about to crash. Things already behind me, like trains I have passed, don't matter anymore and can be removed.</p>
<p>The game compares my forward direction with the direction from me to each object. If the dot product is positive, the object is in front of me (the train and coins). If it is negative, the object is behind me (the Inspector).</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/25760bcb-3a07-4e1b-bb25-cab99020c49d.jpg" alt="Inspector behind, train in front" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/7f3f4cf0-3a73-47df-b653-b7a4e90890a8.jpg" alt="Train coming straight at me" style="display:block;margin:0 auto" />

<p><strong>Cross product.</strong> This was the hardest one to find, because the character always faces the same way. I think the game could use it to know if something is on my left or right side. It could also be used when the character spins and flips on the pogo stick.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/2b3878b2-cb5d-413a-9de1-e7f1b5f2afe5.jpg" alt="Pogo stick flip" style="display:block;margin:0 auto" />

<p><strong>Lerp.</strong> Lerp is what makes the game feel smooth. When I change lanes, the character slides across instead of jumping straight there. The camera moves up smoothly when I jump on top of trains. The power-up timer bar goes down slowly from full to empty, and the loading bar fills up from 0% to 100%.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/00b08e40-b965-4729-a79f-f33da1ce3d8c.jpg" alt="Power-up timer bar" style="display:block;margin:0 auto" />

<h3>How the coin magnet works</h3>
<p>When I picked up the magnet, coins from all three lanes started flying into my character's hand. I think it works like this:</p>
<ol>
<li>The game checks the distance between me and each coin.</li>
<li>If a coin is inside the magnet's range (r), it gets pulled.</li>
<li>The game finds the direction from the coin to me (a vector).</li>
<li>The coin moves towards me smoothly using lerp.</li>
<li>When the coin reaches me, it is collected and my coin count goes up by 1.</li>
</ol>
<p>The magnet also has a timer bar that goes down until the power-up ends.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/dfb672ac-9bd4-46e0-98bb-4d4f4b016248.jpg" alt="Magnet pulling coins" style="display:block;margin:0 auto" />

<h3>What I like</h3>
<ul>
<li><strong>Controls:</strong> Only four swipes, so it is easy to learn. The three lanes make every move clear.</li>
<li><strong>Camera:</strong> It follows the character smoothly, even when jumping on trains or flying on the pogo stick.</li>
<li><strong>Screen layout:</strong> Score, multiplier and coins are always at the top and the power-up timer is at the bottom, so I can check them quickly while running.</li>
<li><strong>Difficulty:</strong> It starts slow and gets faster little by little, so it is not too hard at the beginning.</li>
<li><strong>Rewards:</strong> Missions, the multiplier and power-ups keep me coming back.</li>
</ul>
<h3>What I would change</h3>
<p>I would add a danger bar that shows how close the Inspector is. Right now I only see him when he is already behind me. The bar would fill up as the distance between us gets smaller, so players know when to be careful. It makes the game fairer because players understand why they lost.</p>
<p>I would also add a practice mode where the game runs at half speed. New players could learn when to swipe without crashing all the time. It only changes the time step (speed × 0.5), so everything moves the same way, just slower. Beginners would get less frustrated and keep playing instead of quitting.</p>
<h3>My takeaway</h3>
<p>The concept I noticed most here was lerp. Once I started looking for it, I saw it everywhere: lane changes, the camera, timer bars, the loading bar. Without it, everything would just jump from one place to another. Subway Surfers uses all six ideas. Distance handles crashes, the Inspector and the magnet. Vectors move the character. Algebra runs the score and missions. Lerp keeps it smooth, and the dot and cross product work quietly in the background.</p>
<hr />
<h2>2. Asphalt 9: Legends</h2>
<p><strong>Mobile · Racing · Gameloft Barcelona / Gameloft · 2018</strong></p>
<h3>What it's about</h3>
<p>Asphalt 9 is a street racing game with real cars like the Mitsubishi Lancer Evolution X. I raced on tracks in places like Rome and the Himalayas. Each race has a goal, for example "Finish in position 3 or better". When I hit the goal I get rewards like credits and car blueprints, and I move forward in Career mode to unlock new seasons and cars.</p>
<p>For me it is all about the speed. Using nitro, drifting around corners and flying off ramps feels exciting. TouchDrive makes steering easy, so I can focus on nitro and choosing the path. I won one race in 1st place with a time of 00:57.023.</p>
<h3>How a race goes</h3>
<p>Career map → Check race goal and recommended rank → Choose or upgrade car → Race → Results → Rewards (credits, blueprints, flags) → Next race / Unlock new season</p>
<h3>The maths behind it</h3>
<p><strong>Distance.</strong> Distance is used all through a race. At the top left, DIST shows how much of the track I have finished (4%, 37%, 78%). That is distance travelled divided by the track length. My position (POS. 6/8, 2/8, 1/8) also comes from distance, because the game checks which car has gone the furthest. The minimap shows where the other cars are, and when I drifted the game measured it: "DRIFT 31 yards".</p>
<p><code>DIST % = (distance travelled ÷ track length) × 100</code></p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/e0436e57-0ab3-4839-85dd-3498817ae83a.jpg" alt="POS and DIST with numbers over cars" style="display:block;margin:0 auto" />

<p><strong>Direction and vectors.</strong> The car moves with a speed and a direction, which together are a velocity vector. The speed shows in MPH at the top right (64, 107, 147, 175). When I steer, the direction changes. When I hit a ramp, the car flies into the air and gravity pulls it back down. The game even timed it: "AIR TIME: 2.97 s". Nitro pushes the car forward, so the forward vector gets bigger.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/cf835815-350b-453a-b97c-652d9c1b43d5.jpg" alt="Air time 2.97 s" style="display:block;margin:0 auto" />

<p><strong>Algebra.</strong> The numbers are always being calculated. My Lancer Evolution X had Top Speed 155.3, Acceleration 42.40, Handling 46.30 and Nitro 54.80, and these add up to a car rank. My rank was 467 but the race needed 472, so the game warned me my car was underpowered (472 − 467 = 5 points short). After winning, my credits went from 20,690 to 22,680, so I earned 1,990. The BMW Z4 also added +2,120 to my garage value.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/02851a0b-9c4b-49b6-90a5-7cf2ca997126.jpg" alt="Car stats" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/461396ed-bd4e-4949-9681-0ed87a8c621d.jpg" alt="Car underpowered warning" style="display:block;margin:0 auto" />

<p><strong>Dot product.</strong> The game shows numbers like 1, 2 and 3 above the cars in front of me, so it needs to know which cars are ahead. I believe it uses the dot product of my car's direction and the direction to the other car. If it is positive, that car is in front and gets a number. When I passed a car, a big number popped up with my new position, because that car went from in front of me to behind me. TouchDrive also needs to check if my car is facing along the road, which the dot product can do too.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/7f2e8898-028e-4f65-aaf8-15f0894b2731.jpg" alt="Cars ahead marked 1, 2, 3" style="display:block;margin:0 auto" />

<p><strong>Cross product.</strong> The green arrows at the side of the road show whether the next turn goes left or right. The game needs to know which side the turn is on compared to my car, and the cross product tells left from right. It is also used for rotation, like when the car spins in the air or when the game asks me to "Perform 360".</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/e94eb3a1-bc78-4676-8cf2-d13d96696c58.jpg" alt="Green turn arrows" style="display:block;margin:0 auto" />

<p><strong>Lerp.</strong> Lerp makes the game look smooth. The speed rises gradually instead of jumping straight to top speed. The nitro bar at the top fills up and drains slowly. The camera follows my car smoothly, and in the replay I could switch between CAR and CINEMATIC views where the camera glides between angles. Before each race the camera also pans slowly around the track to show the race goal.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/abe623b8-adfe-4b6f-bd6f-f3fe1055a517.jpg" alt="Replay cinematic camera" style="display:block;margin:0 auto" />

<h3>How nitro works</h3>
<p>Nitro is the main way to go faster. When I pressed the nitro button, flames came out of the exhaust and my speed went up to 175 MPH. I think it works like this:</p>
<ol>
<li>The nitro bar fills up when I drift, jump or hit things on the road (algebra).</li>
<li>When I press nitro, the game adds force in the direction the car is facing, so the speed vector gets bigger (vectors).</li>
<li>The speed rises smoothly towards the new top speed instead of jumping straight there (lerp).</li>
<li>The camera pulls back a little so it feels faster, then moves back in when nitro ends (lerp).</li>
<li>The nitro bar goes down every second until it is empty, then the car slows back to its normal speed.</li>
</ol>
<p><code>new speed = normal speed + nitro boost</code></p>
<p><code>nitro left = nitro bar − (drain per second × time)</code></p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/7f1c5606-1079-4648-8923-b0d3dcbb7cd4.jpg" alt="Nitro in Rome at 175 MPH" style="display:block;margin:0 auto" />

<h3>What I like</h3>
<ul>
<li><strong>Controls:</strong> TouchDrive steers for me, so I only choose the path, use nitro and brake. Very friendly for new players.</li>
<li><strong>Screen layout:</strong> Position, distance, speed, timer, nitro bar and minimap are all on screen, so I always know how I am doing.</li>
<li><strong>Turn signs:</strong> The green arrows warn me about turns before I reach them.</li>
<li><strong>Camera:</strong> Smooth follow camera, and the replay has different camera views.</li>
<li><strong>Balance:</strong> The recommended rank tells me if my car is strong enough before I start, so I know when to upgrade.</li>
</ul>
<h3>What I would change</h3>
<p>I would show the gap to the car in front, like "+1.2 s" or "40 m". Right now I only see my position and the numbers over the cars, so I don't know how close I am. The game already knows the distance, so it just needs to show it. That would help me decide when to use nitro to overtake.</p>
<p>I would also add a ghost car of my best time on each track, so I could race against my own best run and see exactly where I was faster or slower. It gives a reason to replay tracks and get better, not just to collect rewards.</p>
<h3>My takeaway</h3>
<p>In Asphalt 9 the concept I noticed most was vectors. Speed, steering, jumps and nitro are all about how fast the car is going and in which direction. I used to only care about winning. Now I notice that every number on screen, like speed, distance, position and car rank, is being calculated while I drive.</p>
<hr />
<h2>3. Moto Race Go</h2>
<p><strong>Mobile · First-person motorcycle racing · XGAME STUDIO · 2024</strong></p>
<h3>What it's about</h3>
<p>You ride a motorbike from a first-person view, so you see the road over the handlebars. I rode on highways through cities, deserts and beaches, all full of cars and trucks. The goal is to ride as far and as fast as you can without crashing. But there is a twist: if you go faster than 80 km/h, the police start chasing you. Escape and you collect coins. Get caught and you pay a 50 coin fine.</p>
<p>The first-person view makes the speed feel real, and the police chase adds risk. Going fast is exciting, but it can cost you. The controls are simple: left and right arrows to steer and a throttle to speed up.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/e8f42711-7044-44f6-99e0-6187f836c17d.jpg" alt="First-person view" style="display:block;margin:0 auto" />

<h3>How a ride goes</h3>
<p>Start → Choose controls (Normal or Gravity mode) → Ride and dodge traffic → Go above 80 km/h → Police chase → Escape (earn coins) / Caught (−50 coin fine) / Crash → Coins → Ride again</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/70346d2e-7041-4b1b-a7bf-2a1534820c12.jpg" alt="Failure screen" style="display:block;margin:0 auto" />

<h3>The maths behind it</h3>
<p><strong>Distance.</strong> The KM counter on the right shows how far I have ridden (0.06 km, 0.12 km, 0.32 km, 0.38 km). The game also checks the distance between my bike and the cars around me. If it gets to zero, I crash. In one screenshot a car was right next to me on the left, so even a small mistake could have ended the ride. During a police chase, the distance between me and the police car decides if I escape or get caught.</p>
<p><code>distance = speed × time</code></p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/43f4213b-eff0-4170-9b6e-785ebfd08aa5.jpg" alt="Car very close on my left" style="display:block;margin:0 auto" />

<p><strong>Direction and vectors.</strong> The bike always moves forward at a speed shown in KMH (34, 43, 90). The left and right arrows change the bike's direction so I can switch lanes. In Gravity mode I tilt the phone to steer. The phone's tilt becomes a direction for the bike, so the angle of the phone decides where the bike goes.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/14694c2b-cb97-402c-ab1b-bd48d784062a.jpg" alt="Normal mode or Gravity mode" style="display:block;margin:0 auto" />

<p><strong>Algebra.</strong> The whole game runs on simple number rules. If my speed is more than 80 km/h, the police start chasing me. While I was riding at 90 km/h, a Speeding timer counted up and reached 0.9 seconds. If the police catch me, 50 coins are taken away. The game also counts my escapes and the coins I earn.</p>
<p><code>if speed &gt; 80 km/h → police chase</code></p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/12cd2d41-27f8-4231-be45-6a285ccfe9ab.jpg" alt="90 KMH with Speeding timer" style="display:block;margin:0 auto" />

<p><strong>Dot product.</strong> The cars in front of me in my lane are the dangerous ones, so the game needs to know what is ahead of the bike. The police come from behind, and the mirrors on the bike show what is behind me. The dot product of my direction and the direction to another vehicle tells the game if it is in front (positive) or behind (negative).</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/e04cde00-1bd6-4e3e-a6de-8a9a9df2ce83.jpg" alt="Truck ahead in my lane" style="display:block;margin:0 auto" />

<p><strong>Cross product.</strong> When I steer, the game needs to know if I am moving left or right, and whether a car is on my left or right side. The cross product can tell left from right. In the first screenshot below, the whole view is tilted because the bike is leaning into a turn, which is a rotation. In the second, the handlebars are turned to the left. The game has to work out which way the bike is turning and which way it should lean.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/096da9e3-1ac6-46f1-95ad-0f6f587ac960.jpg" alt="Bike leaning, view tilted" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/9ddd427a-5a49-48a1-851f-700948a05832.jpg" alt="Handlebars turned left" style="display:block;margin:0 auto" />

<p><strong>Lerp.</strong> The speed rises smoothly when I hold the throttle. It does not jump from 34 km/h to 90 km/h. It climbs little by little, and the bar on the speedometer fills up the same way. When I steer, the bike moves across the lane smoothly instead of jumping to the next lane. The two screenshots below are from the same road, first at 34 km/h and then at 90 km/h.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/afa50de1-d97e-4333-b64e-1a7133aefbff.jpg" alt="34 KMH" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/0bc0f97a-4897-411d-84b8-12d5f4aafc5d.jpg" alt="90 KMH" style="display:block;margin:0 auto" />

<h3>How the police chase works</h3>
<p>The game told me "Speeds exceeding 80 km/h will result in being pursued by the police". I think it works like this:</p>
<ol>
<li>Every moment, the game compares my speed with the limit: is speed more than 80 km/h? (algebra)</li>
<li>If yes, the Speeding timer starts counting up. I saw it at 0.9 seconds while riding at 90 km/h.</li>
<li>When the timer runs long enough, a police car starts chasing me from behind (dot product).</li>
<li>The game keeps checking the distance between me and the police car. If the gap gets big enough, I escape and my Escapes count goes up. If it gets to zero, I am caught (distance).</li>
<li>If I am caught, I get a speeding ticket: coins − 50 (algebra).</li>
</ol>
<p>This makes me choose: ride fast to go further, or ride slower to stay safe.</p>
<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/6c6fc137-e234-46c1-9e33-f242ecfc87a1.jpg" alt="80 km/h speed limit rule" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/640aa58b3e0c5ff6cf7f94e2/f05c18de-8596-4fb6-a7ba-da6e65e176f2.jpg" alt="−50 coin speeding ticket" style="display:block;margin:0 auto" />

<h3>What I like</h3>
<ul>
<li><strong>Controls:</strong> You can choose between Normal mode (arrow buttons) and Gravity mode (tilting the phone).</li>
<li><strong>Tutorial:</strong> Short pop-ups explain the rules, like the 80 km/h limit and the 50 coin fine.</li>
<li><strong>First-person camera:</strong> Riding from the rider's view with working mirrors makes the speed feel real.</li>
<li><strong>Screen layout:</strong> Escapes, coins, speed and distance are always shown on the right.</li>
<li><strong>Risk and reward:</strong> The speed limit and police chase make going fast a choice, not just the obvious thing to do.</li>
</ul>
<h3>What I would change</h3>
<p>I would add a bar that shows how close the police car is during a chase. Right now I can only check the mirrors, which is hard while dodging traffic. The bar would fill as the distance between us gets smaller, so I know when I am about to be caught.</p>
<p>I would also add a near-miss bonus: extra coins when I pass very close to a car without crashing. The game already measures the distance to other cars, so it could reward small gaps. That rewards skill and gives players another reason to ride carefully at high speed.</p>
<h3>My takeaway</h3>
<p>In Moto Race Go it was distance and algebra together. The KM counter, the gap to the cars around me and the gap to the police all decide what happens, and simple rules like "speed &gt; 80" and "coins − 50" control the whole game. Even a simple bike game is built on rules and numbers.</p>
<hr />
<h2>All Three Games Side by Side</h2>
<table>
<thead>
<tr>
<th>Concept</th>
<th>Subway Surfers</th>
<th>Asphalt 9</th>
<th>Moto Race Go</th>
</tr>
</thead>
<tbody><tr>
<td>Distance</td>
<td>Crashes, Inspector chase, coin magnet</td>
<td>DIST %, race position</td>
<td>KM counter, gap to traffic and police</td>
</tr>
<tr>
<td>Vectors</td>
<td>Forward run, lane swipes, jumps</td>
<td>Speed, steering, nitro, ramp jumps</td>
<td>Steering, tilt controls</td>
</tr>
<tr>
<td>Algebra</td>
<td>Score × multiplier, coins, missions</td>
<td>Car rank, credits, rewards</td>
<td>Speed &gt; 80 rule, −50 coin fine</td>
</tr>
<tr>
<td>Dot product</td>
<td>Inspector behind, trains ahead</td>
<td>Numbers over cars ahead</td>
<td>Traffic ahead, police behind</td>
</tr>
<tr>
<td>Cross product</td>
<td>Left/right, pogo flips</td>
<td>Turn arrows, 360 spins</td>
<td>Leaning into turns</td>
</tr>
<tr>
<td>Lerp</td>
<td>Lane slides, camera, timer bars</td>
<td>Speed, nitro bar, replay camera</td>
<td>Speed climbing, lane changes</td>
</tr>
</tbody></table>
<h2>What I Took Away</h2>
<p>If I had to pick one idea I saw the most, it would be distance. In all three games it decided what happened: crashing into a train, my position in a race, getting caught by the police. Lerp was a close second, because once I started looking for smooth movement I saw it everywhere.</p>
<p>Before this, I only played these games for fun. Now I see that every coin, every crash and every number on the screen is a calculation. Even one simple rule like "speed &gt; 80" can change how you play a whole game. These three games look very different, but underneath they are built on the same maths.</p>
<h2>References</h2>
<ul>
<li>AppGoblin. (n.d.). Moto Race Go. Retrieved November 13, 2026, from <a href="https://appgoblin.info/apps/com.xgame.trafficmoto">https://appgoblin.info/apps/com.xgame.trafficmoto</a></li>
<li>Gameloft. (2018, July 25). Buckle up for the official launch of Asphalt 9: Legends. <a href="https://www.gameloft.com/newsroom/buckle-up-for-the-official-launch-of-asphalt-9-legends-4294">https://www.gameloft.com/newsroom/buckle-up-for-the-official-launch-of-asphalt-9-legends-4294</a></li>
<li>Subway Surfers PC. (n.d.). Subway Surfers PC. Retrieved November 13, 2026, from <a href="https://subwaysurferspc.io">https://subwaysurferspc.io</a></li>
<li>Subwaysurfers. (2023). Classic. Subway Surfers. <a href="https://subwaygame.io/subway-surfers-classic/">https://subwaygame.io/subway-surfers-classic/</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[What happens when you type https://www.google.com in your browser and press ENTER?]]></title><description><![CDATA[There are a lot of activities that are taking place when we surf the internet. Imagine what happens when you want to retrieve information from a website…]]></description><link>https://hackeuc.hashnode.dev/what-happens-when-you-type-httpswwwgooglecom-in-your-browser-and-press-enter</link><guid isPermaLink="true">https://hackeuc.hashnode.dev/what-happens-when-you-type-httpswwwgooglecom-in-your-browser-and-press-enter</guid><category><![CDATA[computer networking]]></category><category><![CDATA[Devops]]></category><category><![CDATA[http]]></category><category><![CDATA[https]]></category><category><![CDATA[web servers]]></category><dc:creator><![CDATA[Uchechukwu Ezeibe]]></dc:creator><pubDate>Sun, 15 Oct 2023 11:05:27 GMT</pubDate><content:encoded><![CDATA[<p>There are a lot of activities that are taking place when we surf the internet. Imagine what happens when you want to retrieve information from a website; it involves many processes, but all these processes occur in a few seconds.</p>
<p>To search the internet we need to use a web browser. There are many web browsers available, Google Chrome, Mozilla Firefox, Microsoft Edge, Brave, and more. However, the most commonly used browser is Google Chrome.</p>
<p>Whenever you type a thing like this in the browser, such as <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a>, it is called a URL (Uniform Resource Locator). Let me demystify what a URL is all about.</p>
<p>A Uniform Resource Locator (URL) is a unique address used to locate a given resource on the Web.</p>
<p>A URL is structured to have a protocol/scheme, subdomain, domain, and paths.</p>
<p>The protocol can be HTTP (Hypertext Transfer Protocol), HTTPS (Hypertext Transfer Protocol Secure), FTP (File Transfer Protocol), SMTP (Simple Mail Transfer Protocol), TELNET (Telecommunication Network), SFTP (SSH File Transfer Protocol).</p>
<p>The subdomain always appears after protocol, such as <code>https://</code>. In this case, <code>www.</code> is the subdomain, and usually ends with a dot (.) as shown in <a target="_blank" href="https://www"><code>https://www</code></a><code>.</code> for reference.</p>
<p>The domain appears after the subdomain in the URL. The domain is a unique name for your website. Typically a domain name looks like <a target="_blank" href="http://google.com"><code>google.com</code></a>, <a target="_blank" href="http://mywebsite.com"><code>mywebsite.com</code></a>, and so on.</p>
<p>After the domain comes the path. The path identifies a specific resource on the webserver that the client, the browser, wants to access. This can be seen in the URL <a target="_blank" href="https://www.google.com/index.html"><code>https://www.google.com/index.html</code></a>, <a target="_blank" href="https://www.mywebsite.com/home"><code>https://www.mywebsite.com/home</code></a>, and so on.</p>
<p>This is an example of a full URL <a target="_blank" href="https://www.google.com/index.html"><code>https://www.google.com/index.html</code></a>.</p>
<p>Let us delve more about when we enter a URL in the browser and press ENTER.</p>
<p>When we search the (URL) <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a> in the browser and press enter, the following sequence of processes will take place in a few seconds:</p>
<ol>
<li><p>The browser makes an HTTP request to the Domain Name Server (DNS), which, in turn, asks for the IP address of the website. The DNS server retrieves this information.</p>
</li>
<li><p>The information that will be transmitted from the server will be in plaintext, which means that your information is vulnerable to interception by anyone. However, HTTPS is a secure protocol that prevents attackers or hackers from spying, eavesdropping, or snooping on your data.</p>
</li>
<li><p>To protect your information from being accessed by hackers or attackers, you should obtain an SSL (Secure Sockets Layer) Certificate. The "s" after HTTPS stands for secure, signifying Hypertext Transfer Protocol Secure (HTTPS).</p>
</li>
<li><p>With SSL, the client-side browser sends an encrypted HTTPS request to the DNS to obtain the IP address of the URL. Subsequently, the browser receives an encrypted response from the server which contains the requested information.</p>
</li>
</ol>
<p>Let's delve deeper into these terms and analyze what happens when you enter a URL on the browser and press enter:</p>
<ul>
<li><p>DNS request</p>
</li>
<li><p>TCP/IP</p>
</li>
<li><p>HTTPS/SSL</p>
</li>
<li><p>Firewall</p>
</li>
<li><p>Load-balancer</p>
</li>
<li><p>Web Server</p>
</li>
<li><p>Application Server</p>
</li>
<li><p>Database</p>
</li>
<li><p>Rendering a web page</p>
</li>
</ul>
<ol>
<li>DNS request: A DNS request is a query sent to the web server by the browser or client.</li>
</ol>
<p>When you enter a URL such as <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a>, it is converted to an IP address, which the computer understands, and then sent to the webserver to retrieve the information needed.</p>
<ol>
<li><p>TCP/IP: TCP/IP stands for Transmission Control Protocol/Internet Protocol. TCP/IP determines how data is transferred from one device to another. To ensure that communication reaches its final destination, it breaks data into small packets and then reassembles them together on the other end. This process maintains the accuracy and facilitates the integrity of the data. So the information retrieved from the web server when you enter <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a> as a DNS request will be divided into packets and recombined together at the client side for accurate transmission of data.</p>
</li>
<li><p>HTTPS/SSL: HTTPS/SSL stands for Hypertext Transfer Protocol Secure/Secure Sockets Layer. HTTPS is a secure version of HTTP. The "s" in the HTTP illustrates that an SSL certificate has been obtained. Communication between the client side and the server side through the HTTP protocol can be monitored on or snooped by a third party or attacker, making our data vulnerable to interception by anyone.</p>
</li>
</ol>
<p>SSL certification is a digital certificate that verifies the identity or authenticity of a website and secures the information between the browser and web server by encrypting the data.</p>
<p>SSL/TLS (Transport Layer Security) is just the latest version of SSL, which is more robust but is essentially the same thing as SSL. Usually, there is a padlock sign before the URL in the browser, indicating that the website has an SSL certificate.</p>
<p>When we search for <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a> in the web browser the client's request and the date retrieved are encrypted.</p>
<ol>
<li>FireWall: A firewall is a network security device that monitors, observes, and filters incoming and outgoing traffic in a web server or application server based on security policies. A firewall prevents malicious or intrusive traffic from having access to the server.</li>
</ol>
<p>A firewall can restrict or filter various types of network traffic based on port-based traffic, protocol-based traffic, IP address-based traffic, stateful filtering, and so on.</p>
<p>When you initiate a connection to a website and external traffic attempts to connect to the network, the firewall will detect and block the traffic.</p>
<ol>
<li><p>Load-balancer: A Load balancer distributes incoming network traffic among multiple servers, making the workload faster. Imagine a scenario where a thousand people are searching for <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a>, and all the traffic is being directed to one server, the server might crash causing the website to go down. When we have two or more servers to which our traffic can be directed, we use a load balancer to direct this traffic to these web servers making it accessible to everyone simultaneously, quickly, and without overloading the server.</p>
</li>
<li><p>Web server: A web server is basically a computer that stores web pages and dispenses them as HTTP responses when it receives HTTP requests from the client. All the website that you want to access on the internet is running somewhere on the server. That is the reason you can access those websites and retrieve information frequently. Whenever you type in a URL in the browser and press enter, the webserver receives an HTTP or HTTPS request. It will retrieve the information needed and send it to the browser as HTML, images, or any file to render.</p>
</li>
<li><p>Application server: An application server performs more work than the web server; it provides dynamic content and executes application-specific logic. Whenever a web server receives an HTTP request, it processes it to determine the type of response it requires. If it is static content the web server handles it directly. However dynamic content, the web server forwards the request to an application server for processing. The application executes the server-side code, processes the request, and returns the response to the server, which, in turn, sends it to the browser as an HTTP response.</p>
</li>
</ol>
<p>When you search for dynamic content in a web browser such as <a target="_blank" href="https://www.google.com/books/django-4.0"><code>https://www.google.com/books/django-4.0</code></a>, the webserver will receive it and determine if it is static or dynamic. Then it will send it to the application server to process and send the information as an HTTP response to it, which is subsequently sent to the browser for display.</p>
<ol>
<li>Database: A database can be called an electronic database because it is a structured collection of data or information that is stored electronically, and the data or information can be easily searched and retrieved. A database management system is software that manages the database, such as MySQL, Oracle, SQLite, PostgreSQL, and so on.</li>
</ol>
<p>Let me now demystify how the database works with the application server.</p>
<p>When the application server receives a dynamic content request from the web server, if the content required is in the database, the application server sends a request to the database. The database processes the query and retrieves the requested data. The requested data can be in the form of an HTML page, JSON, or other format, it will now return it to the application server, which returns to the web server, and subsequently to the browser to render.</p>
<ol>
<li>Rendering a web page: When the client sends a request to the web server or application server to retrieve specific data or information, the HTTP response received will be in the form of HTML, CSS, JavaScript, or any other format. The HTML will structure the web page, the CSS will style the web page by adding colors and arranging text with the appropriate fonts, and the javascript will make the web page dynamic and interactive. This enables actions like redirecting or opening other pages when the user clicks on links within the page.</li>
</ol>
<h4 id="heading-this-diagram-explains-the-flow-of-data">This diagram explains the flow of data.</h4>
<p><img src="https://drive.google.com/file/d/1c7gqWA8iEEWzTI4RPSVp6AN33D3dwRgh/view?usp=sharing" alt="Data flow diagram" /></p>
]]></content:encoded></item><item><title><![CDATA[How To Install Python on Windows]]></title><description><![CDATA[Python is a high-level programming language that can be used for different operations like scripting, automation, back-end development, data science, and…]]></description><link>https://hackeuc.hashnode.dev/how-to-install-python-on-windows</link><guid isPermaLink="true">https://hackeuc.hashnode.dev/how-to-install-python-on-windows</guid><category><![CDATA[Python]]></category><category><![CDATA[software development]]></category><category><![CDATA[programming]]></category><category><![CDATA[backend]]></category><dc:creator><![CDATA[Uchechukwu Ezeibe]]></dc:creator><pubDate>Mon, 24 Jul 2023 16:28:22 GMT</pubDate><content:encoded><![CDATA[<p>Python is a high-level programming language that can be used for different operations like scripting, automation, back-end development, data science, and data analysis.</p>
<p>This article will take you step by step on how to install Python on Windows.</p>
<h3 id="heading-there-are-two-ways-to-install-python-on-windows">There are two ways to install Python on Windows</h3>
<ol>
<li><p>From Microsoft Store</p>
</li>
<li><p>From <a target="_blank" href="https://www.python.org/downloads/windows/">Python official site</a></p>
</li>
</ol>
<h3 id="heading-how-to-install-python-from-microsoft-store">How to install Python from Microsoft Store</h3>
<ol>
<li><p>Go to your <strong>Start</strong> on your PC and search for <strong>Microsoft Store</strong>, click on it, and open it.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690215040101/a9667ea2-2b6d-4326-a7ac-c73d5450ffc5.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Search for <strong>Python3</strong> which is the latest version of python</p>
</li>
<li><p>Click on Python3.11 to open it, then click on <strong>Get</strong> to install. With this method, Python will install automatically on your computer.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690215123042/f2e4accb-c328-4ae5-9786-3a8e44e7c9ce.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>To check if Python has successfully been installed on our computer. Go to Start and type command prompt. Open the command prompt and run this command. <code>python --version</code>, it will print the version of Python installed on your computer.</p>
</li>
</ol>
<h3 id="heading-how-to-install-from-python-official-sitehttpswwwpythonorgdownloadswindows">How to Install from <a target="_blank" href="https://www.python.org/downloads/windows/">Python official site</a></h3>
<ol>
<li><p>Go to <a target="_blank" href="https://www.python.org/downloads/windows/">python official download site</a></p>
</li>
<li><p>Look for the Python 3 current release for Windows. This article was tested with Python 3.11.4</p>
</li>
<li><p>Choose the correct link for your computer. Windows installer (64-bit) or Windows installer (32-bit), if you don’t know your system type download Windows installer (64-bit).</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690215196294/0ce9956d-820b-4109-912b-9a7bd7773153.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Click on the Download Windows Installer (64-bit)</p>
</li>
<li><p>After downloading, double-click and open the downloaded file which is python-3.11.4-amd64.exe. It will start installing, also make sure you have an internet connection while installing it.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690215232220/8f94297c-9738-4f5f-88f5-04057c39d028.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>To check if Python has been installed on your computer, Open your command prompt or any terminal and type <code>python --version</code>, It will print the version of Python installed on your computer.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690215261090/9622cec2-ed82-4582-b696-1e47a78b5a64.png" alt class="image--center mx-auto" /></p>
<p> Good luck you have successfully installed Python.</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Secure File Transfer Protocol (SFTP)]]></title><description><![CDATA[secure-file-transfer-protocol-sftp]]></description><link>https://hackeuc.hashnode.dev/secure-file-transfer-protocol-sftp</link><guid isPermaLink="true">https://hackeuc.hashnode.dev/secure-file-transfer-protocol-sftp</guid><category><![CDATA[SFTP]]></category><category><![CDATA[ssh]]></category><category><![CDATA[server]]></category><category><![CDATA[Alx]]></category><category><![CDATA[# Command line for the win]]></category><dc:creator><![CDATA[Uchechukwu Ezeibe]]></dc:creator><pubDate>Wed, 12 Jul 2023 21:42:32 GMT</pubDate><content:encoded><![CDATA[<p>Secure File Transfer Protocol is a network protocol for securely accessing, transferring and managing large files and sensitive data.</p>
<h3 id="heading-how-to-use-sftp">How to use SFTP</h3>
<ol>
<li><p>open a command line terminal</p>
</li>
<li><p>type sftp "username@hostname"</p>
</li>
</ol>
<h2 id="heading-example">Example:</h2>
<p><code>sftp 407939ef5a69@407939ef5a.09417.alxcode</code></p>
<h3 id="heading-sftp-commands">sftp commands</h3>
<ol>
<li><p>ls - lists the files in the remote directory</p>
</li>
<li><p>lls - lists the files in your local machine</p>
</li>
<li><p>pwd - prints the remote server working directory</p>
</li>
<li><p>lpwd - prints the local working directory</p>
</li>
<li><p>cd - changes the remote working directory</p>
</li>
<li><p>lcd - changes directory in your local machine</p>
</li>
<li><p>mkdir - to create a directory on the remote server</p>
</li>
<li><p>lmkdir - to create a directory on the local machine</p>
</li>
<li><p>bye - to end the sftp prompt</p>
</li>
<li><p>put - put is used to upload files from the local machine to the remote server</p>
</li>
</ol>
<p><code>put filename</code></p>
<ol>
<li>mput - mput is used to upload multiple files from the local machine to the remote server</li>
</ol>
<p><strong>Example: upload all files that end with .txt from the local machine to the remote server</strong></p>
<h3 id="heading-mput-txt"><code>mput *.txt</code></h3>
<ol>
<li><p>get - get is used to download files from the remote server to the local machine</p>
<p> <code>get filename</code></p>
</li>
<li><p>mget - mget is used to download multiple files from the remote server to the local machine</p>
</li>
</ol>
<p><strong>Example: download all files that end with .txt from the remote server to local machine</strong></p>
<p><code>mget *.txt</code></p>
]]></content:encoded></item></channel></rss>