|
-
Jun 19th, 2005, 05:17 PM
#1
Thread Starter
Banned
Magnetism Physics
I plan on simulating this game. Can anyone help me with the physics aspects of it? Thanks in advance. 
http://www.addictinggames.com/magnetism.html
-
Jun 23rd, 2005, 03:45 PM
#2
Re: Magnetism Physics
Hi,
It depends on how mathsy you are. Having looked at the link, I suspect that the "magnetism" aspect of it is a theme rather than actually involving any magnetism physics. I reckon it is just an acceleration calculator - a constant downwards acceleration (gravity) plus some form of acceleration towards or away from the "magnets" depending on the distance. Probably 1/x or 1/x^2.
If you know something about vectors, you stand a chance.
In the above case, you'd simply take a time interval for moving the ball and at each step add up all the vectors acting at the time. Then move the ball an appropriate distance corresponding to the time interval. How small you set the interval would depend on how fast you wanted to run the game and how accurate you wanted the position to be. Small enough to determine contact with objects fairly accurately would be good.
You'd also have to contend with the ricochet angle of the ball if it hits a corner, for example.
The vector acting on the ball at any given time would involve checking to see if it is contact with a surface (reverse the component of the force normal to the surface) and adding up all the vectors corresponding to the magnets (direction given by using trig and the coordinates, magnitude dependent on what you specify, such as 1/x etc). Get the resulting vector and work out where to move the ball. You can use the classical formulae s=ut+0.5at^2, v=u+at etc.
Alternatively, if you wanted to do a proper magnetic game, you'd have to put in poles of the magnets, work out the overall field direction at any given point, define how your ball gets magnetized, choose your materials, define susceptibilities and permeabilities...
It's get a bit dull in 2D though. 3d, on the other hand...
Also, to achieve the sorts of accelerations seen in that game, you'd need pretty high fields(!). Not that that's a problem in a simulation.
In summary, I wouldn't be put off by the need to know something about magnetism. You don't. But you'll probably need to deal with vectors and do some trigonometry, and then you might be able to get somewhere.
zaza
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|