所以我尝试使用import pandas as pd
df.loc[pd.IndexSlice[:, 'bbb'], :]
(以前是Gdx.input.isKeyPressed
)来获取输入并将屏幕上的2D播放器移动到这样:
InputProcessor
运动按照预期,对角线也是如此。但出于某种原因,只要玩家向向上移动,向下并向左或向下和向右移动private void handleInput(float delta) {
if(Gdx.input.isKeyPressed(Input.Keys.UP))
moveTo(new Vector2(0, -speed * delta));
if(Gdx.input.isKeyPressed(Input.Keys.DOWN))
moveTo(new Vector2(0, speed * delta));
if(Gdx.input.isKeyPressed(Input.Keys.LEFT))
moveTo(new Vector2(-speed * delta, 0));
if(Gdx.input.isKeyPressed(Input.Keys.RIGHT))
moveTo(new Vector2(speed * delta, 0));
if(Gdx.input.isKeyJustPressed(Input.Keys.SPACE))
attack();
}
函数因某些原因无法召唤。这是否与可以同时按下和处理的有限数量的键有关?