logo
By Lawrence

5 minutes

Drive the Ship

Lesson 1 gave you a lit, top-down arena with three purple walls and nothing to do in it. A shooter needs something you can steer. Press W and the capsule slides north — aiming and firing come next lesson, and right now the job is move.

Add the Player to the scene

You add one new entity, Player, next to the lights, camera, floor, and cover from Lesson 1. Paste it into your scene JSON exactly as the arena ships it:

"Player": {
  "tags": ["player"],
  "components": {
    "MeshPrimitive": {
      "primitive": "capsule",
      "radius": 0.5,
      "height": 1.6,
      "position": [0, 0.8, 0],
      "material": { "diffuseColor": [0.3, 0.85, 0.95], "emissiveColor": [0.05, 0.2, 0.3] }
    },
    "Shadow": { "castShadow": true, "receiveShadow": false },
    "TwinStickShooter": {
      "speed": 7,
      "fireRate": 14,
      "bulletSpeed": 36,
      "bulletLifetime": 1.4,
      "bulletSize": 0.55,
      "bulletRadius": 0.4,
      "bulletColor": [1.0, 0.95, 0.35],
      "arenaHalfWidth": 18.5,
      "arenaHalfDepth": 18.5,
      "muzzleFlash": true,
      "muzzleFlashSize": 0.9,
      "muzzleFlashLifetime": 0.07
    },
    "Health": {
      "hp": 5,
      "maxHp": 5,
      "invulnSeconds": 0.6,
      "respawnPosition": [0, 0.8, 0]
    }
  }
}

The ship is a glowing cyan capsule — no GLB, no rigging, just a MeshPrimitive that casts a shadow onto the floor. The tags: ["player"] line is load-bearing: the ArcCamera you placed in Lesson 1 has target: "Player", so the moment this entity exists the overhead view locks onto it and follows.

TwinStickShooter has about a dozen settings, but only three do anything today: speed, arenaHalfWidth, and arenaHalfDepth. The fire settings, like fireRate, bulletSpeed, and muzzleFlash, sit unused on the component until Lesson 3 wires up the arrow keys. Health comes along too. Nothing touches it until enemies arrive in Lessons 6 and 8.

Continue reading

Unlock the Full Course

Every lesson, the runnable examples, and the finished build — yours to keep.

$9one-time

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search