我找到了这个看起来像javascript的代码,但我不确定它是什么类型的语言。
我是从名为Khan Academy
的网站上获得的当我在javascript控制台中运行它时,它没有运行
noStroke();
//variables
var cloud1a = 365;
var cloud1b = 340;
var cloud1c = 320;
var cloud1d = 340;
var cloud2a = 225;
var cloud2b = 170;
var cloud2c = 200;
var cloud2d = 200;
var cloud3a = 35;
var cloud3b = 60;
var cloud3c = 80;
var cloud3d = 55;
var fast = 0.3;
var draw = function() {
background(168, 246, 250);
//clouds
fill(255, 255, 255);
ellipse(cloud1a,45,60,50);
ellipse(cloud1b,45,60,50);
ellipse(cloud1c,45,60,50);
ellipse(cloud1d,25,50,50);
ellipse(cloud2a,45,60,50);
ellipse(cloud2b,45,60,50);
ellipse(cloud2c,45,60,50);
ellipse(cloud2d,25,50,50);
ellipse(cloud3a,45,60,50);
ellipse(cloud3b,45,60,50);
ellipse(cloud3c,45,60,50);
ellipse(cloud3d,25,50,50);
if (cloud1a > 418) {
cloud1a = 0;
}
if (cloud1b > 418) {
cloud1b = 0;
}
if (cloud1c > 418) {
cloud1c = 0;
}
if (cloud1d > 418) {
cloud1d = 0;
}
if (cloud2a > 418) {
cloud2a = 0;
}
if (cloud2b > 418) {
cloud2b = 0;
}
if (cloud2c > 418) {
cloud2c = 0;
}
if (cloud2d > 418) {
cloud2d = 0;
}
if (cloud3a > 418) {
cloud3a = 0;
}
if (cloud3b > 418) {
cloud3b = 0;
}
if (cloud3c > 418) {
cloud3c = 0;
}
if (cloud3d > 418) {
cloud3d = 0;
}
cloud1a += fast;
cloud1b += fast;
cloud1c += fast;
cloud1d += fast;
cloud2a += fast;
cloud2b += fast;
cloud2c += fast;
cloud2d += fast;
cloud3a += fast;
cloud3b += fast;
cloud3c += fast;
cloud3d += fast;
//Dirt
fill(36, 1, 1);
rect(0,340,400,61);
//Grass
fill(75, 186, 6);
rect(0,340,402,5);
//sun
fill(255, 213, 0);
ellipse(10,10,140,140);
//ball
fill(255, 0, 0);
ellipse(30, 315, 50, 50);
//title
fill(240, 36, 0);
textSize(20);
text("Baucing ball: The Game",117,40);
fill(0, 0, 0);
textSize(10);
text("Created by: Cristian Torres & Israel Jimenez",120,55);
};