ããã«æ°ãä»ããã®ããJavascriptã§ãã£ã©ã¯ã¿ã¼ãè§åº¦æå®ã§ã¨ããããä¸ä¸ã«åããããã«ä½æãã¦ããæã«ãä¸æ¹åããå転ãã¦ä¸æ¹åã«ç§»åããã¨ããã«ããã£ã©ã¯ã¿ã¼ã横æ¹åã«åãã¦ãã¾ã£ãããã§ãã Chromeã§ãããã°ãã¦ã¿ãã¨ãCOSã270度ã®æã«æ¬æ¥0ãæ³å®ãã¦ããã®ã«ã-1.836909530733566e-16ã¨ããå¤ãè¿ã£ã¦ããããã«ãx<0ã®æ¡ä»¶ã§ãè§åº¦ã-90度ããã¦180度ã®åãã«ãªã£ã¦ãã¾ã£ãã®ã§ãã function moveFish(no){ // 移åéãæ±ãã var rot = fish[no].ang; var sp = fish[no].speed; dx = Math.cos(rot * Math.PI / 180) * sp; dy = Math.sin(rot * Math.PI / 180) * sp; fish[no].x += dx;
{{#tags}}- {{label}}
{{/tags}}