我正在使用p5.play.js制作项目符号,但出于某种原因,当这段代码运行时,子弹只会保持不动并且不会移动到任何地方......感谢你的帮助!
function mousePressed() {
var bullet = createSprite(player.position.x, player.position.y);
bullet.addImage(bulletImg);
bullet.life = 120;
bullet.scale = screenSize/3;
var dx = mouseX - bullet.postion.x;
var dy = mouseY - bullet.postion.y;
var angle = Math.atan2(dy, dx);
bullets.add(bullet);
bullet.setSpeed(7, angle);
}