fix syntax

This commit is contained in:
2026-02-17 09:15:15 -06:00
parent f310c18b84
commit 4e1b63fd0e
52 changed files with 2169 additions and 1754 deletions

View File

@@ -13,7 +13,8 @@ var bunnyTex = graphics.texture("bunny")
var bunnies = []
// Start with some initial bunnies:
for (var i = 0; i < 100; i++) {
var i = 0;
for (i = 0; i < 100; i++) {
push(bunnies, {
x: random.random() * config.width,
y: random.random() * config.height,
@@ -25,8 +26,10 @@ for (var i = 0; i < 100; i++) {
this.update = function(dt) {
// If left mouse is down, spawn some more bunnies:
var mouse = input.mousestate()
var i = 0;
var b = null;
if (mouse.left)
for (var i = 0; i < 50; i++) {
for (i = 0; i < 50; i++) {
push(bunnies, {
x: mouse.x,
y: mouse.y,
@@ -36,8 +39,8 @@ this.update = function(dt) {
}
// Update bunny positions and bounce them inside the screen:
for (var i = 0; i < length(bunnies); i++) {
var b = bunnies[i]
for (i = 0; i < length(bunnies); i++) {
b = bunnies[i]
b.x += b.vx * dt
b.y += b.vy * dt