- This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I saw these codes somewhere, and the demo showed a moving circle.
I copied the codes and quickly created an html document and pasted the codes inside thinking it is js, but it didnt run. Which language was used to do that?
var x = 20;
var speed = 3;
var draw = function() {
background(202, 255, 97);
fill(66, 66, 66);
ellipse(x, 200, 50, 50);
x = x + speed;
};
It looks like JS, you’re probably missing some library that defined those functions.
It could be:
I believe it is JS, but it’s not all of it. It would be easier to say for sure if the entire code was there. Yes, this is only a part, not the full script. It’s the size and speed of an oval being filled with color, however there is no mention of an event behavior, so maybe a possible animation of some sort…
It won’t do anything because there is no trigger, listener, event of any sort specified.
Here is the [source](http://www.khanacademy.org/cs/if-statements/836708402 “”)
Looks like it’s a series. It’d probably make more sense if you start from the first tutorial, where ever that is.
There are using this: http://processingjs.org/, as explained in some hard to find [introduction video](http://www.khanacademy.org/cs/welcome-to-computer-science/882454257)