• Immutable Page
• Info
• Attachments

## Phun

Differences between revisions 7 and 9 (spanning 2 versions)
 ⇤ ← Revision 7 as of 2008-05-30 23:11:03 → Size: 1676 Editor: 75-171-241-83 Comment: ← Revision 9 as of 2008-06-01 16:19:37 → ⇥ Size: 3341 Editor: 75-171-252-99 Comment: Deletions are marked like this. Additions are marked like this. Line 1: Line 1: Phun is a simple 2D game/simulator where you enter simple situations and get simple results. I will be showing how to make games using the laws of physics. Phun is a 2D game/simulator where you enter simple situations and get results. I will be showing how to make games using the laws of physics. Line 40: Line 40: === Step 3.2 - Testing === ==== Testing ==== Line 45: Line 45: Actually, it isn't. It just flew up so fast that you couldn't see it. Why? It the pendulum was hanging Actually, it isn't. It just flew up so fast that you couldn't see it. Why? It 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.) Line 47: Line 47: '''UNDER CONSTRUCTION''' (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.=== 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. [[BR]]Select the brush tool, and draw a closed shape around the mono cycle. It 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.Right-Click your monocycle body. Go to Collision Menu... >Only Check:Collision group ARight-Click the AI's monocycle body. Go to Collision Menu... >Only Check:Collision group BYou 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.

Phun is a 2D game/simulator where you enter simple situations and get results. I will be showing how to make games using the laws of physics.

Note on formatting: Sub-window names are italicized.

# 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 Friction Draw Inside Objects

The rest are relatively insignificant.

## Step 2

Make the racing surface. Select the Plane tool from the Toolbar. Pick a point in the lower one-forth, drag your mouse strait 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.

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

#### Testing

Press space to test it.

Woah! What happened? It's gone! Actually, it isn't. It just flew up so fast that you couldn't see it. Why? It 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.

### 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. BR Select the brush tool, and draw a closed shape around the mono cycle. It 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. 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.

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