Phase 5 is Complete! ๐
The final game of Phase 5 just went live on
7x.games โ a Doodle Jump clone
built from scratch with vanilla JavaScript and Next.js.
How I Built It
The core mechanic of Doodle Jump is surprisingly
tricky to get right in a browser:
The main challenges:
- Infinite upward scrolling without actually moving the character up โ instead the platforms move down
- Procedural platform generation that feels fair but gets progressively harder
- Mobile touch controls alongside keyboard support
- Enemy spawning at higher scores without making it impossible
Tech used:
Rendering โ Canvas API
Game loop โ requestAnimationFrame
Controls โ Keyboard + Touch events
Storage โ localStorage for high scores
Framework โ Next.js 14
Language โ Vanilla JavaScript
The Infinite Scroll Trick
Most beginners try to move the character upward.
The correct approach is the opposite:
// Wrong approach โ
character.y -= jumpForce
// Correct approach โ
// Keep character centered, move everything else down
if (character.y < canvas.height / 2) {
const offset = canvas.height / 2 - character.y
character.y = canvas.height / 2
platforms.forEach(p => p.y += offset)
enemies.forEach(e => e.y += offset)
score += offset * 0.1
}
This keeps the player visually centered while
the world scrolls โ much smoother and easier
to control.
Platform Generation
function generatePlatform(y) {
return {
x: Math.random() * (canvas.width - PLATFORM_WIDTH),
y: y,
width: PLATFORM_WIDTH,
type: score > 500 ? getRandomType() : 'normal'
}
}
// Types unlock progressively
// normal โ always there
// moving โ unlocks at score 200
// breaking โ unlocks at score 500
// spring โ unlocks at score 300
Mobile Controls
Desktop uses arrow keys but mobile needs
touch/tilt support:
// Touch โ tap left/right side of screen
canvas.addEventListener('touchstart', (e) => {
const touch = e.touches[0]
const midpoint = canvas.width / 2
if (touch.clientX < midpoint) {
keys.left = true
} else {
keys.right = true
}
})
// Device tilt as alternative
window.addEventListener('deviceorientation', (e) => {
if (e.gamma < -10) keys.left = true
if (e.gamma > 10) keys.right = true
})
What's Next โ Phase 6
Phase 5 is fully complete with 47 games live.
Phase 6 starts now focusing on Kids Math Games:
- โฑ๏ธ Times Table Practice
- ๐ฐ Math Bingo
- ๐ข Number Bonds
- โ Fraction Math Game
- ๐ฐ Money Math
- ๐๏ธ Roman Numerals Game
- ๐ช Cookie Clicker
- ๐ Watermelon Game (Suika Clone)
Target: 160 total games by end of roadmap.
Play All 47 Games Free
๐ฎ 7x.games โ No download.
No login. Works on mobile and desktop instantly.
๐ฝ Latest โ Doodle Jump Clone
*Building in public โ follow along as I go
from 47 โ 160 games. Feedback welcome! ๐
Top comments (0)