Author
Topic: Physics2D (Read 15235 times)

1. I'm using Physics2D.Net, not Box2D, and as far as I know, Physics2D.Net doesn't have a ground object. However, I might be able to create a dummy object with infinite mass that ignores collisions and anchor the joint to that.2. The problem is, I kind of had to choose between SGDK2 physics and 3rd-party physics. I don't think mixing them works well. I guess I didn't try, but if I leave the platforms out of the physics engine's model, then I have to figure out how to tell sprites that are in the model to position and move themselves like they are still using SGDK2 physics. I need to develop new logic to decide what happens, for example, when a sprite hits another sprite that is riding the platform. I have to merge the SGDK2 physics that was telling the sprite's inertia to follow that of the platform with the 3rd party physics that is telling the sprite to move away (and probably even rotate!) as a result of being hit. It's too hard to use 2 physics engines, I think, so I just throw everything into the physics engine and it all takes care of itself for the most part. I just need to figure out how to manipulate things via the physics engine instead of directly. I have toyed with the thought, though, of limiting which sprites are represented in the physics engine. I think I just talked myself out of it , but it's still in the back of my mind -- having participation in realistic physics be implemented more like an additional rule instead of intrinsic to the project's "engine".

Starting to work on what might become a real game. I had an idea involving spiders, flies and webs. It's not very developed yet though. Use the arrow keys and the right Ctrl key (hold it down when near a fly)... you'll see what happens.http://sgdk2.enigmadream.com/ben/Spider.zip

Hahaha! I like it a lot! Very cute. Although the flying spider is a little weird. (Yeah, Iknow, that's not the point of this demo.) It's pretty impressive! Very simple too! Although I guess you developped the custom rules AttachTo and ReleaseWeb...

Yeah the spider will not fly in a real game. It will probably swing from webs or something. Flying was just left over from the space ship physics demo on which this demo was based, and I haven't decided how the spider should move yet. The magnetizing effect will probably go away when that goes away. I assume you're talking about the way the spider aligns (like a box) to the wall when it hits the wall. That's because the thrust that you apply to the spider is like gravity and the legs act like the corners of a box causing it to "land" on the floor, ceiling or walls that you're pushing toward. But when the spider gives up its flying engines, I think that effect will go away . If not, I can always make the spider use a circular shape instead of its actual shape. But I thought it would be cool to use the actual shape for the spiders and flies where so many games just use squares and circles.