SHIPPED SQUEAK MORPHIC EXAMPLES These recipes use classes already installed in this project image; no new class file-in is needed. Select a complete expression in a Workspace and Do it, or Inspect it. Other Squeak images may omit MorphicExtras/Etoys classes. Bouncing atoms BouncingAtomsMorph new extent: 640@360; addAtoms: 50; openInWorld; startStepping; yourself. Inspect an atom’s velocity and change it with velocity:. Use the container’s halo menu to change atom count or start infection. Send stopStepping to pause and startStepping to resume. ----------------------------- Infection spreads through collisions | arena atoms | arena := BouncingAtomsMorph new extent: 640@360; addAtoms: 30; yourself. atoms := arena submorphs. atoms first position: 100@100; velocity: 2@1. atoms second position: 106@100; velocity: 2@1. arena openInWorld; startInfection. arena Run the recipe and watch the red population grow. Open the container’s menu for infection history. Start infection again to reset the colors; the moving atoms keep their native velocities. ----------------------------- Squeak is watching you MovingEyeMorph extraExampleSqueakIsWatchingYou openInWorld; yourself. Move the pointer around the logo. Inspect an eye, then inspect its inner ellipse and iris to follow the ownership chain. Try the class-side ghost example as another installed recipe. ----------------------------- A tiny scheduled flasher Flasher new extent: 220@140; openInWorld; startStepping; yourself. Inspect the flasher and send stopStepping or startStepping. Inspect onColor to see its default. Compare this small step method with the atom arena’s step. ----------------------------- Two clocks, one real time source | panel watch clock | panel := Morph new color: Color transparent; extent: 640@320; yourself. watch := WatchMorph example extent: 250@250; yourself. clock := ClockMorph new font: (TextStyle default fontOfSize: 28); yourself. panel addMorph: watch. watch position: panel position + (20@30). panel addMorph: clock. clock position: panel position + (350@142). panel setProperty: #watch toValue: watch; setProperty: #clock toValue: clock. panel openInWorld. watch startStepping. clock startStepping. panel Inspect the digital clock and explore its 12/24-hour and seconds options in the halo menu. Inspect the watch and toggleRoman. These are independent Morphs sharing the ordinary Time API. ----------------------------- Look through a native magnifier | panel text lens | panel := Morph new color: (Color r: 0.91 g: 0.95 b: 0.99); extent: 660@350; yourself. text := StringMorph contents: 'MORPHIC' font: (TextStyle default fontOfSize: 48). text color: (Color r: 0.16 g: 0.40 b: 0.70). panel addMorph: text. text position: panel position + (36@72). lens := MagnifierMorph newShowingPointer extent: 170@170; magnification: 2; yourself. panel addMorph: lens. lens position: panel position + (440@100). panel setProperty: #lens toValue: lens; setProperty: #text toValue: text. panel openInWorld. panel Move the pointer over the text, then over another object in the World. Use the lens’s menu to change magnification, pointer visibility, or tracking. Its source is the World, not just its owner panel. ----------------------------- Tetris built from Morphs Tetris new openInWorld; yourself. Use the movement buttons or focus the game and use arrow keys. Space drops the current block. Try Pause and New game. Inspect the TetrisBoard to see the falling block and stored tiles. ----------------------------- SameGame: a connected-color puzzle SameGame new openInWorld; yourself. Click a connected color group to select it, then click again to remove it. Try Hint and New game. Inspect the board’s selectionCount and tilesRemaining before and after a removal. ----------------------------- Mines and its clickable tile board Mines new openInWorld; yourself. Reveal cells and read their neighbor counts. Use a modifier click to toggle a flag. Open the game’s Help for its platform-specific controls. New game resets the board and counters. ----------------------------- A rich-text Morphic banner BannerMorph example openInWorld; yourself. Inspect the returned banner and explore header and contents. Compare the class-side factory with createHeader and createContents. Native Text carries emphasis runs independently of its string characters.