壁・床を作る

オブジェクトに力を加える

その1

vx, vyに速度(1フレームあたりのピクセル数)を直接設定する

Ball
extends BodyActor;

shape="circle"; while(true) { if (getkey("left")) vx=-3; if (getkey("right")) vx=3; update(); }

その2

applyForceまたはapplyImpulseを使う

Ball
extends BodyActor;

shape="circle"; while(true) { if (getkey("left")) applyForce(-10,0); if (getkey("right")) applyForce(10,0); update(); }

参照

.