Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 Craftyjs 中模拟实体的速度。我目前正在制作一个简单的乒乓球游戏,需要将球“推”下,我不能让它每帧都增加它的 y 值,因为我没有'不知道怎么做循环。
您需要绑定一个“EnterFrame”事件。样本:
ball.bind('EnterFrame', function(){ this.x += velocityX; this.y += velocityY; });