Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <head>
	<meta charset="utf-8">
	<img id="frehhrerh" src="https://sun9-25.userapi.com/impf/aEbHY9hSBdbqDNSt4qNmpdwVaXmgRKVPt0f-9g/x3l8uAgU-vg.jpg?size=64x148&quality=96&proxy=1&sign=e745529b30f7fe2791824bd063b0d26a&type=album" style="opacity: 0;">
<style type="text/css">
	

body {
	background: #000;
}

</style>
</head>

<div id="ergreherh" title="" dir=""></div>

<canvas id="ca" height="5000px;" width="5000px" ></canvas>
<script type="text/javascript">



	var elemente = document.getElementById("ca");
	var ctx = elemente.getContext("2d");


position_x_igrok = -1

window.onload = function() {

var objectc = {
	"tocka0": [11, 113],
"tocka1": [24, 192],"tocka2": [161, 198],"tocka3": [372, 202],"tocka4": [459, 204],"tocka5": [535, 207],"tocka6": [566, 184],"tocka7": [570, 155],"tocka8": [574, 120],"tocka9": [589, 92],"tocka10": [619, 100],"tocka11": [620, 186],"tocka12": [605, 219],"tocka13": [612, 178],"tocka14": [593, 219],"tocka15": [612, 212],"tocka16": [605, 239],"tocka17": [576, 331],"tocka18": [559, 336],"tocka19": [610, 324],"tocka20": [592, 262],"tocka21": [555, 216],"tocka22": [585, 288],"tocka23": [620, 235],"tocka24": [590, 118],"tocka25": [598, 81],"tocka26": [577, 50],"tocka27": [596, 48],"tocka28": [627, 62],"tocka29": [635, 88],"tocka30": [632, 143],

}



function canvas_ris(a) {
          ctx.fillStyle = "#000";

ctx.fillRect(0, 0, 1000, 1000)


ctx.beginPath();


  ctx.clearRect(0, 0, document.body.offsetWidth + 1000, document.body.offsetHeight + 1000);ctx.moveTo(50, 70);

    ctx.moveTo(0, 1000);

for(var i = 1; i <=30; i++) {
var key = `tocka${i}`;


       
            
          ctx.fillStyle = "#fff";

ctx.lineTo(objectc[key][0], objectc[key][1]);



}	

ctx.lineTo(objectc["tocka20"][0] - 300, objectc["tocka20"][1] + 3100);




ctx.fill()




	position_x_igrok += 0.9

for(var i = 1; i <=30; i++) {

var key = `tocka${i}`;

if(objectc[key][0] > position_x_igrok) {




var test_prohloe = `tocka${i-1}`
var proizvodnaya = (objectc[key][1] - objectc[test_prohloe][1]) / (objectc[key][0] - objectc[test_prohloe][0])

          ctx.fillStyle = "red";

ctx.save();
    







ctx.translate(position_x_igrok, objectc[test_prohloe][1] + (position_x_igrok - objectc[test_prohloe][0]) * proizvodnaya - 10, 10, 10);




var gradus = objectc[test_prohloe][0] /  (Math.sqrt(objectc[test_prohloe][0] * objectc[test_prohloe][0] + objectc[test_prohloe][1] * objectc[test_prohloe][1]))


var gggg = Math.acos(gradus) * 90 /3.14 

       ctx.rotate( gggg); // rotate square in radians



  















ctx.drawImage(frehhrerh, 0,0, 20, 40)    
    ctx.restore();

       ctx.rotate(0); // rotate square in radians








	break;

}
}







	  requestAnimationFrame(canvas_ris);



};



canvas_ris()












	}








</script>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console