X2o (activity)
Overview
x2o (X to O) is a puzzle solving and critical thinking game similar to the Incredible Machine. It uses Box2D for it's physics engine and is being written by Alex Levenson.
A level consists of a stage (or canvas) that starts out with a few fixed (non-user editable) components (see list of components below), a certain quantity of components that the user can add to the stage, an X, and an O. The X does not move, and the O is like a ball, it falls and bounces off the other objects in the scene. The goal is to get the O to land on the X (thus x2o, I know, it's backwards) making the XO logo. Thanks to Patrick Thomson for the name "x2o".
Please see my git repository for a log of what's going on with x2o currently.
Components List
These are the "things" that can be in a level and effect the physics of the level. Bold indicates already implemented.
- Ramps are fixed in space (they don't fall or move) obstacles. They can be used as walls, or as ramps for things to slide on, or as a surface to bounce off of.
- Bouncy Balls are small, light, and bouncy!
- Bowling Balls are big, heavy, and not bouncy at all...
- See-Saws consist of a solid immovable base/fulcrum and a board hinged to the top of the base. They make good dynamic ramps (switches?) and catapults
- Fans blow air (and objects) strait up. Good for keeping things airborne!
- Gears, Joints, pulleys and the like very soon to come
- Baseballs, light but not bouncy
- Balloons, move upward because they have "Helium"
- Basket, can prevent balls from rolling
- Spring, can bounce balls up
- Dripping Paint bucket, heavy at first but slowly loses weight over time as paint drips out
- Motors, Piston
- Connectors, think of it as a rigid rope
Got an idea for a component? Leave a note below!
Suggestions
- Conveyor belts
- Pipes
- Magnets
- Breakable Objects, glass boxes, balloons that can pop,
Needs to be Added
- Sound
- Animation
How to Use
Playing Levels
When you first open x2o you are brought to the level editor. Click on the 'Run' tab, and then load a level from the drop down menu. You can always get back to the level editor by loading the level titled "Make your own levels". Once a level is loaded, click on the 'Insert' tab to add components to the level. Remember, your goal is to get the O to land on the X. If you want to see how much of each component you have, click on the component and the blue banner should tell you.
After you've added components, and would like to run the level, go to the 'Run' tab and click the green arrow. Clicking reset will reset and pause the level, and the revert button will reset and remove all the changes you've made.
You can use the move and remove tools to modify the components you've added.
Making Levels
There are two ways to make a level. One ways is to load the level editor ("Make your own levels") or to load an existing level. The process is the same for both, but if you load an existing level, you'll have to hit unlock on the modify tab in order to move the initial components.
Once you've created your scene, go to the save tab and name the level. Then set the amount of each component the use should have (excluding the one's you've placed already). Then hit save, that's it! The level is now in x2o.activity/levels with the extension .level. It's actually just a file generated by pickle.dump(), so if you pickle.load() it you'll get a python dictionary which you can edit as well.