TalentJR apps
A shooting game: guard the fence! Move the robot, blast the slimes marching in — big ones need 3 hits. Play it first, then open it in the Game Studio and change it until it is your own game.
🎮 Controls: ↑ ↓ ← → to move · 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 robotSpeed = 260 | |
let blastSpeed = 700 | |
let slimeSpeed = 70 | |
let slimeEvery = 1.4 | A new slime every … seconds |
let slimePoints = 10 | |
let bigSlimeHits = 3 | A big slime needs this many hits |
let startLives = 3 | |
let target = 150 | Points to win |
let fenceColor = [139, 94, 52] |
Try them in order. The studio ticks each one off when your change works — and shows a hint if it does not.
let robotSpeed = 400let blastSpeed = 1000let slimeSpeed = 45let slimeEvery = 0.8let slimePoints = 25let bigSlimeHits = 6let startLives = 5let fenceColor = [37, 99, 235]69 lines of real JavaScript, made with TalentJR Game Studio's game library. Lines that start with // explain what the next part does.
// 🎯 Slime Blaster — TalentJR Game Studio
// ✏️ Change these numbers, then press ▶ Run!
let robotSpeed = 260
let blastSpeed = 700
let slimeSpeed = 70
let slimeEvery = 1.4 // a new slime every … seconds
let slimePoints = 10
let bigSlimeHits = 3 // a big slime needs this many hits
let startLives = 3
let target = 150 // points to win
let fenceColor = [139, 94, 52]
tj.setup({ background: "grass" })
tj.touchControls("arrows-fire")
// The fence you defend: no slime may get past it
add([rect(8, height()), pos(130, 0), color(...fenceColor)])
const robot = tj.player({ sprite: "robot", x: 40, y: 220, speed: robotSpeed, mode: "topdown" })
const score = tj.score()
const lives = tj.lives(startLives)
// The robot stays behind the fence
robot.onUpdate(() => {
robot.pos.x = Math.max(0, Math.min(robot.pos.x, 80))
robot.pos.y = Math.max(50, Math.min(robot.pos.y, height() - 48))
})
// Fire with SPACE (or the A button): a blast flies to the right
tj.onAction("fire", () => {
add([rect(20, 6), color(250, 204, 21), pos(robot.pos.x + 44, robot.pos.y + 22), area(), move(RIGHT, blastSpeed), offscreen({ destroy: true }), "blast"])
tj.sound("pop")
})
// Slimes march in from the right. Every 5th one is BIG
let slimeCount = 0
loop(slimeEvery, () => {
slimeCount = slimeCount + 1
const big = slimeCount % 5 === 0
add([sprite("slime"), pos(width(), rand(60, height() - 60)), scale(big ? 1.1 : 0.7), area(), move(LEFT, big ? slimeSpeed * 0.7 : slimeSpeed), "slime", { hp: big ? bigSlimeHits : 1 }])
})
// A blast hits a slime
onCollide("blast", "slime", (blast, slime) => {
destroy(blast)
slime.hp = slime.hp - 1
if (slime.hp <= 0) {
destroy(slime)
addKaboom(slime.pos)
score.add(slimePoints)
if (score.value >= target) {
tj.victory("You saved the farm!")
}
}
})
// A slime gets past the fence: lose a life
onUpdate("slime", (slime) => {
if (slime.pos.x < 100) {
destroy(slime)
lives.lose()
}
})
// Every 15 seconds the slimes get faster
loop(15, () => {
slimeSpeed = slimeSpeed + 15
})
🔫 Jungle CommandoAn 8-bit run-and-gun: shoot in 8 directions, beat the guard-bots and the tank-bot boss.
🚀 Space ShooterFly the rocket and shoot the aliens before they reach you — they shoot back!
🛸 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.