我正在用Paper.js制作一个小型射击游戏,但是我无法找到Paperscript提供任何方法来获得我的一组项目的当前轮换.
在下面的代码中,使用Q和E键旋转"circlegroup"应该影响WASD导航,将项目移动到对象的"鼻子"当前指向的方向.我想我需要获取项目的当前轮换以影响导航.Paper.js提供了任何方法吗?
bigcircle = new Path.Circle({
radius:10,
fillColor: 'grey',
position: (10, 20),
selected: true
});
smallcircle = new Path.Circle({
radius:5,
fillColor: 'black'
});
var circlecontainer = new Group({
children:[smallcircle, bigcircle],
position: view.center
});
var circlegroup = new Group({
children: [circlecontainer]
});
function onKeyDown(event) {
if(event.key == 'w') {
circlegroup.position.y -= 10;
}
if(event.key == 'a') {
circlegroup.position.x -= 10;
}
if(event.key == 's') {
circlegroup.position.y += 10;
}
if(event.key == 'd') {
circlegroup.position.x += 10;
}
if(event.key …Run Code Online (Sandbox Code Playgroud)