#### Archived

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

# 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.

## 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 on other sites
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 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

1. 1
Rutin
52
2. 2
3. 3
4. 4
5. 5

• 10
• 28
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633411
• Total Posts
3011728
• ### Who's Online (See full list)

There are no registered users currently online

×