TalentJR apps
Fly the rocket and shoot the aliens before they reach you. Play it first, then open it in the Game Studio and change it until it is your own game.
🎮 Controls: ← → to fly · SPACE to fire
At the top of the code are the settings — change one, run the game, and feel the difference. This is how game designers balance a game.
let shipSpeed = 320 | |
let laserSpeed = 600 | |
let alienSpeed = 120 | |
let alienEvery = 1.2 | A new alien every … seconds |
let alienPoints = 10 | |
let alienShootsEvery = 2 | An alien fires at you every … seconds |
let startLives = 3 |
Try them in order. The studio ticks each one off when your change works — and shows a hint if it does not.
let shipSpeed = 480let laserSpeed = 900let alienEvery = 0.6let alienSpeed = 200let alienPoints = 25if (score.value >= 100) {
tj.victory("You saved the planet!")
}tj.timer(60, () => tj.victory("You survived!"))let alienShootsEvery = 453 lines of real JavaScript, made with TalentJR Game Studio's game library. Lines that start with // explain what the next part does.
// 🚀 Space Shooter — TalentJR Game Studio
// ✏️ Change these numbers, then press ▶ Run!
let shipSpeed = 320
let laserSpeed = 600
let alienSpeed = 120
let alienEvery = 1.2 // a new alien every … seconds
let alienPoints = 10
let alienShootsEvery = 2 // an alien fires at you every … seconds
let startLives = 3
tj.setup({ background: "space" })
tj.touchControls("shooter")
const ship = tj.player({ sprite: "rocket", x: 296, y: 410, speed: shipSpeed, mode: "leftright" })
const score = tj.score()
const lives = tj.lives(startLives)
// Fire with SPACE (or the A button)
tj.onAction("fire", () => {
tj.shoot(ship, { speed: laserSpeed })
})
// Aliens come down from the top
loop(alienEvery, () => {
tj.spawn("alien", { x: rand(0, width() - 48), y: -48, dir: "down", speed: alienSpeed, tag: "alien" })
})
// A laser hits an alien
onCollide("laser", "alien", (laser, alien) => {
destroy(laser)
destroy(alien)
addKaboom(alien.pos)
score.add(alienPoints)
})
// An alien hits the ship
ship.onCollide("alien", (alien) => {
destroy(alien)
lives.lose()
})
// Aliens shoot back!
loop(alienShootsEvery, () => {
const aliens = get("alien")
if (aliens.length > 0) {
tj.shoot(choose(aliens), { dir: "down", speed: 300, colour: [248, 113, 113], tag: "alienLaser" })
}
})
ship.onCollide("alienLaser", (laser) => {
destroy(laser)
lives.lose()
})
🎯 Slime BlasterGuard the fence: move the robot, blast the slimes marching in — big ones need 3 hits.
🔫 Jungle CommandoAn 8-bit run-and-gun: shoot in 8 directions, beat the guard-bots and the tank-bot boss.
🛸 Space Shooter 8-bitAlien bots in formation dive and shoot — grab the double shot and beat the mothership.
🏃 Coin Run — your first gameType your first game yourself in 7 short missions — every line explained.
🏏 CricketTime your swing for a SIX, a FOUR or a run — and chase the target before you are all out.
🏎️ Retro RacingDodge the traffic on a scrolling road — change the speed, the cars and the road colour.