REM Box2D Samples Menu REM!Crunch spaces, lines, rems REM!Window 848,520,client,xpstyle REM These libraries must be installed using the identical case- REM sensitive paths used in the sample programs that are CALLed; REM this is to ensure a fresh PROC / FN scan is not carried out: INSTALL @lib$+"box2dlib" INSTALL @lib$+"box2ddbg" ON ERROR IF ERR=17 CHAIN @lib$+"../examples/tools/touchide" ELSE ERROR 0,REPORT$+" at line "+STR$ERL VDU 23,22,848;540;16,20,16,0 OFF COLOR 4, 0, 0, 128 COLOR 128+4 CLS VDU 23,16,1| SOUND 1,0,0,0 PRINT TAB(9) "Box2D Sample Programs for BBC BASIC"' PRINT " A. BREAKABLE - objects can break into pieces." PRINT " B. BRIDGE - the deck sagging under its own weight." PRINT " C. BULLET - bullet bodies and collision filtering." PRINT " D. CANTILEVER - weld joints are not perfectly rigid." PRINT " E. CAR - damped spring suspensions and friction." PRINT " F. CHAIN - simulates a chain dangling on the floor." PRINT " G. CONFINED - objects confined in a box, with sound." PRINT " H. CRANK - an axle motor and crank simulation." PRINT " I. DOMINOS - actions have their consequences...." PRINT " J. GEARS - rotary and linear gear joints." PRINT " K. LOTTO - stirs the balls, but doesn't pick them." PRINT " L. PENDULUM1 - a pendulum using a 'distance joint'." PRINT " M. PENDULUM2 - a pendulum using a 'rope joint'." PRINT " N. PENDULUM3 - a pendulum using a 'revolute joint'." PRINT " O. PENDULUM4 - a pendulum using a 'friction joint'." PRINT " P. PENDULUM5 - a pendulum using a 'pulley joint'." PRINT " Q. PENDULUM6 - a pendulum using a 'wheel joint'." PRINT " R. PLATFORM - demonstrates a 'kinematic body'." PRINT " S. PYRAMID - destroy the pyramid using your mouse." PRINT " T. SENSOR - sensors detect contact between bodies." PRINT " U. WOBBLE - springy joints connected in a network." PRINT " V. RADIALGRAVITY - attraction by a massive object." PRINT '"Type or click the letter corresponding to your choice" PRINT " To return to the menu click Close or press Escape"; REPEAT K% = INKEY(4) MOUSE X%, Y%, B% IF B% K% = 89 - Y% DIV 40 CASE K% OF WHEN 65,97: CALL @dir$+"breakable" WHEN 66,98: CALL @dir$+"bridge" WHEN 67,99: CALL @dir$+"bullet" WHEN 68,100: CALL @dir$+"cantilever" WHEN 69,101: CALL @dir$+"car" WHEN 70,102: CALL @dir$+"chain" WHEN 71,103: CALL @dir$+"confined" WHEN 72,104: CALL @dir$+"crank" WHEN 73,105: CALL @dir$+"dominos" WHEN 74,106: CALL @dir$+"gears" WHEN 75,107: CALL @dir$+"lotto" WHEN 76,108: CALL @dir$+"pendulum1" WHEN 77,109: CALL @dir$+"pendulum2" WHEN 78,110: CALL @dir$+"pendulum3" WHEN 79,111: CALL @dir$+"pendulum4" WHEN 80,112: CALL @dir$+"pendulum5" WHEN 81,113: CALL @dir$+"pendulum6" WHEN 82,114: CALL @dir$+"platform" WHEN 83,115: CALL @dir$+"pyramid" WHEN 84,116: CALL @dir$+"sensor" WHEN 85,117: CALL @dir$+"wobble" WHEN 86,118: CALL @dir$+"radialgravity" ENDCASE UNTIL FALSE DEF PROCcleanup ON CLOSE OFF *REFRESH ON myWorld%% += 0 : IF myWorld%% PROC_b2DestroyWorld(myWorld%%) : myWorld%% = 0 PROC_b2Exit RUN