0
How in SoloLearn do you make something on the screen?
Exactly what is in the question. How? Before I started SoloLearn I used Khan Academy which only reached JavaScript, SQL, and HTML (modified versions) but in JS you could make games, pictures, animations, etc, thanks to the abilaty of having a 'screen' and you could use commands to make like a rectangle (rect(20, 20,50,60); this is a example) and get the mouse position and what keys are you pressing. Println and Print also existed. Is there a way to do similar things using SoloLearn?
3 ответов
+ 2
there isn't any built in functions for drawing onto the screen. you have to use the traditional HTML5 canvas api and use JS to manually draw onto it. Khan academy uses p5.js which is a library for easy access to the canvas pi. example code for drawing on canvas.
// html
<canvas id="c"></canvas>
// js
var c=document.getElementById("c");
var ctx=c.getContext("2d");
ctx.fillStyle="red";
ctx.fillRect(0,0,20,20);
+ 1
you can but you have to write a little more code than KA. here are some canvas games i wrote.
https://code.sololearn.com/WepRF9qPrz8o/?ref=app
https://code.sololearn.com/WZySiHg19jde/?ref=app
0
So you can't on SoloLearn?