Phun

Differences between revisions 27 and 28
Revision 27 as of 2008-06-24 22:55:34
Size: 5371
Editor: 206
Comment:
Revision 28 as of 2008-08-06 16:36:42
Size: 5387
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
[[BR]]
[[BR]]Note on formatting:
[[BR]]Sub-window names are ''italicized''.
<<BR>>
<<BR>>Note on formatting:
<<BR>>Sub-window names are ''italicized''.
Line 9: Line 9:
Go to [http://linux.softpedia.com/progDownload/Phun-Download-36405.html]. Go to [[http://linux.softpedia.com/progDownload/Phun-Download-36405.html]].
Line 12: Line 12:
[[BR]]First we will make a monocycle. This lesson will teach students about gravity and inertia. <<BR>>First we will make a monocycle. This lesson will teach students about gravity and inertia.
Line 14: Line 14:
[[BR]]Change the settings. At the top of the screen should be a sub-window called ''Options''. If this is not there, click on the options button in the ''Phun beta'' sub-window.
[[BR]]The following should be on:
<<BR>>Change the settings. At the top of the screen should be a sub-window called ''Options''. If this is not there, click on the options button in the ''Phun beta'' sub-window.
<<BR>>The following should be on:
Line 25: Line 25:
[[BR]]Select the Plane tool from the ''Toolbar''. Pick a point in the lower one-forth, drag your mouse straight up and let go.
[[BR]]You should have a ground now.
<<BR>>Select the Plane tool from the ''Toolbar''. Pick a point in the lower one-forth, drag your mouse straight up and let go.
<<BR>>You should have a ground now.
Line 29: Line 29:
[[BR]]Make the monocycle!
[[BR]]Start by drawing a circle with the circle tool near the ground.
[[BR]]Draw a box using the box tool. Start below the bottom of the circle and to the right of the center of the circle and go to the left of the center of the circle and a little above the center of the circle. The box should hang down from the center and protrude.
[[BR]][attachment:Monocycle-Pendulum.png Example]
<<BR>>Make the monocycle!
<<BR>>Start by drawing a circle with the circle tool near the ground.
<<BR>>Draw a box using the box tool. Start below the bottom of the circle and to the right of the center of the circle and go to the left of the center of the circle and a little above the center of the circle. The box should hang down from the center and protrude.
<<BR>>[[attachment:Monocycle-Pendulum.png|Example]]
Line 34: Line 34:
[[BR]]Make the motor on the monocycle. Right-click on the circle, go to Geometry settings>Add center hinge. Right click on the hinge and go to Hinges>
[[BR]]Check the following:
<<BR>>Make the motor on the monocycle. Right-click on the circle, go to Geometry settings>Add center hinge. Right click on the hinge and go to Hinges>
<<BR>>Check the following:
Line 38: Line 38:
[attachment:Monocycle-motor-checking.png Image] [[attachment:Monocycle-motor-checking.png|Image]]
Line 40: Line 40:
[[BR]]Press space to test it.
[[BR]]
[[BR]]Don't worry if it's gone.
[[BR]]Actually, it isn't. It just flew up so fast that you couldn't see it. Why? The pendulum was hanging down into the ground. The fastest way to remove that was to fling it straight up. (To see the flung moncycle, right-click anywhere on the screen where there isn't any objects. Use the pan and/or zoom to find it.)
[[BR]](If the pendulum hangs inside the circle, that's OK. Just follow these instructions anyway to learn about collisions in Phun.)
[[BR]]
[[BR]]To go back to the editing screen press Ctrl-Z or click Undo Sim Start in the ''Control'' window.
[[BR]](If you Panned/Zoomed before, Pan/Zoom back.)
<<BR>>Press space to test it.
<<BR>>
<<BR>>Don't worry if it's gone.
<<BR>>Actually, it isn't. It just flew up so fast that you couldn't see it. Why? The pendulum was hanging down into the ground. The fastest way to remove that was to fling it straight up. (To see the flung moncycle, right-click anywhere on the screen where there isn't any objects. Use the pan and/or zoom to find it.)
<<BR>>(If the pendulum hangs inside the circle, that's OK. Just follow these instructions anyway to learn about collisions in Phun.)
<<BR>>
<<BR>>To go back to the editing screen press Ctrl-Z or click Undo Sim Start in the ''Control'' window.
<<BR>>(If you Panned/Zoomed before, Pan/Zoom back.)
Line 49: Line 49:
[[BR]]Right-Click on the pendulum. Go to the Collision menu... >
[[BR]]Un-check all boxes.
[[BR]][attachment:Monocycle-Pendulum.png Image]
<<BR>>Right-Click on the pendulum. Go to the Collision menu... >
<<BR>>Un-check all boxes.
<<BR>>[[attachment:Monocycle-Pendulum.png|Image]]
Line 53: Line 53:
[[BR]]Press space to start.
[[BR]]
[[BR]]
Press the left arrow key. The pendulum should move left, followed shortly by the cycle.
[[BR]]Press the right arrow key. The pendulum should move right, followed shortly by the cycle.
[[BR]]
[[BR]]
Isn't very interesting though, is it? Let's add an AI player. (Actually, the intelligence part of artificial intelligence is kind of a stretch.)
<<BR>>Press space to start.
<<BR>>
<<BR>>
Press the left arrow key. The pendulum should move left, followed shortly by the cycle.
<<BR>>Press the right arrow key. The pendulum should move right, followed shortly by the cycle.
<<BR>>
<<BR>>
Isn't very interesting though, is it? Let's add an AI player. (Actually, the intelligence part of artificial intelligence is kind of a stretch.)
Line 60: Line 60:
[[BR]]Make the AI player.
[[BR]]
[[BR]]Select the brush tool, and draw a closed shape around the mono cycle. The monocycle should be flashing now. Go to the ''Options'' window and un-check Draw inside objects. Hold down Control and drag the monocycle until the two monocycles do not intersect. Right click on the hinge of the AI player. Go to Hinges... >
[[BR]]Uncheck Controlled by arrow keys.Monocycle-RPM-change.png
[[BR]]Right-Click your monocycle body. Go to Collision Menu... >
[[BR]]Only Check:
<<BR>>Make the AI player.
<<BR>>
<<BR>>Select the brush tool, and draw a closed shape around the mono cycle. The monocycle should be flashing now. Go to the ''Options'' window and un-check Draw inside objects. Hold down Control and drag the monocycle until the two monocycles do not intersect. Right click on the hinge of the AI player. Go to Hinges... >
<<BR>>Uncheck Controlled by arrow keys.Monocycle-RPM-change.png
<<BR>>Right-Click your monocycle body. Go to Collision Menu... >
<<BR>>Only Check:
Line 68: Line 68:
[[BR]]Only Check: <<BR>>Only Check:
Line 71: Line 71:
[[BR]]
[[BR]]Optional: Make things more interesting by setting the speed of both hinges to 45 rpm instead of 15.
[attachment:Monocycle-RPM-change.png Image]
<<BR>>
<<BR>>Optional: Make things more interesting by setting the speed of both hinges to 45 rpm instead of 15.
[[attachment:Monocycle-RPM-change.png|Image]]
Line 97: Line 97:
Newton's Laws: [http://hyperphysics.phy-astr.gsu.edu/Hbase/Newt.html] Newton's Laws: [[http://hyperphysics.phy-astr.gsu.edu/Hbase/Newt.html]]
Line 101: Line 101:
[[BR]]More about Phun: [http://www.acc.umu.se/~emilk/]
[[BR]]Quick phun video demo: [http://www.youtube.com/watch?v=0H5g9VS0ENM]
<<BR>>More about Phun: [[http://www.acc.umu.se/~emilk/]]
<<BR>>Quick phun video demo: [[http://www.youtube.com/watch?v=0H5g9VS0ENM]]

Phun is a fun 2D physics simulator/game, where you enter simple situations, interact with them, and see the results instantly. I will be showing how to make games in Phun that demonstrate laws of physics.

Note on formatting:
Sub-window names are italicized.

Download & Install

Go to http://linux.softpedia.com/progDownload/Phun-Download-36405.html.

Game 1: Racing


First we will make a monocycle. This lesson will teach students about gravity and inertia.

Step 1


Change the settings. At the top of the screen should be a sub-window called Options. If this is not there, click on the options button in the Phun beta sub-window.
The following should be on:

  • Draw Hinges/Fixes when running
  • Gravity
  • Air Friction
  • Draw Inside Objects

The rest are relatively insignificant. Go to File... > Clear scene

Step 2

Make the racing surface.
Select the Plane tool from the Toolbar. Pick a point in the lower one-forth, drag your mouse straight up and let go.
You should have a ground now.

Step 3


Make the monocycle!
Start by drawing a circle with the circle tool near the ground.
Draw a box using the box tool. Start below the bottom of the circle and to the right of the center of the circle and go to the left of the center of the circle and a little above the center of the circle. The box should hang down from the center and protrude.
Example

Step 3.1


Make the motor on the monocycle. Right-click on the circle, go to Geometry settings>Add center hinge. Right click on the hinge and go to Hinges>
Check the following:

  • Motor
  • Control with arrow keys

Image

Testing


Press space to test it.

Don't worry if it's gone.
Actually, it isn't. It just flew up so fast that you couldn't see it. Why? The pendulum was hanging down into the ground. The fastest way to remove that was to fling it straight up. (To see the flung moncycle, right-click anywhere on the screen where there isn't any objects. Use the pan and/or zoom to find it.)
(If the pendulum hangs inside the circle, that's OK. Just follow these instructions anyway to learn about collisions in Phun.)

To go back to the editing screen press Ctrl-Z or click Undo Sim Start in the Control window.
(If you Panned/Zoomed before, Pan/Zoom back.)

Step 4


Right-Click on the pendulum. Go to the Collision menu... >
Un-check all boxes.
Image

Testing


Press space to start.

Press the left arrow key. The pendulum should move left, followed shortly by the cycle.
Press the right arrow key. The pendulum should move right, followed shortly by the cycle.

Isn't very interesting though, is it? Let's add an AI player. (Actually, the intelligence part of artificial intelligence is kind of a stretch.)

Step 5


Make the AI player.

Select the brush tool, and draw a closed shape around the mono cycle. The monocycle should be flashing now. Go to the Options window and un-check Draw inside objects. Hold down Control and drag the monocycle until the two monocycles do not intersect. Right click on the hinge of the AI player. Go to Hinges... >
Uncheck Controlled by arrow keys.Monocycle-RPM-change.png
Right-Click your monocycle body. Go to Collision Menu... >
Only Check:

  • Collision group A

Right-Click the AI's monocycle body. Go to Collision Menu... >
Only Check:

  • Collision group B

You now have a controllable monocycle plus one to race against.

Optional: Make things more interesting by setting the speed of both hinges to 45 rpm instead of 15. Image

Game 1 questions

Newton's Laws:

  • Newton's First Law states that an object will remain at rest or in uniform motion in a straight line unless acted upon by an external force.
  • Newton's Second Law:

    Force (newtons) = Mass (kilograms)xAccelleration (meters/second/second) This relates to the amount of force acting on an object. (Note: Obviously, the acceleration is is the same direction as the force.) Example: You pull a 1KG (2.2 pounds) weight across a frictionless floor where there is no air resistance with a force of 1 newton, it accelerates at 1m/s/s (2.24 miles/hour/second). This means that at second zero it isn't going anywhere. At second one it is going at 2.24 miles an hour. At second two it is going 4.48 miles an hour.

  • Newton's Third Law states that every action has an equal and opposite reaction.

Identify and answer:

When the pendulum is rotating clockwise, what direction is the wheel rotating? Counter-Clockwise What law is in action? Third

If you take your hand off the keys while the cycle is moving, it stops (eventually). Why? Friction What law is in action? First

Bibliography

Newton's Laws: http://hyperphysics.phy-astr.gsu.edu/Hbase/Newt.html

Additional Resources


More about Phun: http://www.acc.umu.se/~emilk/
Quick phun video demo: http://www.youtube.com/watch?v=0H5g9VS0ENM

Lessons/Phun (last edited 2008-08-06 16:36:42 by localhost)