問題タブ [pymunk]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
130 参照

pygame - pymunk/pygame で制約の色を変更する

私は pymunk と pygame を使用するプロジェクトに取り組んでいます。PivotJoint コンストレイントを使用して、ボディを一緒にアタッチしています。可能であれば関節を非表示にしたいのですが、これを行う方法はありますか? 現在、ジョイントは pygame で紫色に表示されており、色を変更できないようです。

ありがとう!

0 投票する
1 に答える
80 参照

python - What's causing these objects to fly to the left with pymunk?

Recently I've been trying to make a simple game with pymunk. My goal (at the moment) is for the boxes to be affected by gravity, and to 'jump' when they have their up() function called.

Here is my code.

Apologies for my informal commenting. I've tried to use simple variable names so that the code's not too hard to follow. I believe the problem is with the player class, as it controls how the squares behave. My physics knowledge is bad, and I don't really understand the concept of inertia, so if I've made a mistake relating to a fundamental concept related to physics, I'd really appreciate any explanations which could help clear up my misunderstanding. This is how it currently behaves.

This is how it currently behaves

PS. I'm trying to teach myself pymunk/python, and have very little formal education in either of the two, so I apologise for any 'unorthodox' code, hopefully it's not too hard to follow.

Thanks :)