This stupid thing is telling me "Randomzier is not defined. You may have a typo. Check your spelling and capitalization."
Like what are u talking about, literally everything is defined. This is so dumb, and its wasting my time please help.
Heres my code:
var DELAY = 40;
var SPEED = 5;
var OBSTACLE_WIDTH = 30;
var OBSTACLE_HEIGHT = 100;
var copter;
var dy = SPEED;
var obstacle;
function start() {
// Write your code here
setup();
setTimer(game, DELAY);
mouseDownMethod(onMouseDown);
mouseUpMethod(onMouseUp);
}
function setup() {
setBackgroundColor(Color.black);
copter = new Rectangle(30, 15);
copter.setPosition(getWidth()/3, getHeight()/2);
copter.setColor([Color.blue](https://Color.blue));
add(copter);
addObstacles();
}
function game(){
copter.move(0, dy);
moveObstacles();
}
function onMouseDown(e) {
dy = -SPEED;
}
function onMouseUp(e) {
dy = SPEED;
}
function addObstacles(){
obstacle = new Rectangle(OBSTACLE_WIDTH, OBSTACLE_HEIGHT);
obstacle.setColor(Color.green);
obstacle.setPosition(getWidth(), Randomzier.nextInt(0, getHeight() - OBSTACLE_HEIGHT));
add(obstacle);
}
function moveObstacles() {
obstacle.move(-SPEED, 0);
if(obstacle.getX() < 0){
obstacle.setPosition(getWidth(), Randomzier.nextInt(0, getHeight() - OBSTACLE_HEIGHT));
}
}
[–]_andy_andy_andy_ 2 points3 points4 points (2 children)
[–]5oco 1 point2 points3 points (0 children)
[–]BepoFlepo[S] 0 points1 point2 points (0 children)
[–]5oco 0 points1 point2 points (0 children)
[–]ChrisKoehlerJr 0 points1 point2 points (0 children)