-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CollisionObject2D Guide #13
Comments
When I explain the four node types I draw a two-by-two-matrix on the board:
There's two nodes for objects that are moving in the physics world (RigidBody and KinematicBody) and two for objects that don't move or where the movement isn't affected by physics (StaticBody and Area). So for example in a game of pong I would use a RigidBody for the ball, because its movement is physically "correct", so there's no reason for me to rewrite it when the RigidBody has all it needs to perform linear movement and reflect the ball from the paddles. On the other hand if I was moving a player around traps I would be using KinematicBody for the player and Area for the traps, because the player will move according to joystick or keyboard input and I want to be able to ask whether movement is possible or not, and because the location of the traps' trigger areas is not affected by the physics engine, but it may be affected by script code, for example when a trap is animated (like a view cone from an enemy). |
I love this! |
I've also volunteered to write a guide to the various CollisionBody2D objects - what they're for, what they're not for, etc.
Suggestions welcome for tips, details, examples - anything that might be helpful. One goal is to discourage the inappropriate use of RigidBodies (something I've seen frequently by beginners).
The text was updated successfully, but these errors were encountered: