3/9/2023 0 Comments Chipmunk basic tutorialIf you look at the diagram, you'll notice that the three differences between these coordinate systems are: 1) y+ DOWN (vs) y+ UP 2) positive rotation clockwise (vs) positive rotation COUNTER-clockwise 3) 0 is UP (vs) 0 is RIGHT Points (1) and (2) are linked. (In particular, the tutorial seems to use y+ DOWN, so I have illustrated both.) In fact, specifying y+ DOWN may make combining Gosu and Chipmunk more straightforward. I prefer to think of the positive direction of the Y-Axis as being "up", but you could interpret that data as "down" if you wanted to. It does not really specify how data is to be visualized. However, you can interpret the data from Chipmunk in various ways. That's rather definitive (though, like most things in programming, you could alter it if you really wanted). The illustration of Gosu's coordinate system is how the Gosu window is set up. The second post (right under this one) uses this information to answer your questions. (Hopefully I'll compile this info along with some other stuff into a proper Chipmunk tutorial when I have more free time) This first part is an explanation of how coordinate systems are relevant to this problem. This is the first time I've tried explaining the notion of coordinate systems. I certainly struggled with it myself when I was getting started. This is something that the current tutorial does not explain very well at all. The problems you describe in #2 and #3 have to do with differences in coordinate systems. Sensors only call collision callbacks, and never generate real collisions.") for all the sprites and just bother for collision functions between those who should interact ? I know those questions should sounds totally basics to people used to chipmunk, but as a beginner, I found the documentation and tutorials quite opaque. that are game logic, and not to use chipmunk physics calculations, couldn't we simply set "nsor" to true (As the documentation of chipmunk says "sensor – true or false: A Boolean value if this shape is a sensor or not. As the game uses collisions only to take actions like killing sprites, increasing scores etc. The exemple use :star, &nil)" to tell stars not to collide with each other. Is it a reason for that, or could we start from whatever vertex we want, as long as we keep going counter-clockwise ? 4. I search other tutos/forums speaking of that point, and it seems to always start with the bottom-left then going counter-clockwise. Still about defining shape, the first vector defines the bottom-left vertex. with the "top" on the top, so I don't understand. Talking about creating shape, the example says "You need to define the vectors so that the "top" of the Shape is towards 0 radians (the right)" but then, the vectors are defined forming a triangle fitting the image of the ship exactly like it is, i.e. Wouldn't it be better/more logic to create a body and a shape in the constructor of the sprite object than in the MainWindow constructor? 2. And the example/tutorial given with gosu left me quite perplex about certain things : 1. Hi ! I came back to gosu, and try for the first time to use chipmunk in order to help me to detect collision (developing a very basic shmup, just to see if I can do it).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |