Deviant Login Shop  Join deviantART for FREE Take the Tour
×



Details

Submitted on
January 30, 2008
Image Size
8.9 KB
Resolution
800×600
Thumb

Stats

Views
2,160
Favourites
12 (who?)
Comments
10
Downloads
35
×
I have finally finished the physics/collision detection engine for platform games. If you see any real problems in the system let me know. I want to make sure it works before using it.

I added a gravity modulator. You can change the direction of the gravity to see that the physics doesn't depend on it.

Finally, before you look for errors I'd like to point out 2 things that you may find unusual, don't report them:
1- On some surfaces the ball bounces. These are "non-floor" surfaces and they slightly repel the ball to avoid a few mistakes (Like sticking to the surface, even against gravity).
2- You will not be able to jump on "non-floor" surfaces. They are supposed to be walls or ceilings in normal gravitational conditions and are not meant to have an effect on jumping.

As usual, the control keys are A/D for left and right motion and the space bar for jumping. Well, that's it. Hopefully I'll be making games with this soon enough. I hope you enjoy this.
Add a Comment:
 
:iconsobeita:
Sobeita Featured By Owner Feb 17, 2009  Hobbyist Digital Artist
Is your MC interacting with every particle in that curve? If it is, I think it would probably be better to hide those (0% alpha) and draw a solid curve in its place to fool the user.
Also, perhaps the user's keyboard controls could adjust depending on the angle of gravity, so that the up key makes a force parallel to N.
Reply
:iconmaximohoundoom:
Maximohoundoom Featured By Owner Feb 18, 2009
This physics engine is outdated. It works slowly and has glitches. The controls are not really part of it, I made them just to move the ball around the screen, so I didn't work much on them.

All of the surfaces were drawn in real time with actionscript, using the code of the platform's properties. My intention was to mark out the shape of the platforms based on their structure - for programming and debugging purposes only. So hiding them and covering them with a new movieclip would be pointless.

Mostly, this was just another one of my failed experiments which I will never use or look at again. I may build a new physics system in the future when I have more time. In theory, the system should work approximately 100 times more efficiently than this one and also better.
Reply
:iconsobeita:
Sobeita Featured By Owner Feb 18, 2009  Hobbyist Digital Artist
Ooh... kay. That's what scraps are for.
Reply
:iconanusbeeflol:
AnusBeefLOL Featured By Owner Aug 28, 2008
Interesting, but the acute angle on the floating trapezoid seems to shift the player downward. I'd recommend having it ensure that the player stays above the angle, not below it, since they hit the corner and effectively fall right through.
Reply
:iconmaximohoundoom:
Maximohoundoom Featured By Owner Aug 28, 2008
Unfortunately, this type of physics engine is too unefficient to be used or even modified anymore. It does nearly 100 more operations more than the necessary to detect collisions. I'd have to make a new one from scratch to reduce the processing cost and to fix the errors this one has. I had a plan to make a new physics engine, but I haven't yet began to work on it.
Reply
:iconanusbeeflol:
AnusBeefLOL Featured By Owner Apr 15, 2010
Hey, it's cool.
Reply
:icontalosat:
TalosAT Featured By Owner Feb 6, 2008
Its looking great so far- the only complaint I have is that when you change the Gravity your jumping direction doesn't change
Reply
:iconmaximohoundoom:
Maximohoundoom Featured By Owner Feb 6, 2008
Well, the floor type of each surface determines whether you can jump on it or not. I did not make dinamically changing floor types in this document, so when the gravity changes, jumping remains fit for downward gravity. I had plans to make a special type of tile that changes with certain conditions, but for now I won't be doing it, I have other plans that require more attention now.
Reply
:icontalosat:
TalosAT Featured By Owner Feb 6, 2008
Ahhh allrighty, still a game with situational gravity would be pretty nifty :D
Reply
:iconsophiehoulden:
SophieHoulden Featured By Owner Jan 31, 2008  Professional General Artist
its looking good, but like you say it runs really slow.

only issue I noticed is that for a ball it has an amazing ability to balance on a corner =p
Reply
Add a Comment: