Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

spikey82

Need help with complex shapes

This topic is 5914 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I am doing a pinball game (also see other subjects but what bothers me now is my level file format. A pinball machine has different shapes and components: valve, ramp, rebounder etc. How do i describe them naturally? (maths) The goal is also that i must can dynamicely change components, but that is very difficult for a pinball machine. so i need a solid idea. At the moment, i just have a few clues, that''s all. Any ideas are welcome, Greetings from Holland

Share this post


Link to post
Share on other sites
Advertisement
Here''s one way I defined shapes:

A shape element can be a line, an arc or a point:
A point is defined by x,y
A line is defined by x,y and an angle
An arc is defined by x,y (the centre), r and the range of angles.

A shape, then, is a circular linked list of these shape elements. This limits you to convex shapes, but there is a way around it. I didn''t have rotation in my game, so I don''t know how easy this would be to arrange.

I have a whole pile of code which does this, and a but more shape related stuff, if you want it, as well as a game which uses it.

I know it sounds complicated, but in the end you have to find something which will work with the way you want to detect and resolve collisions. This way worked for me, although it was largely overkill in my case.

Share this post


Link to post
Share on other sites
Just some random thoughts...

You might want to define a basic polygon item as AndyMan suggests and then incorporate it into a larger data structure that incorporates other properties like surface elasticity and hardness, what special effects are triggered when that object is struck b the ball, whether the object moves and if so, about what axis and how is it moved!

Cheers,

Timkin

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!