![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 5 Pomógł: 0 Dołączył: 15.11.2010 Ostrzeżenie: (0%) ![]() ![]() |
Witam chciałem napisać mini grę w której chodziło by o kliknięcie w kwadracik, w danym przedziale na łuku.. I wtedy zliczała by to jako punkt i wyswietlało ile mamy punktów. Na razie mam cos takiego ale nie wiem jak zabrać się za ruch kwadracika (IMG:style_emoticons/default/sad.gif)
Kod <!DOCTYPE HTML>
<html> <head> </head> <body> <script> var i=0; document.write(i); </script> <canvas id="example" width="550" height="250"> Twoja przeglądarka nie obsługuje elementu Canvas. </canvas> <script> function katToRadians(kat) { return radians = (Math.PI/180)*kat; } var example = document.getElementById('example'); var context = example.getContext('2d'); var context2 = example.getContext('2d'); context.fillStyle = "rgb(255,0,0)"; context.fillRect(45, 194, 10, 10); example.onclick = function() {alert('Click'+i);i++;}; context.arc(200,200,150,katToRadians(0),katToRadians(180),true); context.stroke(); </script> </body> </html> |
|
|
![]() ![]() |
![]() |
Aktualny czas: 4.10.2025 - 11:36 |