Lonely Elephant

A gentle adventure about friendship, growth, and discovery. Choose your animal and explore in 2D or 3D.

Promotional image of Lonely Elephant Game

Lonely Elephant is a browser game about roaming, growing, and making friends. You move with WASD or by clicking, eat trees to grow, and attract birds that follow you on the journey. The full playable suite lives on thelonelyelephant.com — this page is the teaching companion: what the game is, how the versions differ, and how you can build something similar yourself.

Lonely Elephant sits in a bigger catalog on andyharner.com/games (AI crabs games, preserved Flash experiments, HTML5 drawing app). See the Games Hub for links and the short development timeline.

Core gameplay loop

Explore

Move with WASD or click. Roam freely and discover new friends.

Grow

Eat trees to grow bigger and attract friendly birds.

Connect

Make friends with birds that follow you on your journey.

Playable versions

The live site ships several builds of the same idea, so you can compare a simple canvas loop with a fuller 3D RPG — and even an AI-assisted world.

2D Version

Classic top-down play. Move, eat trees, and make friends with birds.

Play 2D

3D Version

Immersive 3D world. Choose your animal and roam a vibrant landscape.

Play 3D

3D RPG

Collect birds, learn attacks, unlock areas, and save/load with a shareable code.

Play 3D RPG

AI 3D RPG

Type prompts that reshape the 3D world with a free AI backend and local fallback.

Play AI 3D RPG

There is also a separate Puzzle AI Games section (gene & color puzzles) linked from the main Lonely Elephant site.

How this game was made (web edition)

Lonely Elephant is built as a web game: HTML for structure, CSS for style, and JavaScript for the loop — with Three.js for the 3D builds. The site and game were developed with AI assistance. Below is a compact teaching outline; the longer walkthrough is on the Lonely Elephant site.

1. Plan a tiny fun loop

2. Code in small modules

// Simple growth-on-collect idea (pseudocode style)
function eatTree(tree, player, birds) {
  removeFromWorld(tree);
  player.size *= 1.25;
  if (player.treesEaten % 3 === 0) {
    birds.push(spawnBirdNear(player));
  }
}
        

3. Art & animation

4. Add features gradually

// Example: unlocking a modular bird attack
attacks.push({
  name: "Tornado Bird",
  description: "Birds spin and create a whirlwind!",
  unlockLevel: 10,
  effect: function (enemy) {
    enemy.stunned = true;
  }
});
        

5. Useful resources

Try it yourself

Play a version, then open the tutorial and recreate one small piece — movement, tree collection, or a following bird. That “one feature at a time” approach is how Lonely Elephant grew from a simple 2D canvas loop into 3D, RPG, and AI experiments.