Make games on your phone.
Get the app!
AndroidiOS
Castle
4 Comments
Next up
#mergetocreate
ADDING MORE NEW STUFF HIT 1K PLAYS FOR MORE DAILY UPDATES
fire1Reply
this is literally the kit but only two recipes
fire1Reply
const canvas = document.getElementById('gameCanvas'); const ctx = canvas.getContext('2d'); canvas.width = 800; canvas.height = 600; class Player { constructor() { this.x = canvas.width / 2; this.y = canvas.height / 2; this.size = 30; this.color = 'blue'; this.speed = 5; this.score = 0; } draw() { ctx.fillStyle = this.color; ctx.fillRect(this.x, this.y, this.size, this.size); } update() { if (keys['ArrowUp']) this.y -= this.speed; if (keys['ArrowDown']) this.y += this.speed; if (keys['ArrowLeft']) this.x -= this.speed; if (keys['ArrowRight']) this.x += this.speed; this.x = Math.max(0, Math.min(canvas.width - this.size, this.x)); this.y = Math.max(0, Math.min(canvas.height - this.size, this.y)); } } class Item { constructor() { this.size = 20; this.x = Math.random() * (canvas.width - this.size); this.y = Math.random() *
Reply
Heh?
Reply