Updated 'samples'.
79
samples.md
|
@ -2,62 +2,83 @@
|
|||
|
||||
## SAMPLES
|
||||
|
||||
- **[Julia Rings](samples/3d-cube/index.md)** • [Relsoft](samples/relsoft.md) <span style="float: right;">[3d](samples/3d.md), [cube](samples/cube.md)</span>
|
||||
- **[3D Cube](samples/3d-cube/index.md)** • [Relsoft](samples/relsoft.md) <span style="float: right;">[3d](samples/3d.md), [cube](samples/cube.md)</span>
|
||||
- **[Abacus](samples/abacus/index.md)** • [Bob Seguin](samples/bob-seguin.md) <span style="float: right;">[abacus](samples/abacus.md), [arithmetic](samples/arithmetic.md)</span>
|
||||
- **[Amongst](samples/amongst/index.md)** • [Fellippe Heitor](samples/fellippe-heitor.md) <span style="float: right;">[game](samples/game.md), [multiplayer](samples/multiplayer.md)</span>
|
||||
- **[Animax](samples/animax/index.md)** • [Bob Seguin](samples/bob-seguin.md) <span style="float: right;">[art](samples/art.md), [drawing](samples/drawing.md)</span>
|
||||
- **[ArcDemo](samples/arc-demo/index.md)** • [Tsiplacov Sergey](samples/tsiplacov-sergey.md) <span style="float: right;">[game](samples/game.md), [platformer](samples/platformer.md)</span>
|
||||
- **[Arc Demo](samples/arc-demo/index.md)** • [Tsiplacov Sergey](samples/tsiplacov-sergey.md) <span style="float: right;">[game](samples/game.md), [platformer](samples/platformer.md)</span>
|
||||
- **[Assault](samples/assault/index.md)** • [Glenn Powell](samples/glenn-powell.md) <span style="float: right;">[game](samples/game.md)</span>
|
||||
- **[Bezier](samples/bezier/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Binary Clock](samples/binary-clock/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Binary Clock](samples/binary-clock/index.md)** • [RhoSigma](samples/rhosigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Blockout](samples/blockout/index.md)** • [Fellippe Heitor](samples/fellippe-heitor.md) <span style="float: right;">[game](samples/game.md), [breakout](samples/breakout.md)</span>
|
||||
- **[Can't Contain Me](samples/cant-contain-me/index.md)** • [Fellippe Heitor](samples/fellippe-heitor.md) <span style="float: right;">[game](samples/game.md)</span>
|
||||
- **[Cant Contain Me](samples/cant-contain-me/index.md)** • [Fellippe Heitor](samples/fellippe-heitor.md) <span style="float: right;">[game](samples/game.md)</span>
|
||||
- **[Castle](samples/castle/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[game](samples/game.md), [2 player](samples/2-player.md)</span>
|
||||
- **[Chaotic Scattering - Gaspard-Rice system](samples/chaotic-scattering/index.md)** • [vince](samples/vince.md) <span style="float: right;">[ray tracing](samples/ray-tracing.md), [reflections](samples/reflections.md)</span>
|
||||
- **[Chaotic Scattering](samples/chaotic-scattering/index.md)** • [vince](samples/vince.md) <span style="float: right;">[ray tracing](samples/ray-tracing.md), [reflections](samples/reflections.md)</span>
|
||||
- **[Circle Intersecting Circle](samples/circle-intersecting-circle/index.md)** • [bplus](samples/bplus.md) • [STxAxTIC](samples/stxaxtic.md) <span style="float: right;">[geometry](samples/geometry.md), [intersections](samples/intersections.md)</span>
|
||||
- **[Circle Intersecting Line](samples/circle-intersecting-line/index.md)** • [bplus](samples/bplus.md) <span style="float: right;">[geometry](samples/geometry.md), [intersections](samples/intersections.md)</span>
|
||||
- **[Colliding Ball Simulation](samples/colliding-ball-simulation/index.md)** • [Timothy Baxendale](samples/timothy-baxendale.md) <span style="float: right;">[physics](samples/physics.md), [collisions](samples/collisions.md)</span>
|
||||
- **[Connect Circles](samples/connect-circles/index.md)** • [bplus](samples/bplus.md) <span style="float: right;">[screensaver](samples/screensaver.md), [mosaic](samples/mosaic.md)</span>
|
||||
- **[Convert BMP to Dominoes](samples/convert-bmp-to-dominoes/index.md)** • [Richard Frost](samples/richard-frost.md) <span style="float: right;">[image processing](samples/image-processing.md)</span>
|
||||
- **[Darokin](samples/darokin/index.md)** • [darokin](samples/darokin.md) <span style="float: right;">[screensaver](samples/screensaver.md), [starfield](samples/starfield.md)</span>
|
||||
- **[Dragon Warrior 64](samples/dragon-warrior/index.md)** • [Cobalt](samples/cobalt.md) <span style="float: right;">[game](samples/game.md), [rpg](samples/rpg.md)</span>
|
||||
- **[Dragon Warrior](samples/dragon-warrior/index.md)** • [Cobalt](samples/cobalt.md) <span style="float: right;">[game](samples/game.md), [rpg](samples/rpg.md)</span>
|
||||
- **[Dropping Balls](samples/dropping-balls/index.md)** • [bplus](samples/bplus.md) <span style="float: right;">[gravity](samples/gravity.md), [collisions](samples/collisions.md)</span>
|
||||
- **[Ellipse Intersecting Line](samples/ellipse-intersecting-line/index.md)** • [STxAxTIC](samples/stxaxtic.md) <span style="float: right;">[geometry](samples/geometry.md), [intersections](samples/intersections.md)</span>
|
||||
- **[Fibonacci Variations](samples/fibonacci-variations/index.md)** • [STxAxTIC](samples/stxaxtic.md) <span style="float: right;">[fibonacci](samples/fibonacci.md)</span>
|
||||
- **[Filled Circles and Ellipses](samples/filled-circles-and-ellipses/index.md)** • [QB64 Team 2018](samples/qb64-team-2018.md) <span style="float: right;">[filled circle](samples/filled-circle.md), [ellipse](samples/ellipse.md)</span>
|
||||
- **[Fire](samples/fire/index.md)** • [*missing*](samples/author-missing.md) <span style="float: right;">[fire](samples/fire.md), [graphics](samples/graphics.md)</span>
|
||||
- **[Floormaper](samples/floormaper/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[graphics](samples/graphics.md), [floorscape](samples/floorscape.md)</span>
|
||||
- **[4 Player Pong](samples/four-player-pong/index.md)** • [Matthew](samples/matthew.md) <span style="float: right;">[game](samples/game.md), [pong](samples/pong.md)</span>
|
||||
- **[Bezier](samples/fractal/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Four Player Pong](samples/four-player-pong/index.md)** • [Matthew](samples/matthew.md) <span style="float: right;">[game](samples/game.md), [pong](samples/pong.md)</span>
|
||||
- **[Fractal](samples/fractal/index.md)** • [RhoSigma](samples/rhosigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Fractal Art](samples/fractal-art/index.md)** • [Zom-B](samples/zom-b.md) <span style="float: right;">[fractal](samples/fractal.md), [art](samples/art.md)</span>
|
||||
- **[Fractal Fern](samples/fractal-fern/index.md)** • [*missing*](samples/author-missing.md) <span style="float: right;">[fractal](samples/fractal.md), [fern](samples/fern.md)</span>
|
||||
- **[Globe](samples/globe/index.md)** • [Glen Jeh](samples/glen-jeh.md) • [8/12/1994](samples/8/12/1994.md) • [William Yu (05-28-96)](samples/william-yu-(05-28-96).md) <span style="float: right;">[3d](samples/3d.md), [sphere](samples/sphere.md)</span>
|
||||
- **[GUJERO2](samples/gujero2/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[screensaver](samples/screensaver.md), [tunnel](samples/tunnel.md)</span>
|
||||
- **[Globe](samples/globe/index.md)** • [Jeh](samples/jeh.md) • [Yu](samples/yu.md) <span style="float: right;">[3d](samples/3d.md), [sphere](samples/sphere.md)</span>
|
||||
- **[Gujero2](samples/gujero2/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[screensaver](samples/screensaver.md), [tunnel](samples/tunnel.md)</span>
|
||||
- **[Helicopter Rescue](samples/helicopter-rescue/index.md)** • [TrialAndTerror](samples/trialandterror.md) <span style="float: right;">[game](samples/game.md), [3d](samples/3d.md), [flight](samples/flight.md)</span>
|
||||
- **[Inverse Julia Fractal Explorer](samples/inverse-julia-fractal-explorer/index.md)** • [Zom-B](samples/zom-b.md) <span style="float: right;">[fractal](samples/fractal.md), [julia set](samples/julia-set.md)</span>
|
||||
- **[Julia Rings](samples/julia-rings/index.md)** • [Relsoft](samples/relsoft.md) <span style="float: right;">[fractal](samples/fractal.md), [julia set](samples/julia-set.md)</span>
|
||||
- **[Bezier](samples/kaleidoscope/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Bezier](samples/kaleidoscope-mill/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Bezier](samples/lightning-one/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Bezier](samples/lightning-two/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Lissajous Curve Table](samples/lissajous-curve-table/index.md)** • [FellippeHeitor](samples/fellippeheitor.md) <span style="float: right;">[graphics](samples/graphics.md), [trigonometry](samples/trigonometry.md)</span>
|
||||
- **[Kaleidoscope](samples/kaleidoscope/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Kaleidoscope Mill](samples/kaleidoscope-mill/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Lightning One](samples/lightning-one/index.md)** • [RhoSigma](samples/rhosigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Lightning Two](samples/lightning-two/index.md)** • [RhoSigma](samples/rhosigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[LightsOn](samples/lightson/index.md)** • [Fellippe Heitor](samples/fellippe-heitor.md) <span style="float: right;">[game](samples/game.md), [lights](samples/lights.md)</span>
|
||||
- **[Lissajous Curve Table](samples/lissajous-curve-table/index.md)** • [Fellippe Heitor](samples/fellippe-heitor.md) <span style="float: right;">[graphics](samples/graphics.md), [trigonometry](samples/trigonometry.md)</span>
|
||||
- **[Lissajous Screensaver](samples/lissajous-screensaver/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[screensaver](samples/screensaver.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Rotating Lorenz Attractor](samples/lorenz-attractor/index.md)** • [Vince](samples/vince.md) <span style="float: right;">[lorenz](samples/lorenz.md), [rotations](samples/rotations.md)</span>
|
||||
- **[Mandala 9 Line](samples/manadla/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[screensaver](samples/screensaver.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Lorenz Attractor](samples/lorenz-attractor/index.md)** • [Vince](samples/vince.md) <span style="float: right;">[lorenz](samples/lorenz.md), [rotations](samples/rotations.md)</span>
|
||||
- **[Manadla](samples/manadla/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[screensaver](samples/screensaver.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Mandelbrot Animator](samples/mandelbrot-animator/index.md)** • [*missing*](samples/author-missing.md) <span style="float: right;">[fractal](samples/fractal.md), [mandelbrot](samples/mandelbrot.md)</span>
|
||||
- **[Mandelbrot](samples/mandelbrot-set-2003/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[fractal](samples/fractal.md), [mandelbrot](samples/mandelbrot.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Mandelbrot Set](samples/mandelbrot-set-2008/index.md)** • [qbguy](samples/qbguy.md) <span style="float: right;">[fractal](samples/fractal.md), [mandelbrot](samples/mandelbrot.md)</span>
|
||||
- **[Tor Myklebust](samples/mandelbrot-zoomer/index.md)** • [*missing*](samples/author-missing.md) <span style="float: right;">[fractal](samples/fractal.md), [mandelbrot](samples/mandelbrot.md)</span>
|
||||
- **[Mandelbrot Set 2003](samples/mandelbrot-set-2003/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[fractal](samples/fractal.md), [mandelbrot](samples/mandelbrot.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Mandelbrot Set 2008](samples/mandelbrot-set-2008/index.md)** • [qbguy](samples/qbguy.md) <span style="float: right;">[fractal](samples/fractal.md), [mandelbrot](samples/mandelbrot.md)</span>
|
||||
- **[Mandelbrot Zoomer](samples/mandelbrot-zoomer/index.md)** • [*missing*](samples/author-missing.md) <span style="float: right;">[fractal](samples/fractal.md), [mandelbrot](samples/mandelbrot.md)</span>
|
||||
- **[Maptriangle in 3D](samples/maptriangle-in-3d/index.md)** • [Petr](samples/petr.md) <span style="float: right;">[3d](samples/3d.md), [maptriangle](samples/maptriangle.md)</span>
|
||||
- **[Matrix Effect](samples/matrix-effect/index.md)** • [TylerDarko](samples/tylerdarko.md) <span style="float: right;">[ascii](samples/ascii.md), [matrix](samples/matrix.md)</span>
|
||||
- **[Mazes of Misery](samples/mazes-of-misery/index.md)** • [Steve M.](samples/steve-m..md) <span style="float: right;">[game](samples/game.md), [maze](samples/maze.md)</span>
|
||||
- **[Mini Clock](samples/mini-clock/index.md)** • [Folker Fritz](samples/folker-fritz.md) <span style="float: right;">[clock](samples/clock.md), [desktop](samples/desktop.md)</span>
|
||||
- **[Bezier](samples/multi-mill/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Bezier](samples/mystify/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Money](samples/money/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[data management](samples/data-management.md)</span>
|
||||
- **[Moon Lander](samples/moon-lander/index.md)** • [Richard Frost](samples/richard-frost.md) <span style="float: right;">[game](samples/game.md), [lander](samples/lander.md)</span>
|
||||
- **[Multi-Mill](samples/multi-mill/index.md)** • [RhoSigma](samples/rhosigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Mystify](samples/mystify/index.md)** • [RhoSigma](samples/rhosigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Nibbles](samples/nibbles/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[game](samples/game.md), [snake](samples/snake.md)</span>
|
||||
- **[Particle Fountain](samples/particle-fountain/index.md)** • [bplus](samples/bplus.md) <span style="float: right;">[particles](samples/particles.md)</span>
|
||||
- **[Mandala 9 Line](samples/pattern/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[screensaver](samples/screensaver.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Pattern](samples/pattern/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[screensaver](samples/screensaver.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Pendulum Game](samples/pendulum-game/index.md)** • [Fellippe Heitor](samples/fellippe-heitor.md) <span style="float: right;">[game](samples/game.md), [pendulum](samples/pendulum.md)</span>
|
||||
- **[Pipes Puzzle (Maze Connect)](samples/pipes-puzzle/index.md)** • [Dav](samples/dav.md) <span style="float: right;">[game](samples/game.md), [puzzle](samples/puzzle.md)</span>
|
||||
- **[Non-Palette Rotated Plasma](samples/plasma-non-pal/index.md)** • [Relsoft](samples/relsoft.md) <span style="float: right;">[screensaver](samples/screensaver.md), [plasma](samples/plasma.md)</span>
|
||||
- **[Phone](samples/phone/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[data management](samples/data-management.md)</span>
|
||||
- **[Pipes Puzzle](samples/pipes-puzzle/index.md)** • [Dav](samples/dav.md) <span style="float: right;">[game](samples/game.md), [puzzle](samples/puzzle.md)</span>
|
||||
- **[PixelPlus](samples/pixelplus/index.md)** • [Chris Chadwick](samples/chris-chadwick.md) <span style="float: right;">[graphics](samples/graphics.md), [bitmap](samples/bitmap.md)</span>
|
||||
- **[Plasma Non-Pal](samples/plasma-non-pal/index.md)** • [Relsoft](samples/relsoft.md) <span style="float: right;">[screensaver](samples/screensaver.md), [plasma](samples/plasma.md)</span>
|
||||
- **[Platform](samples/platform/index.md)** • [Fellippe Heitor](samples/fellippe-heitor.md) <span style="float: right;">[game](samples/game.md), [platform](samples/platform.md)</span>
|
||||
- **[QBAscii](samples/qbascii/index.md)** • [Jeremy Munn](samples/jeremy-munn.md) <span style="float: right;">[drawing](samples/drawing.md), [ascii](samples/ascii.md)</span>
|
||||
- **[QBlocks](samples/qblocks/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[game](samples/game.md), [tetris](samples/tetris.md)</span>
|
||||
- **[QBricks](samples/qbricks/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[game](samples/game.md), [breakout](samples/breakout.md)</span>
|
||||
- **[QCards](samples/qcards/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[data management](samples/data-management.md)</span>
|
||||
- **[QDigger](samples/qdigger/index.md)** • [RETROQB45](samples/retroqb45.md) <span style="float: right;">[game](samples/game.md), [digger](samples/digger.md)</span>
|
||||
- **[QMaze](samples/qmaze/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[game](samples/game.md), [maze](samples/maze.md)</span>
|
||||
- **[QShips](samples/qships/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[game](samples/game.md), [artillery](samples/artillery.md)</span>
|
||||
- **[QSpace](samples/qspace/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[game](samples/game.md), [defense](samples/defense.md)</span>
|
||||
- **[QSynth](samples/qsynth/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[sound](samples/sound.md), [music](samples/music.md)</span>
|
||||
- **[QTrek](samples/qtrek/index.md)** • [Philipp Strathausen](samples/philipp-strathausen.md) <span style="float: right;">[game](samples/game.md), [space shooter](samples/space-shooter.md)</span>
|
||||
- **[Rattler](samples/rattler/index.md)** • [Bob Seguin](samples/bob-seguin.md) <span style="float: right;">[game](samples/game.md), [snake](samples/snake.md)</span>
|
||||
- **[RayCaster](samples/raycaster/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[3d](samples/3d.md), [raycaster](samples/raycaster.md)</span>
|
||||
- **[Reversi](samples/reversi/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[game](samples/game.md)</span>
|
||||
- **[Ripples](samples/ripples/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[image processing](samples/image-processing.md), [ripple](samples/ripple.md)</span>
|
||||
- **[Rotozoomer](samples/rotozoomer/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[screensaver](samples/screensaver.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Set Fire to Rain](samples/set-fire-to-rain/index.md)** • [Fellippe Heitor](samples/fellippe-heitor.md) <span style="float: right;">[game](samples/game.md), [zen](samples/zen.md)</span>
|
||||
|
@ -66,11 +87,11 @@
|
|||
- **[SineCube](samples/sinecube/index.md)** • [Mennonite](samples/mennonite.md) <span style="float: right;">[graphics](samples/graphics.md)</span>
|
||||
- **[Snake Basic](samples/snake-basic/index.md)** • [pcluddite](samples/pcluddite.md) <span style="float: right;">[game](samples/game.md), [snake](samples/snake.md)</span>
|
||||
- **[Sokoban](samples/sokoban/index.md)** • [David Joffe](samples/david-joffe.md) <span style="float: right;">[game](samples/game.md), [puzzle](samples/puzzle.md)</span>
|
||||
- **[Sort demo](samples/sort-demo/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[sort](samples/sort.md)</span>
|
||||
- **[Sort Demo](samples/sort-demo/index.md)** • [Microsoft](samples/microsoft.md) <span style="float: right;">[sort](samples/sort.md)</span>
|
||||
- **[Space64](samples/space64/index.md)** • [Cyperium](samples/cyperium.md) <span style="float: right;">[game](samples/game.md), [space shooter](samples/space-shooter.md)</span>
|
||||
- **[Spaceship](samples/spaceship/index.md)** • [Fellippe Heitor](samples/fellippe-heitor.md) <span style="float: right;">[game](samples/game.md), [space shooter](samples/space-shooter.md)</span>
|
||||
- **[Bezier](samples/splines/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Starfield 9 Line](samples/starfield/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[starfield](samples/starfield.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Splines](samples/splines/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Starfield](samples/starfield/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[starfield](samples/starfield.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Starfield Torus](samples/starfield-torus/index.md)** • [JKC](samples/jkc.md) <span style="float: right;">[starfield](samples/starfield.md)</span>
|
||||
- **[Texel Raytracer](samples/texel-raytracer/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[3d](samples/3d.md), [ray tracing](samples/ray-tracing.md)</span>
|
||||
- **[Tic Tac Toe](samples/tic-tac-toe/index.md)** • [Paul Meyer](samples/paul-meyer.md) <span style="float: right;">[game](samples/game.md), [tic tac toe](samples/tic-tac-toe.md)</span>
|
||||
|
@ -81,4 +102,4 @@
|
|||
- **[Twirl](samples/twirl/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[screensaver](samples/screensaver.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Vortex](samples/vortex/index.md)** • [Antoni Gual](samples/antoni-gual.md) <span style="float: right;">[screensaver](samples/screensaver.md), [9 lines](samples/9-lines.md)</span>
|
||||
- **[Water](samples/water/index.md)** • [*missing*](samples/author-missing.md) <span style="float: right;">[wave motion](samples/wave-motion.md)</span>
|
||||
- **[Bezier](samples/worms/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
- **[Worms](samples/worms/index.md)** • [Rho Sigma](samples/rho-sigma.md) <span style="float: right;">[screenblanker](samples/screenblanker.md)</span>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: JULIA RINGS
|
||||
## SAMPLE: 3D CUBE
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## SAMPLES: 3D
|
||||
|
||||
**[Julia Rings](3d-cube/index.md)**
|
||||
**[3D Cube](3d-cube/index.md)**
|
||||
|
||||
[🐝 Relsoft](relsoft.md) 🔗 [3d](3d.md), [cube](cube.md)
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
|||
|
||||
**[Globe](globe/index.md)**
|
||||
|
||||
[🐝 Glen Jeh](glen-jeh.md) [🐝 8/12/1994](8/12/1994.md) [🐝 William Yu (05-28-96)](william-yu-(05-28-96).md) 🔗 [3d](3d.md), [sphere](sphere.md)
|
||||
[🐝 Jeh](jeh.md) [🐝 Yu](yu.md) 🔗 [3d](3d.md), [sphere](sphere.md)
|
||||
|
||||
'{A little rotating sphere, by Glen Jeh, 8/12/1994, use freely} '{Try messing with the constants....
|
||||
Glen Jeh, 8/12/1994, William Yu (05-28-96) '{A little rotating sphere, by Glen Jeh, 8/12/1994, u...
|
||||
|
||||
**[Helicopter Rescue](helicopter-rescue/index.md)**
|
||||
|
||||
|
@ -26,6 +26,12 @@
|
|||
|
||||
A demo to show rotation in 3D using MAPTRIANGLE 3D, without direct OpenGL statements. Librarian'...
|
||||
|
||||
**[RayCaster](raycaster/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [3d](3d.md), [raycaster](raycaster.md)
|
||||
|
||||
'Antoni Gual raycaster 'Modified from Entropy's an 36-lines entry for the Biskbart's '40-lines QB...
|
||||
|
||||
**[Texel Raytracer](texel-raytracer/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [3d](3d.md), [ray tracing](ray-tracing.md)
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES BY 8/12/1994
|
||||
|
||||
**[Globe](globe/index.md)**
|
||||
|
||||
[🐝 Glen Jeh](glen-jeh.md) [🐝 8/12/1994](8/12/1994.md) [🐝 William Yu (05-28-96)](william-yu-(05-28-96).md) 🔗 [3d](3d.md), [sphere](sphere.md)
|
||||
|
||||
'{A little rotating sphere, by Glen Jeh, 8/12/1994, use freely} '{Try messing with the constants....
|
|
@ -8,19 +8,19 @@
|
|||
|
||||
'Lissajous by Antoni Gual 'for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003 '-----------------...
|
||||
|
||||
**[Mandala 9 Line](manadla/index.md)**
|
||||
**[Manadla](manadla/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [screensaver](screensaver.md), [9 lines](9-lines.md)
|
||||
|
||||
'Mandala by Antoni gual 'for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003 '-------------------...
|
||||
|
||||
**[Mandelbrot](mandelbrot-set-2003/index.md)**
|
||||
**[Mandelbrot Set 2003](mandelbrot-set-2003/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [fractal](fractal.md), [mandelbrot](mandelbrot.md), [9 lines](9-lines.md)
|
||||
|
||||
'MANDELBROT by Antoni Gual 2003 'for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003 '-----------...
|
||||
|
||||
**[Mandala 9 Line](pattern/index.md)**
|
||||
**[Pattern](pattern/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [screensaver](screensaver.md), [9 lines](9-lines.md)
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
|||
|
||||
' OPTIMIZED :) rotozoomer in 9 lines by Antoni Gual 'for Rel's 9 LINER contest at QBASICNEWS.COM...
|
||||
|
||||
**[Starfield 9 Line](starfield/index.md)**
|
||||
**[Starfield](starfield/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [starfield](starfield.md), [9 lines](9-lines.md)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
Floormaper by Antoni Gual for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003
|
||||
|
||||
**[GUJERO2](gujero2/index.md)**
|
||||
**[Gujero2](gujero2/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [screensaver](screensaver.md), [tunnel](tunnel.md)
|
||||
|
||||
|
@ -20,24 +20,30 @@ Floormaper by Antoni Gual for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003
|
|||
|
||||
'Lissajous by Antoni Gual 'for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003 '-----------------...
|
||||
|
||||
**[Mandala 9 Line](manadla/index.md)**
|
||||
**[Manadla](manadla/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [screensaver](screensaver.md), [9 lines](9-lines.md)
|
||||
|
||||
'Mandala by Antoni gual 'for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003 '-------------------...
|
||||
|
||||
**[Mandelbrot](mandelbrot-set-2003/index.md)**
|
||||
**[Mandelbrot Set 2003](mandelbrot-set-2003/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [fractal](fractal.md), [mandelbrot](mandelbrot.md), [9 lines](9-lines.md)
|
||||
|
||||
'MANDELBROT by Antoni Gual 2003 'for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003 '-----------...
|
||||
|
||||
**[Mandala 9 Line](pattern/index.md)**
|
||||
**[Pattern](pattern/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [screensaver](screensaver.md), [9 lines](9-lines.md)
|
||||
|
||||
'patterns 'for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003 '---------------------------------...
|
||||
|
||||
**[RayCaster](raycaster/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [3d](3d.md), [raycaster](raycaster.md)
|
||||
|
||||
'Antoni Gual raycaster 'Modified from Entropy's an 36-lines entry for the Biskbart's '40-lines QB...
|
||||
|
||||
**[Ripples](ripples/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [image processing](image-processing.md), [ripple](ripple.md)
|
||||
|
@ -50,7 +56,7 @@ Floormaper by Antoni Gual for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003
|
|||
|
||||
' OPTIMIZED :) rotozoomer in 9 lines by Antoni Gual 'for Rel's 9 LINER contest at QBASICNEWS.COM...
|
||||
|
||||
**[Starfield 9 Line](starfield/index.md)**
|
||||
**[Starfield](starfield/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [starfield](starfield.md), [9 lines](9-lines.md)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: ARCDEMO
|
||||
## SAMPLE: ARC DEMO
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES: RAY TRACER
|
||||
## SAMPLES: ARTILLERY
|
||||
|
||||
**[Ray Tracer Demo](ray-tracer-demo/index.md)**
|
||||
**[QShips](qships/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [ray tracer](ray-tracer.md)
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [artillery](artillery.md)
|
||||
|
||||
'Pure QB Realtime Raytracer Demo 'Translated to/optimized for QB by Antoni Gual agual@eic.ictnet....
|
||||
Turn-based artillery game by Microsoft.
|
|
@ -7,3 +7,9 @@
|
|||
[🐝 TylerDarko](tylerdarko.md) 🔗 [ascii](ascii.md), [matrix](matrix.md)
|
||||
|
||||
If you look close, it spells F-e-l-l-i-p-p-e.
|
||||
|
||||
**[QBAscii](qbascii/index.md)**
|
||||
|
||||
[🐝 Jeremy Munn](jeremy-munn.md) 🔗 [drawing](drawing.md), [ascii](ascii.md)
|
||||
|
||||
'***************************************************************************** ' Name: QB...
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
## AUTHORS
|
||||
|
||||
[Antoni Gual:23](antoni-gual.md) • [Rho Sigma:21](rho-sigma.md) • [*missing*:15](author-missing.md) • [Fellippe Heitor:13](fellippe-heitor.md) • [bplus:9](bplus.md) • [Microsoft:5](microsoft.md) • [Relsoft:5](relsoft.md) • [STxAxTIC:5](stxaxtic.md) • [Bob Seguin:3](bob-seguin.md) • [vince:3](vince.md) • [Zom-B:3](zom-b.md) • [8/12/1994:1](8-12-1994.md) • [Cobalt:1](cobalt.md) • [Cyperium:1](cyperium.md) • [darokin:1](darokin.md) • [Dav:1](dav.md) • [David Joffe:1](david-joffe.md) • [FellippeHeitor:1](fellippeheitor.md) • [Folker Fritz:1](folker-fritz.md) • [Glen Jeh:1](glen-jeh.md) • [Glenn Powell:1](glenn-powell.md) • [JKC:1](jkc.md) • [Matthew:1](matthew.md) • [Mennonite:1](mennonite.md) • [Paul Meyer:1](paul-meyer.md) • [pcluddite:1](pcluddite.md) • [Petr:1](petr.md) • [QB64 Team 2018:1](qb64-team-2018.md) • [qbguy:1](qbguy.md) • [Richard Frost:1](richard-frost.md) • [Timothy Baxendale:1](timothy-baxendale.md) • [TrialAndTerror:1](trialandterror.md) • [triggered:1](triggered.md) • [Tsiplacov Sergey:1](tsiplacov-sergey.md) • [TylerDarko:1](tylerdarko.md) • [William Yu (05-28-96):1](william-yu-(05-28-96).md)
|
||||
[Microsoft:27](microsoft.md) • [Antoni Gual:25](antoni-gual.md) • [Fellippe Heitor:19](fellippe-heitor.md) • [*missing*:15](author-missing.md) • [RhoSigma:11](rhosigma.md) • [bplus:9](bplus.md) • [Rho Sigma:9](rho-sigma.md) • [Bob Seguin:5](bob-seguin.md) • [Relsoft:5](relsoft.md) • [STxAxTIC:5](stxaxtic.md) • [Richard Frost:3](richard-frost.md) • [vince:3](vince.md) • [Zom-B:3](zom-b.md) • [Chris Chadwick:1](chris-chadwick.md) • [Cobalt:1](cobalt.md) • [Cyperium:1](cyperium.md) • [darokin:1](darokin.md) • [Dav:1](dav.md) • [David Joffe:1](david-joffe.md) • [Folker Fritz:1](folker-fritz.md) • [Glenn Powell:1](glenn-powell.md) • [Jeh:1](jeh.md) • [Jeremy Munn:1](jeremy-munn.md) • [JKC:1](jkc.md) • [Matthew:1](matthew.md) • [Mennonite:1](mennonite.md) • [Paul Meyer:1](paul-meyer.md) • [pcluddite:1](pcluddite.md) • [Petr:1](petr.md) • [Philipp Strathausen:1](philipp-strathausen.md) • [QB64 Team 2018:1](qb64-team-2018.md) • [qbguy:1](qbguy.md) • [RETROQB45:1](retroqb45.md) • [Steve M.:1](steve-m..md) • [Timothy Baxendale:1](timothy-baxendale.md) • [TrialAndTerror:1](trialandterror.md) • [triggered:1](triggered.md) • [Tsiplacov Sergey:1](tsiplacov-sergey.md) • [TylerDarko:1](tylerdarko.md) • [Yu:1](yu.md)
|
|
@ -20,7 +20,7 @@ The legendary fractal fern.
|
|||
|
||||
Mandelbrot animator.
|
||||
|
||||
**[Tor Myklebust](mandelbrot-zoomer/index.md)**
|
||||
**[Mandelbrot Zoomer](mandelbrot-zoomer/index.md)**
|
||||
|
||||
[🐝 *missing*](author-missing.md) 🔗 [fractal](fractal.md), [mandelbrot](mandelbrot.md)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
### Author
|
||||
|
||||
[🐝 Rho Sigma](../rho-sigma.md)
|
||||
[🐝 RhoSigma](../rhosigma.md)
|
||||
|
||||
### Description
|
||||
|
||||
|
|
9
samples/bitmap.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES: BITMAP
|
||||
|
||||
**[PixelPlus](pixelplus/index.md)**
|
||||
|
||||
[🐝 Chris Chadwick](chris-chadwick.md) 🔗 [graphics](graphics.md), [bitmap](bitmap.md)
|
||||
|
||||
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' PIXELplus 256 Us...
|
|
@ -13,3 +13,9 @@ Abacus app by Bob Seguin. NOTE: This game requires graphics files created by an
|
|||
[🐝 Bob Seguin](bob-seguin.md) 🔗 [art](art.md), [drawing](drawing.md)
|
||||
|
||||
A Graphics/Animation utility by Bob Seguin. NOTE: This game requires graphics files created by a...
|
||||
|
||||
**[Rattler](rattler/index.md)**
|
||||
|
||||
[🐝 Bob Seguin](bob-seguin.md) 🔗 [game](game.md), [snake](snake.md)
|
||||
|
||||
Snake clone by Bob Seguin.
|
||||
|
|
|
@ -7,3 +7,9 @@
|
|||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md), [breakout](breakout.md)
|
||||
|
||||
A Breakout clone with DXBall aspirations.
|
||||
|
||||
**[QBricks](qbricks/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [breakout](breakout.md)
|
||||
|
||||
Breakout clone by Microsoft.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: CAN'T CONTAIN ME
|
||||
## SAMPLE: CANT CONTAIN ME
|
||||
|
||||
![screenshot.jpg](img/screenshot.jpg)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: CHAOTIC SCATTERING - GASPARD-RICE SYSTEM
|
||||
## SAMPLE: CHAOTIC SCATTERING
|
||||
|
||||
![chaoticscattering.png](img/chaoticscattering.png)
|
||||
|
||||
|
@ -20,3 +20,6 @@ Demo of the Gaspard-Rice system. Left-click to change location.
|
|||
* [scatter2.bas](src/scatter2.bas)
|
||||
|
||||
🔗 [ray tracing](../ray-tracing.md), [reflections](../reflections.md)
|
||||
|
||||
|
||||
<sub>Reference: [1](ttps://en.wikipedia.org/wiki/Chaotic_scattering) </sub>
|
||||
|
|
9
samples/chris-chadwick.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES BY CHRIS CHADWICK
|
||||
|
||||
**[PixelPlus](pixelplus/index.md)**
|
||||
|
||||
[🐝 Chris Chadwick](chris-chadwick.md) 🔗 [graphics](graphics.md), [bitmap](bitmap.md)
|
||||
|
||||
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' PIXELplus 256 Us...
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## SAMPLES BY COBALT
|
||||
|
||||
**[Dragon Warrior 64](dragon-warrior/index.md)**
|
||||
**[Dragon Warrior](dragon-warrior/index.md)**
|
||||
|
||||
[🐝 Cobalt](cobalt.md) 🔗 [game](game.md), [rpg](rpg.md)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## SAMPLES: CUBE
|
||||
|
||||
**[Julia Rings](3d-cube/index.md)**
|
||||
**[3D Cube](3d-cube/index.md)**
|
||||
|
||||
[🐝 Relsoft](relsoft.md) 🔗 [3d](3d.md), [cube](cube.md)
|
||||
|
||||
|
|
21
samples/data-management.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES: DATA MANAGEMENT
|
||||
|
||||
**[Money](money/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [data management](data-management.md)
|
||||
|
||||
Money manager by Microsoft.
|
||||
|
||||
**[Phone](phone/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [data management](data-management.md)
|
||||
|
||||
Simple phone directory by Microsoft.
|
||||
|
||||
**[QCards](qcards/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [data management](data-management.md)
|
||||
|
||||
A simple database using a cardfile user interface by Microsoft.
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## SAMPLES BY DAV
|
||||
|
||||
**[Pipes Puzzle (Maze Connect)](pipes-puzzle/index.md)**
|
||||
**[Pipes Puzzle](pipes-puzzle/index.md)**
|
||||
|
||||
[🐝 Dav](dav.md) 🔗 [game](game.md), [puzzle](puzzle.md)
|
||||
|
||||
|
|
9
samples/defense.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES: DEFENSE
|
||||
|
||||
**[QSpace](qspace/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [defense](defense.md)
|
||||
|
||||
Space station defense game by Microsoft.
|
9
samples/digger.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES: DIGGER
|
||||
|
||||
**[QDigger](qdigger/index.md)**
|
||||
|
||||
[🐝 RETROQB45](retroqb45.md) 🔗 [game](game.md), [digger](digger.md)
|
||||
|
||||
A DIGGER game clone by RETROQB45.
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: DRAGON WARRIOR 64
|
||||
## SAMPLE: DRAGON WARRIOR
|
||||
|
||||
![dragon-warrior-64-gameplay1-screenshot.png](img/dragon-warrior-64-gameplay1-screenshot.png)
|
||||
|
||||
|
|
|
@ -7,3 +7,9 @@
|
|||
[🐝 Bob Seguin](bob-seguin.md) 🔗 [art](art.md), [drawing](drawing.md)
|
||||
|
||||
A Graphics/Animation utility by Bob Seguin. NOTE: This game requires graphics files created by a...
|
||||
|
||||
**[QBAscii](qbascii/index.md)**
|
||||
|
||||
[🐝 Jeremy Munn](jeremy-munn.md) 🔗 [drawing](drawing.md), [ascii](ascii.md)
|
||||
|
||||
'***************************************************************************** ' Name: QB...
|
||||
|
|
|
@ -14,18 +14,36 @@ A pretentious clone attempt of Among Us (originally by Inner Sloth) To test: 1)
|
|||
|
||||
A Breakout clone with DXBall aspirations.
|
||||
|
||||
**[Can't Contain Me](cant-contain-me/index.md)**
|
||||
**[Cant Contain Me](cant-contain-me/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md)
|
||||
|
||||
Can't Contain Me is a game developed in QB64. The pieces are trying to escape your screen and th...
|
||||
|
||||
**[LightsOn](lightson/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md), [lights](lights.md)
|
||||
|
||||
'Lights On 'A game by Fellippe Heitor. ' 'Original concept by Avi Olti, Gyora Benedek, Zvi Herman...
|
||||
|
||||
**[Lissajous Curve Table](lissajous-curve-table/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [graphics](graphics.md), [trigonometry](trigonometry.md)
|
||||
|
||||
Graphical Lissajou's Figures. For added eye-candy-ness, I've changed the plot line to paint usin...
|
||||
|
||||
**[Pendulum Game](pendulum-game/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md), [pendulum](pendulum.md)
|
||||
|
||||
My attempt at creating something drawing inspiration from Fire Rides by Voodoo. Made with QB64.
|
||||
|
||||
**[Platform](platform/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md), [platform](platform.md)
|
||||
|
||||
# Platform What does a 2D platform game take? Made with QB64.
|
||||
|
||||
**[Set Fire to Rain](set-fire-to-rain/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md), [zen](zen.md)
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES BY FELLIPPEHEITOR
|
||||
|
||||
**[Lissajous Curve Table](lissajous-curve-table/index.md)**
|
||||
|
||||
[🐝 FellippeHeitor](fellippeheitor.md) 🔗 [graphics](graphics.md), [trigonometry](trigonometry.md)
|
||||
|
||||
Graphical Lissajou's Figures. For added eye-candy-ness, I've changed the plot line to paint usin...
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: 4 PLAYER PONG
|
||||
## SAMPLE: FOUR PLAYER PONG
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
|
|
|
@ -32,19 +32,19 @@ Automated Julia set explorer.
|
|||
|
||||
Mandelbrot animator.
|
||||
|
||||
**[Mandelbrot](mandelbrot-set-2003/index.md)**
|
||||
**[Mandelbrot Set 2003](mandelbrot-set-2003/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [fractal](fractal.md), [mandelbrot](mandelbrot.md), [9 lines](9-lines.md)
|
||||
|
||||
'MANDELBROT by Antoni Gual 2003 'for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003 '-----------...
|
||||
|
||||
**[Mandelbrot Set](mandelbrot-set-2008/index.md)**
|
||||
**[Mandelbrot Set 2008](mandelbrot-set-2008/index.md)**
|
||||
|
||||
[🐝 qbguy](qbguy.md) 🔗 [fractal](fractal.md), [mandelbrot](mandelbrot.md)
|
||||
|
||||
public domain, uses qb64's 2d prototype
|
||||
|
||||
**[Tor Myklebust](mandelbrot-zoomer/index.md)**
|
||||
**[Mandelbrot Zoomer](mandelbrot-zoomer/index.md)**
|
||||
|
||||
[🐝 *missing*](author-missing.md) 🔗 [fractal](fractal.md), [mandelbrot](mandelbrot.md)
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: BEZIER
|
||||
## SAMPLE: FRACTAL
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Rho Sigma](../rho-sigma.md)
|
||||
[🐝 RhoSigma](../rhosigma.md)
|
||||
|
||||
### Description
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
A pretentious clone attempt of Among Us (originally by Inner Sloth) To test: 1) Compile/run amon...
|
||||
|
||||
**[ArcDemo](arc-demo/index.md)**
|
||||
**[Arc Demo](arc-demo/index.md)**
|
||||
|
||||
[🐝 Tsiplacov Sergey](tsiplacov-sergey.md) 🔗 [game](game.md), [platformer](platformer.md)
|
||||
|
||||
|
@ -26,7 +26,7 @@ This is a game of weapons and destruction that relies upon the properties of phy
|
|||
|
||||
A Breakout clone with DXBall aspirations.
|
||||
|
||||
**[Can't Contain Me](cant-contain-me/index.md)**
|
||||
**[Cant Contain Me](cant-contain-me/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md)
|
||||
|
||||
|
@ -38,13 +38,13 @@ Can't Contain Me is a game developed in QB64. The pieces are trying to escape y
|
|||
|
||||
A turn-based artillery game by Microsoft.
|
||||
|
||||
**[Dragon Warrior 64](dragon-warrior/index.md)**
|
||||
**[Dragon Warrior](dragon-warrior/index.md)**
|
||||
|
||||
[🐝 Cobalt](cobalt.md) 🔗 [game](game.md), [rpg](rpg.md)
|
||||
|
||||
QB64 version of Nintendo Dragon Quest (Dragon Warrior). The time has come to go on your quest to...
|
||||
|
||||
**[4 Player Pong](four-player-pong/index.md)**
|
||||
**[Four Player Pong](four-player-pong/index.md)**
|
||||
|
||||
[🐝 Matthew](matthew.md) 🔗 [game](game.md), [pong](pong.md)
|
||||
|
||||
|
@ -56,18 +56,102 @@ Four-player pong game.
|
|||
|
||||
================================================================================= H E L ...
|
||||
|
||||
**[LightsOn](lightson/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md), [lights](lights.md)
|
||||
|
||||
'Lights On 'A game by Fellippe Heitor. ' 'Original concept by Avi Olti, Gyora Benedek, Zvi Herman...
|
||||
|
||||
**[Mazes of Misery](mazes-of-misery/index.md)**
|
||||
|
||||
[🐝 Steve M.](steve-m..md) 🔗 [game](game.md), [maze](maze.md)
|
||||
|
||||
'Maze of Misery 'By Steve M. (c),May 5,01 '**************** 'Please visit my web page at: www.a...
|
||||
|
||||
**[Moon Lander](moon-lander/index.md)**
|
||||
|
||||
[🐝 Richard Frost](richard-frost.md) 🔗 [game](game.md), [lander](lander.md)
|
||||
|
||||
Lunar Lander based on a 1974 program running on a DEC PDP/11 with GT40 vector display terminal at...
|
||||
|
||||
**[Nibbles](nibbles/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [snake](snake.md)
|
||||
|
||||
Snake clone by Microsoft.
|
||||
|
||||
**[Pendulum Game](pendulum-game/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md), [pendulum](pendulum.md)
|
||||
|
||||
My attempt at creating something drawing inspiration from Fire Rides by Voodoo. Made with QB64.
|
||||
|
||||
**[Pipes Puzzle (Maze Connect)](pipes-puzzle/index.md)**
|
||||
**[Pipes Puzzle](pipes-puzzle/index.md)**
|
||||
|
||||
[🐝 Dav](dav.md) 🔗 [game](game.md), [puzzle](puzzle.md)
|
||||
|
||||
'================ 'PIPES.BAS v1.0 '================ 'Connect the pipes puzzle game 'Coded by ...
|
||||
|
||||
**[Platform](platform/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md), [platform](platform.md)
|
||||
|
||||
# Platform What does a 2D platform game take? Made with QB64.
|
||||
|
||||
**[QBlocks](qblocks/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [tetris](tetris.md)
|
||||
|
||||
Tetris clone by Microsoft.
|
||||
|
||||
**[QBricks](qbricks/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [breakout](breakout.md)
|
||||
|
||||
Breakout clone by Microsoft.
|
||||
|
||||
**[QDigger](qdigger/index.md)**
|
||||
|
||||
[🐝 RETROQB45](retroqb45.md) 🔗 [game](game.md), [digger](digger.md)
|
||||
|
||||
A DIGGER game clone by RETROQB45.
|
||||
|
||||
**[QMaze](qmaze/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [maze](maze.md)
|
||||
|
||||
Maze puzzle game by Microsoft.
|
||||
|
||||
**[QShips](qships/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [artillery](artillery.md)
|
||||
|
||||
Turn-based artillery game by Microsoft.
|
||||
|
||||
**[QSpace](qspace/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [defense](defense.md)
|
||||
|
||||
Space station defense game by Microsoft.
|
||||
|
||||
**[QTrek](qtrek/index.md)**
|
||||
|
||||
[🐝 Philipp Strathausen](philipp-strathausen.md) 🔗 [game](game.md), [space shooter](space-shooter.md)
|
||||
|
||||
Star Trek-like game by Philipp Strathausen.
|
||||
|
||||
**[Rattler](rattler/index.md)**
|
||||
|
||||
[🐝 Bob Seguin](bob-seguin.md) 🔗 [game](game.md), [snake](snake.md)
|
||||
|
||||
Snake clone by Bob Seguin.
|
||||
|
||||
**[Reversi](reversi/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md)
|
||||
|
||||
Reversi game by Microsoft.
|
||||
|
||||
**[Set Fire to Rain](set-fire-to-rain/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md), [zen](zen.md)
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES BY GLEN JEH
|
||||
|
||||
**[Globe](globe/index.md)**
|
||||
|
||||
[🐝 Glen Jeh](glen-jeh.md) [🐝 8/12/1994](8/12/1994.md) [🐝 William Yu (05-28-96)](william-yu-(05-28-96).md) 🔗 [3d](3d.md), [sphere](sphere.md)
|
||||
|
||||
'{A little rotating sphere, by Glen Jeh, 8/12/1994, use freely} '{Try messing with the constants....
|
|
@ -6,11 +6,13 @@
|
|||
|
||||
### Authors
|
||||
|
||||
[🐝 Glen Jeh](../glen-jeh.md) [🐝 8/12/1994](../8/12/1994.md) [🐝 William Yu (05-28-96)](../william-yu-(05-28-96).md)
|
||||
[🐝 Jeh](../jeh.md) [🐝 Yu](../yu.md)
|
||||
|
||||
### Description
|
||||
|
||||
```text
|
||||
Glen Jeh, 8/12/1994, William Yu (05-28-96)
|
||||
|
||||
'{A little rotating sphere, by Glen Jeh, 8/12/1994, use freely}
|
||||
'{Try messing with the constants...code is squished a little}
|
||||
' Converted to BASIC by William Yu (05-28-96)
|
||||
|
|
|
@ -16,10 +16,16 @@ Floormaper by Antoni Gual for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003
|
|||
|
||||
**[Lissajous Curve Table](lissajous-curve-table/index.md)**
|
||||
|
||||
[🐝 FellippeHeitor](fellippeheitor.md) 🔗 [graphics](graphics.md), [trigonometry](trigonometry.md)
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [graphics](graphics.md), [trigonometry](trigonometry.md)
|
||||
|
||||
Graphical Lissajou's Figures. For added eye-candy-ness, I've changed the plot line to paint usin...
|
||||
|
||||
**[PixelPlus](pixelplus/index.md)**
|
||||
|
||||
[🐝 Chris Chadwick](chris-chadwick.md) 🔗 [graphics](graphics.md), [bitmap](bitmap.md)
|
||||
|
||||
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' PIXELplus 256 Us...
|
||||
|
||||
**[SineCube](sinecube/index.md)**
|
||||
|
||||
[🐝 Mennonite](mennonite.md) 🔗 [graphics](graphics.md)
|
||||
|
|
9
samples/jeh.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES BY JEH
|
||||
|
||||
**[Globe](globe/index.md)**
|
||||
|
||||
[🐝 Jeh](jeh.md) [🐝 Yu](yu.md) 🔗 [3d](3d.md), [sphere](sphere.md)
|
||||
|
||||
Glen Jeh, 8/12/1994, William Yu (05-28-96) '{A little rotating sphere, by Glen Jeh, 8/12/1994, u...
|
9
samples/jeremy-munn.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES BY JEREMY MUNN
|
||||
|
||||
**[QBAscii](qbascii/index.md)**
|
||||
|
||||
[🐝 Jeremy Munn](jeremy-munn.md) 🔗 [drawing](drawing.md), [ascii](ascii.md)
|
||||
|
||||
'***************************************************************************** ' Name: QB...
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: BEZIER
|
||||
## SAMPLE: KALEIDOSCOPE MILL
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: BEZIER
|
||||
## SAMPLE: KALEIDOSCOPE
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
|
|
9
samples/lander.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES: LANDER
|
||||
|
||||
**[Moon Lander](moon-lander/index.md)**
|
||||
|
||||
[🐝 Richard Frost](richard-frost.md) 🔗 [game](game.md), [lander](lander.md)
|
||||
|
||||
Lunar Lander based on a 1974 program running on a DEC PDP/11 with GT40 vector display terminal at...
|
|
@ -1,12 +1,12 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: BEZIER
|
||||
## SAMPLE: LIGHTNING ONE
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Rho Sigma](../rho-sigma.md)
|
||||
[🐝 RhoSigma](../rhosigma.md)
|
||||
|
||||
### Description
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: BEZIER
|
||||
## SAMPLE: LIGHTNING TWO
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Rho Sigma](../rho-sigma.md)
|
||||
[🐝 RhoSigma](../rhosigma.md)
|
||||
|
||||
### Description
|
||||
|
||||
|
|
9
samples/lights.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES: LIGHTS
|
||||
|
||||
**[LightsOn](lightson/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md), [lights](lights.md)
|
||||
|
||||
'Lights On 'A game by Fellippe Heitor. ' 'Original concept by Avi Olti, Gyora Benedek, Zvi Herman...
|
BIN
samples/lightson/img/screenshot.png
Normal file
After Width: | Height: | Size: 202 KiB |
BIN
samples/lightson/img/screenshot2.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
samples/lightson/img/screenshot3.png
Normal file
After Width: | Height: | Size: 397 KiB |
34
samples/lightson/index.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: LIGHTSON
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Fellippe Heitor](../fellippe-heitor.md)
|
||||
|
||||
### Description
|
||||
|
||||
```text
|
||||
'Lights On
|
||||
'A game by Fellippe Heitor.
|
||||
'
|
||||
'Original concept by Avi Olti, Gyora Benedek, Zvi Herman, Revital Bloomberg, Avi Weiner and Michael Ganor
|
||||
'https://en.wikipedia.org/wiki/Lights_Out_(game)
|
||||
```
|
||||
|
||||
### File(s)
|
||||
|
||||
* [lightson.bas](src/lightson.bas)
|
||||
* [lightson.zip](src/lightson.zip)
|
||||
|
||||
### Additional Image(s)
|
||||
|
||||
![screenshot2.png](img/screenshot2.png)
|
||||
![screenshot3.png](img/screenshot3.png)
|
||||
|
||||
🔗 [game](../game.md), [lights](../lights.md)
|
||||
|
||||
|
||||
<sub>Reference: [github.com](https://github.com/FellippeHeitor/LightsOn) </sub>
|
919
samples/lightson/src/lightson.bas
Normal file
|
@ -0,0 +1,919 @@
|
|||
'Lights On
|
||||
'A game by Fellippe Heitor - @FellippeHeitor - fellippe@qb64.org
|
||||
'
|
||||
'Original concept by Avi Olti, Gyora Benedek, Zvi Herman, Revital Bloomberg, Avi Weiner and Michael Ganor
|
||||
'https://en.wikipedia.org/wiki/Lights_Out_(game)
|
||||
'
|
||||
'Assets sources acknowledged inside SUB GameSetup
|
||||
|
||||
Option _Explicit
|
||||
|
||||
$ExeIcon:'./assets/lightson.ico'
|
||||
_Icon
|
||||
|
||||
Const true = -1, false = Not true
|
||||
|
||||
Type obj
|
||||
i As Integer
|
||||
j As Integer
|
||||
x As Integer
|
||||
y As Integer
|
||||
w As Integer
|
||||
h As Integer
|
||||
IsOn As _Byte
|
||||
lastSwitch As Single
|
||||
lastHint As Single
|
||||
End Type
|
||||
|
||||
Randomize Timer
|
||||
|
||||
Dim Shared Arena As Long, OverlayScreen As Long, Bg As Long
|
||||
Dim Shared LightOn(1 To 9) As Long, LightOff(1 To 9) As Long
|
||||
Dim Shared RestartIcon As Long, MouseCursor As Long
|
||||
Dim Shared Ding As Long, Piano As Long, Switch As Long, Bonus As Long
|
||||
Dim Shared Arial As Long, FontHeight As Integer
|
||||
Dim Shared maxGridW As Integer, maxGridH As Integer
|
||||
Dim Shared lights(1 To 20, 1 To 20) As obj
|
||||
Dim Shared start!, moves As Integer, m$
|
||||
Dim Shared i As Integer, j As Integer, Level As Integer
|
||||
Dim Shared k As Long, Alpha As Integer
|
||||
Dim Shared maxW As Integer, maxH As Integer
|
||||
Dim Shared MinMoves As Integer, Score As _Unsigned Long
|
||||
Dim Shared TryAgain As _Byte, TutorialMode As _Byte
|
||||
Dim Shared lightID As Integer
|
||||
ReDim Shared Button(1 To 1) As obj, Caption(1 To UBound(Button)) As String
|
||||
|
||||
'from p5js.bas - sound system
|
||||
Type new_SoundHandle
|
||||
handle As Long
|
||||
sync As _Byte
|
||||
End Type
|
||||
ReDim Shared loadedSounds(0) As new_SoundHandle
|
||||
|
||||
GameSetup
|
||||
Intro
|
||||
|
||||
Do
|
||||
SetLevel
|
||||
Do
|
||||
UpdateScore
|
||||
UpdateArena
|
||||
|
||||
_Display
|
||||
|
||||
k = _KeyHit
|
||||
|
||||
If k = 27 Then System
|
||||
|
||||
_Limit 30
|
||||
Loop Until Victory
|
||||
|
||||
'Give time for the last set of bulbs to light up
|
||||
Dim LastBulbs As Single
|
||||
LastBulbs = Timer
|
||||
Do
|
||||
UpdateArena
|
||||
_Display
|
||||
Loop Until Timer - LastBulbs > .3
|
||||
|
||||
EndScreen
|
||||
Loop
|
||||
|
||||
Sub Intro
|
||||
'Show intro
|
||||
If isLoaded(LightOn(1)) And isLoaded(LightOff(1)) Then
|
||||
_Dest OverlayScreen
|
||||
Cls , 0
|
||||
Color _RGB32(255, 255, 255), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth("Lights On!") / 2, _Height - FontHeight * 2), "Lights On!"
|
||||
_Dest 0
|
||||
|
||||
_PutImage (_Width / 2 - _Width(LightOff(1)) / 2, 0), LightOff(1)
|
||||
_Delay .5
|
||||
Alpha = 0
|
||||
p5play Piano
|
||||
_Font 8
|
||||
Do
|
||||
If Alpha < 255 Then Alpha = Alpha + 5 Else Exit Do
|
||||
_SetAlpha Alpha, , OverlayScreen
|
||||
_ClearColor _RGB32(0, 0, 0), OverlayScreen
|
||||
_SetAlpha Alpha, , LightOn(1)
|
||||
|
||||
_PutImage (_Width / 2 - _Width(LightOn(1)) / 2, 0), LightOn(1)
|
||||
_PutImage , OverlayScreen
|
||||
Color _RGBA32(255, 255, 255, Alpha), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth("Fellippe Heitor, 2017") / 2, _Height - FontHeight * 1.5), "Fellippe Heitor, 2017"
|
||||
|
||||
_Display
|
||||
_Limit 20
|
||||
Loop
|
||||
|
||||
_Font 16
|
||||
|
||||
If _FileExists("lightson.dat") = false And isLoaded(MouseCursor) Then
|
||||
'offer tutorial on the first run
|
||||
Dim ii As Integer
|
||||
|
||||
_Dest OverlayScreen
|
||||
Cls , 0
|
||||
m$ = "Show instructions?"
|
||||
Color _RGB32(0, 0, 0), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(m$) / 2 + 1, _Height / 2 - FontHeight * 2 + 1), m$
|
||||
Color _RGB32(255, 255, 255), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(m$) / 2, _Height / 2 - FontHeight * 2), m$
|
||||
_Dest 0
|
||||
|
||||
Do
|
||||
_PutImage (_Width / 2 - _Width(LightOn(1)) / 2, 0), LightOn(1)
|
||||
_PutImage , OverlayScreen
|
||||
|
||||
For ii = 4 To 5
|
||||
If Hovering(Button(ii)) Then
|
||||
Line (Button(ii).x + 5, Button(ii).y + 5)-Step(Button(ii).w, Button(ii).h), _RGB32(0, 0, 0), BF
|
||||
Line (Button(ii).x, Button(ii).y)-Step(Button(ii).w, Button(ii).h), _RGB32(255, 255, 255), BF
|
||||
Else
|
||||
Line (Button(ii).x, Button(ii).y)-Step(Button(ii).w, Button(ii).h), _RGBA32(255, 255, 255, 170), BF
|
||||
End If
|
||||
Color _RGB32(0, 0, 0), 0
|
||||
_PrintString (Button(ii).x + Button(ii).w / 2 - _PrintWidth(Caption(ii)) / 2, Button(ii).y + Button(ii).h / 2 - FontHeight / 2), Caption(ii)
|
||||
Next
|
||||
|
||||
If _MouseButton(1) Then
|
||||
While _MouseButton(1): ii = _MouseInput: Wend
|
||||
If Hovering(Button(5)) Then
|
||||
Exit Do
|
||||
ElseIf Hovering(Button(4)) Then
|
||||
TutorialMode = true
|
||||
ShowTutorial
|
||||
Open "lightson.dat" For Output As #1
|
||||
Close #1
|
||||
TutorialMode = false
|
||||
Exit Do
|
||||
End If
|
||||
End If
|
||||
|
||||
_Display
|
||||
_Limit 30
|
||||
Loop
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub ClickPause
|
||||
Do
|
||||
k = _KeyHit
|
||||
|
||||
While _MouseInput: Wend
|
||||
If _MouseButton(1) Then
|
||||
While _MouseButton(1): i = _MouseInput: Wend
|
||||
Exit Do
|
||||
End If
|
||||
|
||||
_Display
|
||||
_Limit 30
|
||||
Loop Until k = 27 Or k = 13
|
||||
End Sub
|
||||
|
||||
Sub CenteredText (Text$)
|
||||
Dim tWidth As Integer, tHeight As Integer
|
||||
|
||||
tWidth = _PrintWidth(Text$) + 20
|
||||
tHeight = FontHeight * 3
|
||||
|
||||
Line (_Width / 2 - tWidth / 2, _Height / 2 - tHeight / 2)-Step(tWidth - 1, tHeight - 1), _RGBA32(255, 255, 255, 200), BF
|
||||
Color _RGB32(255, 255, 255), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(Text$) / 2 + 1, _Height / 2 - FontHeight / 2 + 1), Text$
|
||||
Color _RGB32(0, 0, 0), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(Text$) / 2, _Height / 2 - FontHeight / 2), Text$
|
||||
End Sub
|
||||
|
||||
Sub StatusText (Text$)
|
||||
Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
|
||||
Cls
|
||||
|
||||
_PrintString (_Width / 2 - _PrintWidth(Text$) / 2, _Height - FontHeight * 1.5), Text$
|
||||
End Sub
|
||||
|
||||
Sub GameSetup
|
||||
'Acknowledgements:
|
||||
'--------------------------------------------------------------------------------------------------------------------
|
||||
'Light bulb images from https://blog.1000bulbs.com/home/flip-the-switch-how-an-incandescent-light-bulb-works
|
||||
'End level bg from http://blog-sap.com/analytics/2013/06/14/sap-lumira-new-software-update-general-availability-of-cloud-version-and-emeauk-flash-sale-at-bi2013/
|
||||
'Ding sound: https://www.freesound.org/people/Flo_Rayen/sounds/191835/
|
||||
'Bonus sound: http://freesound.org/people/LittleRobotSoundFactory/sounds/274183/
|
||||
'Piano sound: https://www.freesound.org/people/FoolBoyMedia/sounds/352655/
|
||||
'Switch sound: https://www.freesound.org/people/Mindloop/sounds/253659/
|
||||
'App icon: http://www.iconarchive.com/show/small-n-flat-icons-by-paomedia/light-bulb-icon.html
|
||||
'Restart icon: http://www.iconarchive.com/show/windows-8-icons-by-icons8/Computer-Hardware-Restart-icon.html
|
||||
'Mouse cursor icon: http://www.iconarchive.com/show/windows-8-icons-by-icons8/Very-Basic-Cursor-icon.html
|
||||
'--------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
'Load assets:
|
||||
Arena = _NewImage(600, 600, 32)
|
||||
|
||||
'Arial = _LOADFONT("arial.ttf", 24)
|
||||
LightOn(1) = loadImage("assets/lighton.png")
|
||||
LightOn(2) = loadImage("assets/lighton300.png")
|
||||
LightOn(3) = loadImage("assets/lighton120.png")
|
||||
LightOn(4) = loadImage("assets/lighton86.png")
|
||||
LightOn(5) = loadImage("assets/lighton67.png")
|
||||
LightOn(6) = loadImage("assets/lighton60.png")
|
||||
LightOn(7) = loadImage("assets/lighton55.png")
|
||||
LightOn(8) = loadImage("assets/lighton35.png")
|
||||
LightOn(9) = loadImage("assets/lighton30.png")
|
||||
|
||||
LightOff(1) = loadImage("assets/lightoff.png")
|
||||
LightOff(2) = loadImage("assets/lightoff300.png")
|
||||
LightOff(3) = loadImage("assets/lightoff120.png")
|
||||
LightOff(4) = loadImage("assets/lightoff86.png")
|
||||
LightOff(5) = loadImage("assets/lightoff67.png")
|
||||
LightOff(6) = loadImage("assets/lightoff60.png")
|
||||
LightOff(7) = loadImage("assets/lightoff55.png")
|
||||
LightOff(8) = loadImage("assets/lightoff35.png")
|
||||
LightOff(9) = loadImage("assets/lightoff30.png")
|
||||
|
||||
Bg = loadImage("assets/bg.jpg")
|
||||
RestartIcon = loadImage("assets/restart.png")
|
||||
MouseCursor = loadImage("assets/mouse.png")
|
||||
|
||||
Ding = loadSound("assets/ding.wav")
|
||||
Piano = loadSound("assets/piano.ogg")
|
||||
Switch = loadSound("assets/switch.wav")
|
||||
Bonus = loadSound("assets/bonus.wav")
|
||||
|
||||
If isLoaded(Bg) Then _SetAlpha 30, , Bg
|
||||
If Arial > 0 Then FontHeight = _FontHeight(Arial) Else FontHeight = 16
|
||||
|
||||
If Arial > 0 Then
|
||||
_Font Arial
|
||||
_Dest OverlayScreen
|
||||
_Font Arial
|
||||
_Dest 0
|
||||
End If
|
||||
|
||||
'Screen setup:
|
||||
Screen _NewImage(600, 600 + FontHeight * 2, 32)
|
||||
Do Until _ScreenExists: _Limit 30: Loop
|
||||
_Title "Lights On" + Chr$(0)
|
||||
|
||||
OverlayScreen = _NewImage(_Width / 2, _Height / 2, 32)
|
||||
|
||||
'Set buttons:
|
||||
ReDim Button(1 To 5) As obj, Caption(1 To UBound(Button)) As String
|
||||
|
||||
Dim b As Integer
|
||||
b = b + 1: Caption(b) = "Try again"
|
||||
Button(b).y = _Height / 2 + FontHeight * 11.5
|
||||
Button(b).w = _PrintWidth(Caption(b)) + 40
|
||||
Button(b).x = _Width / 2 - 10 - Button(b).w
|
||||
Button(b).h = 40
|
||||
|
||||
b = b + 1: Caption(b) = "Next level"
|
||||
Button(b).y = _Height / 2 + FontHeight * 11.5
|
||||
Button(b).w = _PrintWidth(Caption(b)) + 40
|
||||
Button(b).x = _Width / 2 + 10
|
||||
Button(b).h = 40
|
||||
|
||||
b = b + 1: Caption(b) = "Restart level"
|
||||
If isLoaded(RestartIcon) Then
|
||||
Button(b).w = _Width(RestartIcon) + 20
|
||||
Button(b).h = FontHeight * 2
|
||||
Button(b).x = _Width - Button(b).w - 10
|
||||
Button(b).y = _Height - FontHeight - Button(b).h / 2
|
||||
Else
|
||||
Button(b).h = FontHeight * 2
|
||||
Button(b).w = _PrintWidth(Caption(b)) + 20
|
||||
Button(b).x = _Width - 10 - Button(b).w
|
||||
Button(b).y = _Height - Button(b).h
|
||||
End If
|
||||
|
||||
b = b + 1: Caption(b) = "Yes"
|
||||
Button(b).y = _Height / 2 - FontHeight / 2
|
||||
Button(b).w = _PrintWidth(Caption(b)) + 40
|
||||
Button(b).x = _Width / 2 - 10 - Button(b).w
|
||||
Button(b).h = 40
|
||||
|
||||
b = b + 1: Caption(b) = "No"
|
||||
Button(b).y = _Height / 2 - FontHeight / 2
|
||||
Button(b).w = _PrintWidth(Caption(b)) + 40
|
||||
Button(b).x = _Width / 2 + 10
|
||||
Button(b).h = 40
|
||||
End Sub
|
||||
|
||||
Function loadImage& (file$)
|
||||
Dim tempHandle&
|
||||
|
||||
If _FileExists(file$) = 0 Then Exit Function
|
||||
|
||||
tempHandle& = _LoadImage(file$, 32)
|
||||
If tempHandle& = -1 Then 'load failed
|
||||
tempHandle& = 0
|
||||
End If
|
||||
|
||||
loadImage& = tempHandle&
|
||||
End Function
|
||||
|
||||
Function isLoaded%% (imgHandle&)
|
||||
isLoaded%% = imgHandle& < -1
|
||||
End Function
|
||||
|
||||
Sub SetLevel
|
||||
If Not TryAgain Then Level = Level + 1
|
||||
|
||||
Dim LevelSettings As Integer
|
||||
If Level <= 15 Then LevelSettings = Level Else LevelSettings = _Ceil(Rnd * 13) + 2
|
||||
|
||||
Select Case LevelSettings
|
||||
Case 1
|
||||
maxGridW = 1
|
||||
maxGridH = 2
|
||||
MinMoves = 2
|
||||
lightID = 2
|
||||
Case 2
|
||||
maxGridW = 2
|
||||
maxGridH = 2
|
||||
MinMoves = 1
|
||||
lightID = 2
|
||||
Case 3, 4
|
||||
maxGridW = 4
|
||||
maxGridH = 5
|
||||
MinMoves = 11
|
||||
lightID = 3
|
||||
Case 5
|
||||
maxGridW = 5
|
||||
maxGridH = 7
|
||||
MinMoves = 65
|
||||
lightID = 4
|
||||
Case 6
|
||||
maxGridW = 10
|
||||
maxGridH = 10
|
||||
MinMoves = 65
|
||||
lightID = 6
|
||||
Case 7, 8
|
||||
maxGridW = 7
|
||||
maxGridH = 9
|
||||
MinMoves = 90
|
||||
lightID = 5
|
||||
Case 9, 10
|
||||
maxGridW = 7
|
||||
maxGridH = 11
|
||||
MinMoves = 130
|
||||
lightID = 7
|
||||
Case 11, 12
|
||||
maxGridW = 9
|
||||
maxGridH = 11
|
||||
MinMoves = 90
|
||||
lightID = 7
|
||||
Case 13, 14
|
||||
maxGridW = 11
|
||||
maxGridH = 17
|
||||
MinMoves = 180
|
||||
lightID = 8
|
||||
Case Else
|
||||
maxGridW = 20
|
||||
maxGridH = 20
|
||||
MinMoves = 230
|
||||
lightID = 9
|
||||
End Select
|
||||
|
||||
maxW = _Width(Arena) / maxGridW
|
||||
maxH = _Height(Arena) / maxGridH
|
||||
|
||||
For i = 1 To maxGridW
|
||||
For j = 1 To maxGridH
|
||||
lights(i, j).x = i * maxW - maxW
|
||||
lights(i, j).y = j * maxH - maxH
|
||||
lights(i, j).w = maxW - 1
|
||||
lights(i, j).h = maxH - 1
|
||||
lights(i, j).i = i
|
||||
lights(i, j).j = j
|
||||
lights(i, j).IsOn = false
|
||||
Next
|
||||
Next
|
||||
|
||||
Dim rndState As Integer
|
||||
For rndState = 1 To maxGridW / 3
|
||||
i = _Ceil(Rnd * maxGridW)
|
||||
j = _Ceil(Rnd * maxGridH)
|
||||
SetState lights(i, j)
|
||||
Next
|
||||
|
||||
start! = Timer
|
||||
moves = 0
|
||||
End Sub
|
||||
|
||||
Sub EndScreen
|
||||
UpdateArena
|
||||
_Dest 0
|
||||
_PutImage (0, 0), Arena
|
||||
|
||||
Dim EndAnimationStep As Integer, FinalBonus As _Byte
|
||||
Dim SlideOpen As Integer, SlideVelocity As Single
|
||||
Dim Snd1 As _Byte, Snd2 As _Byte, Snd3 As _Byte
|
||||
Dim FinalLamp1!, FinalLamp2!, FinalLamp3!
|
||||
Dim SkipEndAnimation As _Byte
|
||||
Dim BgXOffset As Single, BgYOffset As Single
|
||||
Dim BgXSpeed As Single, BgYSpeed As Single
|
||||
|
||||
Snd1 = false: Snd2 = false: Snd3 = false
|
||||
FinalBonus = false
|
||||
|
||||
If isLoaded(LightOn(3)) Then _SetAlpha 255, , LightOn(3)
|
||||
|
||||
Alpha = 0
|
||||
TryAgain = false
|
||||
EndAnimationStep = 1
|
||||
SkipEndAnimation = false
|
||||
|
||||
BgXSpeed = .5
|
||||
BgYSpeed = .3
|
||||
If isLoaded(Bg) Then
|
||||
BgXOffset = _Width(Bg) - _Width * 1.5
|
||||
BgYOffset = _Height(Bg) - _Height * 1.5
|
||||
End If
|
||||
|
||||
p5play Piano
|
||||
Do
|
||||
While _MouseInput: Wend
|
||||
|
||||
If EndAnimationStep < 70 Then
|
||||
_Dest OverlayScreen
|
||||
Cls , 0
|
||||
m$ = "Level" + Str$(Level) + " - All Lights On!"
|
||||
Color _RGB32(0, 0, 0), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(m$) / 2 + 1, _Height / 2 - 80 - FontHeight + 1), m$
|
||||
Color _RGB32(255, 255, 255), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(m$) / 2, _Height / 2 - 80 - FontHeight), m$
|
||||
|
||||
m$ = "Moves used:" + Str$(moves)
|
||||
Color _RGB32(0, 0, 0), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(m$) / 2 + 1, _Height / 2 + FontHeight * 2.5 + 1), m$
|
||||
Color _RGB32(255, 255, 255), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(m$) / 2, _Height / 2 + FontHeight * 2.5), m$
|
||||
|
||||
m$ = "Score:" + Str$(Score)
|
||||
Color _RGB32(0, 0, 0), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(m$) / 2 + 1, _Height / 2 + FontHeight * 3.5 + 1), m$
|
||||
Color _RGB32(255, 255, 255), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(m$) / 2, _Height / 2 + FontHeight * 3.5), m$
|
||||
End If
|
||||
|
||||
_Dest 0
|
||||
|
||||
BgXOffset = BgXOffset + BgXSpeed
|
||||
BgYOffset = BgYOffset + BgYSpeed
|
||||
If isLoaded(Bg) Then
|
||||
If BgXOffset < 0 Or BgXOffset + _Width - 1 > _Width(Bg) Then BgXSpeed = BgXSpeed * -1
|
||||
If BgYOffset < 0 Or BgYOffset + _Height - 1 > _Height(Bg) Then BgYSpeed = BgYSpeed * -1
|
||||
_PutImage (0, 0)-Step(_Width - 1, _Height - 1), Bg, , (BgXOffset, BgYOffset)-Step(_Width - 1, _Height - 1)
|
||||
End If
|
||||
Select Case EndAnimationStep
|
||||
Case 1
|
||||
If Alpha < 255 Then Alpha = Alpha + 10 Else EndAnimationStep = 2: SlideOpen = 0: SlideVelocity = 30: Alpha = 0
|
||||
If Not isLoaded(Bg) Then
|
||||
Line (0, 0)-(_Width, _Height), _RGBA32(255, 255, 0, Alpha), BF
|
||||
Line (0, 0)-(_Width, _Height), _RGBA32(255, 255, 255, Alpha), BF
|
||||
End If
|
||||
_PutImage , OverlayScreen
|
||||
Case 2
|
||||
If Not isLoaded(Bg) Then Line (0, 0)-(_Width, _Height), _RGBA32(255, 255, 255, 30), BF
|
||||
SlideVelocity = SlideVelocity - .2
|
||||
If SlideVelocity < 1 Then SlideVelocity = 1
|
||||
If SlideOpen < 600 Then
|
||||
SlideOpen = SlideOpen + SlideVelocity
|
||||
Else
|
||||
SlideOpen = 600
|
||||
EndAnimationStep = 3
|
||||
i = _Width / 2 - (SlideOpen / 3.5)
|
||||
j = _Height / 2 - SlideOpen / 5 + FontHeight * 1.5
|
||||
End If
|
||||
|
||||
_PutImage , OverlayScreen
|
||||
Dim b As Integer
|
||||
b = map(SlideOpen, 0, 600, 255, 0)
|
||||
Line (0, _Height / 2 - 125 + FontHeight * 1.5)-Step(SlideOpen, 130), _RGB32(255, 255, 255), BF
|
||||
Line (0, _Height / 2 - 120 + FontHeight * 1.5)-Step(SlideOpen, 120), _RGB32(b * 1.5, b * 1.5 - 50, 0), BF
|
||||
Case Is >= 3
|
||||
EndAnimationStep = EndAnimationStep + 1
|
||||
If Not isLoaded(Bg) Then Line (0, 0)-(_Width, _Height), _RGBA32(255, 255, 255, 40), BF
|
||||
_PutImage , OverlayScreen
|
||||
Line (0, _Height / 2 - 125 + FontHeight * 1.5)-Step(SlideOpen, 130), _RGB32(255, 255, 255), BF
|
||||
Line (0, _Height / 2 - 120 + FontHeight * 1.5)-Step(SlideOpen, 120), _RGB32(b, b - 20, 0), BF
|
||||
|
||||
If isLoaded(LightOff(3)) Then
|
||||
_PutImage (i, j), LightOff(3)
|
||||
_PutImage (i + SlideOpen / 5, j), LightOff(3)
|
||||
_PutImage (i + (SlideOpen / 5) * 2, j), LightOff(3)
|
||||
End If
|
||||
|
||||
If EndAnimationStep >= 3 Then
|
||||
If MinMoves <= MinMoves * 3 Then
|
||||
If Snd1 = false Then p5play Ding: Snd1 = true
|
||||
If EndAnimationStep = 4 Then FinalLamp1! = Timer: Score = Score + 20
|
||||
|
||||
If EndAnimationStep <= 20 Then
|
||||
Score = Score + 10
|
||||
If Not SkipEndAnimation Then p5play Switch
|
||||
End If
|
||||
|
||||
If isLoaded(LightOn(3)) Then
|
||||
_SetAlpha constrain(map(Timer - FinalLamp1!, 0, .3, 0, 255), 0, 255), , LightOn(3)
|
||||
_PutImage (i, j), LightOn(3)
|
||||
Else
|
||||
Line (i, j)-Step(SlideOpen / 5, SlideOpen / 5), _RGB32(111, 227, 39), BF
|
||||
Line (i, j)-Step(SlideOpen / 5, SlideOpen / 5), _RGB32(0, 0, 0), B
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If EndAnimationStep > 20 Then
|
||||
If moves <= MinMoves * 2 Then
|
||||
If Snd2 = false Then p5play Ding: Snd2 = true
|
||||
If EndAnimationStep = 21 Then FinalLamp2! = Timer: Score = Score + 20
|
||||
|
||||
If EndAnimationStep <= 40 Then
|
||||
Score = Score + 10
|
||||
If Not SkipEndAnimation Then p5play Switch
|
||||
End If
|
||||
|
||||
If isLoaded(LightOn(3)) Then
|
||||
_SetAlpha constrain(map(Timer - FinalLamp2!, 0, .3, 0, 255), 0, 255), , LightOn(3)
|
||||
_PutImage (i + SlideOpen / 5, j), LightOn(3)
|
||||
Else
|
||||
Line (i + SlideOpen / 5, j)-Step(SlideOpen / 5, SlideOpen / 5), _RGB32(111, 227, 39), BF
|
||||
Line (i + SlideOpen / 5, j)-Step(SlideOpen / 5, SlideOpen / 5), _RGB32(0, 0, 0), B
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If EndAnimationStep > 40 Then
|
||||
If moves <= MinMoves Then
|
||||
If Snd3 = false Then p5play Ding: Snd3 = true
|
||||
If EndAnimationStep = 41 Then FinalLamp3! = Timer: Score = Score + 20
|
||||
|
||||
If EndAnimationStep <= 60 Then
|
||||
Score = Score + 10
|
||||
If Not SkipEndAnimation Then p5play Switch
|
||||
End If
|
||||
|
||||
If isLoaded(LightOn(3)) Then
|
||||
_SetAlpha constrain(map(Timer - FinalLamp3!, 0, .3, 0, 255), 0, 255), , LightOn(3)
|
||||
_PutImage (i + (SlideOpen / 5) * 2, j), LightOn(3)
|
||||
Else
|
||||
Line (i + (SlideOpen / 5) * 2, j)-Step(SlideOpen / 5, SlideOpen / 5), _RGB32(111, 227, 39), BF
|
||||
Line (i + (SlideOpen / 5) * 2, j)-Step(SlideOpen / 5, SlideOpen / 5), _RGB32(0, 0, 0), B
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If EndAnimationStep > 60 Then
|
||||
If FinalBonus = false Then
|
||||
FinalBonus = true
|
||||
If moves < MinMoves Then
|
||||
Score = Score + 50
|
||||
p5play Bonus
|
||||
End If
|
||||
Else
|
||||
If moves < MinMoves Then
|
||||
m$ = "Strategy master! +50 bonus points!"
|
||||
Color _RGB32(0, 0, 0), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(m$) / 2 + 1, _Height / 2 + FontHeight * 9.5 + 1), m$
|
||||
Color _RGB32(255, 255, 255), 0
|
||||
_PrintString (_Width / 2 - _PrintWidth(m$) / 2, _Height / 2 + FontHeight * 9.5), m$
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
|
||||
'Buttons
|
||||
If EndAnimationStep > 60 Then
|
||||
Dim ii As Integer
|
||||
For ii = 1 To 2
|
||||
If Hovering(Button(ii)) Then
|
||||
Line (Button(ii).x + 5, Button(ii).y + 5)-Step(Button(ii).w, Button(ii).h), _RGB32(0, 0, 0), BF
|
||||
Line (Button(ii).x, Button(ii).y)-Step(Button(ii).w, Button(ii).h), _RGB32(255, 255, 255), BF
|
||||
Else
|
||||
Line (Button(ii).x, Button(ii).y)-Step(Button(ii).w, Button(ii).h), _RGBA32(255, 255, 255, 20), BF
|
||||
End If
|
||||
'COLOR _RGB32(255, 255, 255), 0
|
||||
'_PRINTSTRING (Button(ii).x + Button(ii).w / 2 - _PRINTWIDTH(Caption(ii)) / 2 + 1, Button(ii).y + Button(ii).h / 2 - FontHeight / 2 + 1), Caption(ii)
|
||||
Color _RGB32(0, 0, 0), 0
|
||||
_PrintString (Button(ii).x + Button(ii).w / 2 - _PrintWidth(Caption(ii)) / 2, Button(ii).y + Button(ii).h / 2 - FontHeight / 2), Caption(ii)
|
||||
Next
|
||||
End If
|
||||
|
||||
_Display
|
||||
|
||||
k = _KeyHit
|
||||
|
||||
If k = 13 And EndAnimationStep > 60 Then Exit Do
|
||||
If k = 27 Then System
|
||||
|
||||
If _MouseButton(1) And EndAnimationStep > 60 Then
|
||||
While _MouseButton(1): ii = _MouseInput: Wend
|
||||
If Hovering(Button(1)) Then
|
||||
TryAgain = true
|
||||
Exit Do
|
||||
ElseIf Hovering(Button(2)) Then
|
||||
Exit Do
|
||||
End If
|
||||
ElseIf _MouseButton(1) Then
|
||||
SkipEndAnimation = true
|
||||
End If
|
||||
|
||||
If Not SkipEndAnimation Then _Limit 30
|
||||
Loop
|
||||
End Sub
|
||||
|
||||
Sub UpdateArena
|
||||
Dim imgWidth As Integer, imgHeight As Integer
|
||||
Dim FoundHover As _Byte
|
||||
|
||||
imgHeight = lights(1, 1).h
|
||||
imgWidth = imgHeight
|
||||
|
||||
_Dest Arena
|
||||
Cls
|
||||
For i = 1 To maxGridW
|
||||
For j = 1 To maxGridH
|
||||
If isLoaded(LightOff(lightID)) Then
|
||||
_PutImage (lights(i, j).x + lights(i, j).w / 2 - imgWidth / 2, lights(i, j).y), LightOff(lightID)
|
||||
End If
|
||||
If lights(i, j).IsOn Then
|
||||
If isLoaded(LightOn(lightID)) Then
|
||||
If Timer - lights(i, j).lastSwitch < .3 Then
|
||||
_SetAlpha constrain(map(Timer - lights(i, j).lastSwitch, 0, .3, 0, 255), 0, 255), , LightOn(lightID)
|
||||
Else
|
||||
_SetAlpha 255, , LightOn(lightID)
|
||||
End If
|
||||
_PutImage (lights(i, j).x + lights(i, j).w / 2 - imgWidth / 2, lights(i, j).y), LightOn(lightID)
|
||||
Else
|
||||
Line (lights(i, j).x, lights(i, j).y)-Step(lights(i, j).w, lights(i, j).h), _RGB32(111, 227, 39), BF
|
||||
End If
|
||||
End If
|
||||
If Hovering(lights(i, j)) And FoundHover = false And TutorialMode = false Then
|
||||
FoundHover = true
|
||||
Line (lights(i, j).x, lights(i, j).y)-Step(lights(i, j).w, lights(i, j).h), _RGBA32(255, 255, 255, 100), BF
|
||||
CheckState lights(i, j)
|
||||
End If
|
||||
Line (lights(i, j).x, lights(i, j).y)-Step(lights(i, j).w, lights(i, j).h), , B
|
||||
Next
|
||||
Next
|
||||
_Dest 0
|
||||
_PutImage (0, 0), Arena
|
||||
End Sub
|
||||
|
||||
Sub UpdateScore
|
||||
Dim seconds%
|
||||
Color _RGB32(0, 0, 0), _RGB32(255, 255, 255)
|
||||
Cls
|
||||
|
||||
If Timer > start! Then
|
||||
seconds% = Timer - start!
|
||||
Else
|
||||
seconds% = 86400 - start: start! = Timer
|
||||
End If
|
||||
|
||||
m$ = "Level:" + Str$(Level) + " (" + LTrim$(Str$(maxGridW)) + "x" + LTrim$(Str$(maxGridH)) + ") Moves:" + Str$(moves) + " Time elapsed:" + Str$(seconds%) + "s"
|
||||
_PrintString (10, _Height - FontHeight * 1.5), m$
|
||||
|
||||
If Hovering(Button(3)) Then
|
||||
Line (Button(3).x, Button(3).y)-Step(Button(3).w - 1, Button(3).h - 1), _RGB32(127, 127, 127), BF
|
||||
If _MouseButton(1) Then
|
||||
While _MouseButton(1): i = _MouseInput: Wend
|
||||
If Hovering(Button(3)) Then
|
||||
TryAgain = true: SetLevel
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If isLoaded(RestartIcon) Then
|
||||
_PutImage (Button(3).x + Button(3).w / 2 - _Width(RestartIcon) / 2, Button(3).y + Button(3).h / 2 - _Height(RestartIcon) / 2), RestartIcon
|
||||
Else
|
||||
Color _RGB32(0, 0, 0), 0
|
||||
_PrintString (Button(3).x + Button(3).w / 2 - _PrintWidth(Caption(3)) / 2, Button(3).y + Button(3).h / 2 - FontHeight / 2), Caption(3)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Function Victory%%
|
||||
Dim i As Integer, j As Integer
|
||||
For i = 1 To maxGridW
|
||||
For j = 1 To maxGridH
|
||||
If lights(i, j).IsOn = false Then Exit Function
|
||||
Next
|
||||
Next
|
||||
|
||||
Victory%% = true
|
||||
End Function
|
||||
|
||||
Sub CheckState (object As obj)
|
||||
Dim i As Integer
|
||||
|
||||
If _MouseButton(1) Then
|
||||
While _MouseButton(1): i = _MouseInput: Wend
|
||||
If Hovering(object) Then
|
||||
p5play Switch
|
||||
moves = moves + 1
|
||||
SetState object
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub SetState (object As obj)
|
||||
Dim ioff As Integer, joff As Integer
|
||||
ioff = -1
|
||||
joff = 0
|
||||
If object.i + ioff > 0 And object.i + ioff < maxGridW + 1 And object.j + joff > 0 And object.j + joff < maxGridH + 1 Then
|
||||
lights(object.i + ioff, object.j + joff).IsOn = Not lights(object.i + ioff, object.j + joff).IsOn
|
||||
lights(object.i + ioff, object.j + joff).lastSwitch = Timer
|
||||
End If
|
||||
|
||||
ioff = 1
|
||||
joff = 0
|
||||
If object.i + ioff > 0 And object.i + ioff < maxGridW + 1 And object.j + joff > 0 And object.j + joff < maxGridH + 1 Then
|
||||
lights(object.i + ioff, object.j + joff).IsOn = Not lights(object.i + ioff, object.j + joff).IsOn
|
||||
lights(object.i + ioff, object.j + joff).lastSwitch = Timer
|
||||
End If
|
||||
|
||||
ioff = 0
|
||||
joff = -1
|
||||
If object.i + ioff > 0 And object.i + ioff < maxGridW + 1 And object.j + joff > 0 And object.j + joff < maxGridH + 1 Then
|
||||
lights(object.i + ioff, object.j + joff).IsOn = Not lights(object.i + ioff, object.j + joff).IsOn
|
||||
lights(object.i + ioff, object.j + joff).lastSwitch = Timer
|
||||
End If
|
||||
|
||||
ioff = 0
|
||||
joff = 1
|
||||
If object.i + ioff > 0 And object.i + ioff < maxGridW + 1 And object.j + joff > 0 And object.j + joff < maxGridH + 1 Then
|
||||
lights(object.i + ioff, object.j + joff).IsOn = Not lights(object.i + ioff, object.j + joff).IsOn
|
||||
lights(object.i + ioff, object.j + joff).lastSwitch = Timer
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Function Hovering%% (object As obj)
|
||||
While _MouseInput: Wend
|
||||
Hovering%% = _MouseX > object.x And _MouseX < object.x + object.w And _MouseY > object.y And _MouseY < object.y + object.h
|
||||
End Function
|
||||
|
||||
Sub MoveMouse (sx As Integer, sy As Integer, dx As Integer, dy As Integer)
|
||||
Dim stepX As Single, stepY As Single
|
||||
Dim i As _Byte
|
||||
|
||||
Const maxSteps = 30
|
||||
|
||||
stepX = (dx - sx) / maxSteps
|
||||
stepY = (dy - sy) / maxSteps
|
||||
|
||||
For i = 1 To maxSteps
|
||||
sx = sx + stepX
|
||||
sy = sy + stepY
|
||||
UpdateArena
|
||||
_PutImage (sx, sy), MouseCursor
|
||||
_Display
|
||||
_Limit 30
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub ShowTutorial
|
||||
Dim i As Integer, j As Integer
|
||||
Dim mx As Integer, my As Integer
|
||||
Dim StepNumber As Integer, TotalSteps As Integer
|
||||
|
||||
Level = 2
|
||||
SetLevel
|
||||
TotalSteps = 5
|
||||
|
||||
StatusText "Tutorial Mode - Click to proceed"
|
||||
UpdateArena
|
||||
StepNumber = StepNumber + 1
|
||||
CenteredText "(" + LTrim$(Str$(StepNumber)) + "/" + LTrim$(Str$(TotalSteps)) + ") Your goal is to turn all light bulbs on."
|
||||
|
||||
mx = 400
|
||||
my = 400
|
||||
_PutImage (mx, my), MouseCursor
|
||||
|
||||
_Display
|
||||
ClickPause
|
||||
If k = 27 Then Level = 0: Exit Sub
|
||||
|
||||
For i = 1 To maxGridW
|
||||
For j = 1 To maxGridH
|
||||
lights(i, j).IsOn = false
|
||||
Next
|
||||
Next
|
||||
|
||||
UpdateArena
|
||||
StepNumber = StepNumber + 1
|
||||
CenteredText "(" + LTrim$(Str$(StepNumber)) + "/" + LTrim$(Str$(TotalSteps)) + ") However, you can't simply switch a light bulb on or off directly."
|
||||
|
||||
mx = 400
|
||||
my = 400
|
||||
_PutImage (mx, my), MouseCursor
|
||||
|
||||
_Display
|
||||
|
||||
ClickPause
|
||||
If k = 27 Then Level = 0: Exit Sub
|
||||
|
||||
UpdateArena
|
||||
StepNumber = StepNumber + 1
|
||||
CenteredText "(" + LTrim$(Str$(StepNumber)) + "/" + LTrim$(Str$(TotalSteps)) + ") You click a light bulb to turn the surrounding ones on/off."
|
||||
_PutImage (mx, my), MouseCursor
|
||||
_Display
|
||||
|
||||
ClickPause
|
||||
If k = 27 Then Level = 0: Exit Sub
|
||||
|
||||
MoveMouse mx, my, lights(2, 2).x + lights(2, 2).w / 2, lights(2, 2).y + lights(2, 2).h / 2
|
||||
SetState lights(2, 2)
|
||||
p5play Switch
|
||||
Do
|
||||
UpdateArena
|
||||
_PutImage (mx, my), MouseCursor
|
||||
_Display
|
||||
Loop Until Timer - lights(2, 1).lastSwitch > .3
|
||||
|
||||
UpdateArena
|
||||
_PutImage (mx, my), MouseCursor
|
||||
StepNumber = StepNumber + 1
|
||||
CenteredText "(" + LTrim$(Str$(StepNumber)) + "/" + LTrim$(Str$(TotalSteps)) + ") Continue until all light bulbs are on."
|
||||
_Display
|
||||
|
||||
ClickPause
|
||||
If k = 27 Then Level = 0: Exit Sub
|
||||
|
||||
MoveMouse mx, my, lights(3, 2).x + lights(3, 2).w / 2, lights(3, 2).y + lights(3, 2).h / 2
|
||||
SetState lights(3, 2)
|
||||
p5play Switch
|
||||
Do
|
||||
UpdateArena
|
||||
_PutImage (mx, my), MouseCursor
|
||||
_Display
|
||||
Loop Until Timer - lights(3, 1).lastSwitch > .3
|
||||
|
||||
UpdateArena
|
||||
StepNumber = StepNumber + 1
|
||||
_PutImage (mx, my), MouseCursor
|
||||
CenteredText "(" + LTrim$(Str$(StepNumber)) + "/" + LTrim$(Str$(TotalSteps)) + ") Simple right? Click to start."
|
||||
_Display
|
||||
|
||||
ClickPause
|
||||
|
||||
Level = 0
|
||||
Exit Sub
|
||||
End Sub
|
||||
|
||||
'functions below are borrowed from p5js.bas:
|
||||
Function map! (value!, minRange!, maxRange!, newMinRange!, newMaxRange!)
|
||||
map! = ((value! - minRange!) / (maxRange! - minRange!)) * (newMaxRange! - newMinRange!) + newMinRange!
|
||||
End Function
|
||||
|
||||
Function min! (a!, b!)
|
||||
If a! < b! Then min! = a! Else min! = b!
|
||||
End Function
|
||||
|
||||
Function max! (a!, b!)
|
||||
If a! > b! Then max! = a! Else max! = b!
|
||||
End Function
|
||||
|
||||
Function constrain! (n!, low!, high!)
|
||||
constrain! = max(min(n!, high!), low!)
|
||||
End Function
|
||||
|
||||
Function loadSound& (file$)
|
||||
If _FileExists(file$) = 0 Then Exit Function
|
||||
Dim tempHandle&, setting$
|
||||
Static totalLoadedSounds As Long
|
||||
|
||||
setting$ = "vol"
|
||||
|
||||
Select Case UCase$(Right$(file$, 4))
|
||||
Case ".WAV", ".OGG", ".AIF", ".RIF", ".VOC"
|
||||
setting$ = "vol,sync,len,pause"
|
||||
Case ".MP3"
|
||||
setting$ = "vol,pause,setpos"
|
||||
End Select
|
||||
|
||||
tempHandle& = _SndOpen(file$, setting$)
|
||||
If tempHandle& > 0 Then
|
||||
totalLoadedSounds = totalLoadedSounds + 1
|
||||
ReDim _Preserve loadedSounds(totalLoadedSounds) As new_SoundHandle
|
||||
loadedSounds(totalLoadedSounds).handle = tempHandle&
|
||||
loadedSounds(totalLoadedSounds).sync = InStr(setting$, "sync") > 0
|
||||
loadSound& = tempHandle&
|
||||
End If
|
||||
End Function
|
||||
|
||||
Sub p5play (soundHandle&)
|
||||
Dim i As Long
|
||||
For i = 1 To UBound(loadedSounds)
|
||||
If loadedSounds(i).handle = soundHandle& Then
|
||||
If loadedSounds(i).sync Then
|
||||
_SndPlayCopy soundHandle&
|
||||
Else
|
||||
If Not _SndPlaying(soundHandle&) Then _SndPlay soundHandle&
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
BIN
samples/lightson/src/lightson.zip
Normal file
|
@ -6,7 +6,7 @@
|
|||
|
||||
### Author
|
||||
|
||||
[🐝 FellippeHeitor](../fellippeheitor.md)
|
||||
[🐝 Fellippe Heitor](../fellippe-heitor.md)
|
||||
|
||||
### Description
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: ROTATING LORENZ ATTRACTOR
|
||||
## SAMPLE: LORENZ ATTRACTOR
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## SAMPLES: LORENZ
|
||||
|
||||
**[Rotating Lorenz Attractor](lorenz-attractor/index.md)**
|
||||
**[Lorenz Attractor](lorenz-attractor/index.md)**
|
||||
|
||||
[🐝 Vince](vince.md) 🔗 [lorenz](lorenz.md), [rotations](rotations.md)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: MANDALA 9 LINE
|
||||
## SAMPLE: MANADLA
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: MANDELBROT
|
||||
## SAMPLE: MANDELBROT SET 2003
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: MANDELBROT SET
|
||||
## SAMPLE: MANDELBROT SET 2008
|
||||
|
||||
![qbguymandel.png](img/qbguymandel.png)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: TOR MYKLEBUST
|
||||
## SAMPLE: MANDELBROT ZOOMER
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
|
|
|
@ -8,19 +8,19 @@
|
|||
|
||||
Mandelbrot animator.
|
||||
|
||||
**[Mandelbrot](mandelbrot-set-2003/index.md)**
|
||||
**[Mandelbrot Set 2003](mandelbrot-set-2003/index.md)**
|
||||
|
||||
[🐝 Antoni Gual](antoni-gual.md) 🔗 [fractal](fractal.md), [mandelbrot](mandelbrot.md), [9 lines](9-lines.md)
|
||||
|
||||
'MANDELBROT by Antoni Gual 2003 'for Rel's 9 LINER contest at QBASICNEWS.COM 1/2003 '-----------...
|
||||
|
||||
**[Mandelbrot Set](mandelbrot-set-2008/index.md)**
|
||||
**[Mandelbrot Set 2008](mandelbrot-set-2008/index.md)**
|
||||
|
||||
[🐝 qbguy](qbguy.md) 🔗 [fractal](fractal.md), [mandelbrot](mandelbrot.md)
|
||||
|
||||
public domain, uses qb64's 2d prototype
|
||||
|
||||
**[Tor Myklebust](mandelbrot-zoomer/index.md)**
|
||||
**[Mandelbrot Zoomer](mandelbrot-zoomer/index.md)**
|
||||
|
||||
[🐝 *missing*](author-missing.md) 🔗 [fractal](fractal.md), [mandelbrot](mandelbrot.md)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## SAMPLES BY MATTHEW
|
||||
|
||||
**[4 Player Pong](four-player-pong/index.md)**
|
||||
**[Four Player Pong](four-player-pong/index.md)**
|
||||
|
||||
[🐝 Matthew](matthew.md) 🔗 [game](game.md), [pong](pong.md)
|
||||
|
||||
|
|
15
samples/maze.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES: MAZE
|
||||
|
||||
**[Mazes of Misery](mazes-of-misery/index.md)**
|
||||
|
||||
[🐝 Steve M.](steve-m..md) 🔗 [game](game.md), [maze](maze.md)
|
||||
|
||||
'Maze of Misery 'By Steve M. (c),May 5,01 '**************** 'Please visit my web page at: www.a...
|
||||
|
||||
**[QMaze](qmaze/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [maze](maze.md)
|
||||
|
||||
Maze puzzle game by Microsoft.
|
BIN
samples/mazes-of-misery/img/screenshot.png
Normal file
After Width: | Height: | Size: 16 KiB |
36
samples/mazes-of-misery/index.md
Normal file
|
@ -0,0 +1,36 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: MAZES OF MISERY
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Steve M.](../steve-m..md)
|
||||
|
||||
### Description
|
||||
|
||||
```text
|
||||
'Maze of Misery
|
||||
'By Steve M. (c),May 5,01
|
||||
'****************
|
||||
|
||||
'Please visit my web page at: www.angelfire.com/bc2/cuebasic/qpage.html
|
||||
'
|
||||
'Disclaimer: This program may not be distributed, modified or copied without
|
||||
'written permission from the author at yochatwitme@yahoo.com.
|
||||
'Not liable for system or hardware damage. Tho' I can assure you that you
|
||||
'won't experience any problems. Email me at yochatwitme@yahoo.com about
|
||||
'any concerns or difficulties you may be having.
|
||||
'Finally, you have my permission to post the program on your web page.
|
||||
'Hope you enjoy the game.
|
||||
'
|
||||
'Thanks. SM :)
|
||||
'Gbgames Chatname: QB4ever
|
||||
```
|
||||
|
||||
### File(s)
|
||||
|
||||
* [mzupd2.bas](src/mzupd2.bas)
|
||||
|
||||
🔗 [game](../game.md), [maze](../maze.md)
|
1922
samples/mazes-of-misery/src/mzupd2.bas
Normal file
|
@ -8,7 +8,73 @@
|
|||
|
||||
A turn-based artillery game by Microsoft.
|
||||
|
||||
**[Sort demo](sort-demo/index.md)**
|
||||
**[Money](money/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [data management](data-management.md)
|
||||
|
||||
Money manager by Microsoft.
|
||||
|
||||
**[Nibbles](nibbles/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [snake](snake.md)
|
||||
|
||||
Snake clone by Microsoft.
|
||||
|
||||
**[Phone](phone/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [data management](data-management.md)
|
||||
|
||||
Simple phone directory by Microsoft.
|
||||
|
||||
**[QBlocks](qblocks/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [tetris](tetris.md)
|
||||
|
||||
Tetris clone by Microsoft.
|
||||
|
||||
**[QBricks](qbricks/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [breakout](breakout.md)
|
||||
|
||||
Breakout clone by Microsoft.
|
||||
|
||||
**[QCards](qcards/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [data management](data-management.md)
|
||||
|
||||
A simple database using a cardfile user interface by Microsoft.
|
||||
|
||||
**[QMaze](qmaze/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [maze](maze.md)
|
||||
|
||||
Maze puzzle game by Microsoft.
|
||||
|
||||
**[QShips](qships/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [artillery](artillery.md)
|
||||
|
||||
Turn-based artillery game by Microsoft.
|
||||
|
||||
**[QSpace](qspace/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md), [defense](defense.md)
|
||||
|
||||
Space station defense game by Microsoft.
|
||||
|
||||
**[QSynth](qsynth/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [sound](sound.md), [music](music.md)
|
||||
|
||||
Audio synthesizer by Microsoft.
|
||||
|
||||
**[Reversi](reversi/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [game](game.md)
|
||||
|
||||
Reversi game by Microsoft.
|
||||
|
||||
**[Sort Demo](sort-demo/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [sort](sort.md)
|
||||
|
||||
|
|
BIN
samples/money/img/screenshot.png
Normal file
After Width: | Height: | Size: 10 KiB |
22
samples/money/index.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: MONEY
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Microsoft](../microsoft.md)
|
||||
|
||||
### Description
|
||||
|
||||
```text
|
||||
Money manager by Microsoft.
|
||||
```
|
||||
|
||||
### File(s)
|
||||
|
||||
* [money.bas](src/money.bas)
|
||||
* [money.zip](src/money.zip)
|
||||
|
||||
🔗 [data management](../data-management.md)
|
1534
samples/money/src/money.bas
Normal file
BIN
samples/money/src/money.zip
Normal file
BIN
samples/moon-lander/img/screenshot.png
Normal file
After Width: | Height: | Size: 19 KiB |
28
samples/moon-lander/index.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: MOON LANDER
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Richard Frost](../richard-frost.md)
|
||||
|
||||
### Description
|
||||
|
||||
```text
|
||||
Lunar Lander based on a 1974 program running on a DEC PDP/11 with GT40 vector display terminal at the University of Alberta. Initially written in QB4.5 (hence the convoluted code to save space), upgraded to use some QB64 features. Updated May 15, 2020 - More effects (at warp speeds) and cookies!
|
||||
|
||||
Controls:
|
||||
The multifarious keyboard controls are given by pressing F1 (Help) when the program is run.
|
||||
```
|
||||
|
||||
### File(s)
|
||||
|
||||
* [l64.bas](src/l64.bas)
|
||||
* [l64.zip](src/l64.zip)
|
||||
|
||||
🔗 [game](../game.md), [lander](../lander.md)
|
||||
|
||||
|
||||
<sub>Reference: [qb64forum](https://qb64forum.alephc.xyz/index.php?topic=2615.0) </sub>
|
6300
samples/moon-lander/src/l64.bas
Normal file
BIN
samples/moon-lander/src/l64.zip
Normal file
|
@ -1,12 +1,12 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: BEZIER
|
||||
## SAMPLE: MULTI-MILL
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Rho Sigma](../rho-sigma.md)
|
||||
[🐝 RhoSigma](../rhosigma.md)
|
||||
|
||||
### Description
|
||||
|
||||
|
|
9
samples/music.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES: MUSIC
|
||||
|
||||
**[QSynth](qsynth/index.md)**
|
||||
|
||||
[🐝 Microsoft](microsoft.md) 🔗 [sound](sound.md), [music](music.md)
|
||||
|
||||
Audio synthesizer by Microsoft.
|
|
@ -1,12 +1,12 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: BEZIER
|
||||
## SAMPLE: MYSTIFY
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Rho Sigma](../rho-sigma.md)
|
||||
[🐝 RhoSigma](../rhosigma.md)
|
||||
|
||||
### Description
|
||||
|
||||
|
|
BIN
samples/nibbles/img/screenshot.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
21
samples/nibbles/index.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: NIBBLES
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Microsoft](../microsoft.md)
|
||||
|
||||
### Description
|
||||
|
||||
```text
|
||||
Snake clone by Microsoft.
|
||||
```
|
||||
|
||||
### File(s)
|
||||
|
||||
* [nibbles.bas](src/nibbles.bas)
|
||||
|
||||
🔗 [game](../game.md), [snake](../snake.md)
|
717
samples/nibbles/src/nibbles.bas
Normal file
|
@ -0,0 +1,717 @@
|
|||
' Q B a s i c N i b b l e s
|
||||
'
|
||||
' Copyright (C) Microsoft Corporation 1990
|
||||
'
|
||||
' Nibbles is a game for one or two players. Navigate your snakes
|
||||
' around the game board trying to eat up numbers while avoiding
|
||||
' running into walls or other snakes. The more numbers you eat up,
|
||||
' the more points you gain and the longer your snake becomes.
|
||||
'
|
||||
' To run this game, press Shift+F5.
|
||||
'
|
||||
' To exit QBasic, press Alt, F, X.
|
||||
'
|
||||
' To get help on a BASIC keyword, move the cursor to the keyword and press
|
||||
' F1 or click the right mouse button.
|
||||
'
|
||||
|
||||
'Set default data type to integer for faster game play
|
||||
DefInt A-Z
|
||||
|
||||
'User-defined TYPEs
|
||||
Type snakeBody
|
||||
row As Integer
|
||||
col As Integer
|
||||
End Type
|
||||
|
||||
'This type defines the player's snake
|
||||
Type snaketype
|
||||
head As Integer
|
||||
length As Integer
|
||||
row As Integer
|
||||
col As Integer
|
||||
direction As Integer
|
||||
lives As Integer
|
||||
score As Integer
|
||||
scolor As Integer
|
||||
alive As Integer
|
||||
End Type
|
||||
|
||||
'This type is used to represent the playing screen in memory
|
||||
'It is used to simulate graphics in text mode, and has some interesting,
|
||||
'and slightly advanced methods to increasing the speed of operation.
|
||||
'Instead of the normal 80x25 text graphics using chr$(219) "Û", we will be
|
||||
'using chr$(220)"Ü" and chr$(223) "ß" and chr$(219) "Û" to mimic an 80x50
|
||||
'pixel screen.
|
||||
'Check out sub-programs SET and POINTISTHERE to see how this is implemented
|
||||
'feel free to copy these (as well as arenaType and the DIM ARENA stmt and the
|
||||
'initialization code in the DrawScreen subprogram) and use them in your own
|
||||
'programs
|
||||
Type arenaType
|
||||
realRow As Integer 'Maps the 80x50 point into the real 80x25
|
||||
acolor As Integer 'Stores the current color of the point
|
||||
sister As Integer 'Each char has 2 points in it. .SISTER is
|
||||
End Type '-1 if sister point is above, +1 if below
|
||||
|
||||
'Sub Declarations
|
||||
DECLARE SUB SpacePause (text$)
|
||||
DECLARE SUB PrintScore (NumPlayers%, score1%, score2%, lives1%, lives2%)
|
||||
DECLARE SUB Intro ()
|
||||
DECLARE SUB GetInputs (NumPlayers, speed, diff$, monitor$)
|
||||
DECLARE SUB DrawScreen ()
|
||||
DECLARE SUB PlayNibbles (NumPlayers, speed, diff$)
|
||||
DECLARE SUB Set (row, col, acolor)
|
||||
DECLARE SUB Center (row, text$)
|
||||
DECLARE SUB Initialize ()
|
||||
DECLARE SUB SparklePause ()
|
||||
DECLARE SUB Level (WhatToDO, sammy() AS snaketype)
|
||||
DECLARE SUB InitColors ()
|
||||
DECLARE SUB EraseSnake (snake() AS ANY, snakeBod() AS ANY, snakeNum%)
|
||||
DECLARE FUNCTION StillWantsToPlay ()
|
||||
DECLARE FUNCTION PointIsThere (row, col, backColor)
|
||||
|
||||
'Constants
|
||||
Const TRUE = -1
|
||||
Const FALSE = Not TRUE
|
||||
Const MAXSNAKELENGTH = 1000
|
||||
Const STARTOVER = 1 ' Parameters to 'Level' SUB
|
||||
Const SAMELEVEL = 2
|
||||
Const NEXTLEVEL = 3
|
||||
|
||||
'Global Variables
|
||||
Dim Shared arena(1 To 50, 1 To 80) As arenaType
|
||||
Dim Shared curLevel, colorTable(10)
|
||||
|
||||
Randomize Timer
|
||||
GoSub ClearKeyLocks
|
||||
Intro
|
||||
GetInputs NumPlayers, speed, diff$, monitor$
|
||||
GoSub SetColors
|
||||
DrawScreen
|
||||
|
||||
Do
|
||||
PlayNibbles NumPlayers, speed, diff$
|
||||
Loop While StillWantsToPlay
|
||||
|
||||
GoSub RestoreKeyLocks
|
||||
Color 15, 0
|
||||
Cls
|
||||
End
|
||||
|
||||
ClearKeyLocks:
|
||||
Def Seg = 0 ' Turn off CapLock, NumLock and ScrollLock
|
||||
KeyFlags = Peek(1047)
|
||||
Poke 1047, &H0
|
||||
Def Seg
|
||||
Return
|
||||
|
||||
RestoreKeyLocks:
|
||||
Def Seg = 0 ' Restore CapLock, NumLock and ScrollLock states
|
||||
Poke 1047, KeyFlags
|
||||
Def Seg
|
||||
Return
|
||||
|
||||
SetColors:
|
||||
If monitor$ = "M" Then
|
||||
Restore mono
|
||||
Else
|
||||
Restore normal
|
||||
End If
|
||||
|
||||
For a = 1 To 6
|
||||
Read colorTable(a)
|
||||
Next a
|
||||
Return
|
||||
|
||||
'snake1 snake2 Walls Background Dialogs-Fore Back
|
||||
mono: Data 15,7,7,0,15,0
|
||||
normal: Data 14,13,12,1,15,4
|
||||
End
|
||||
|
||||
'Center:
|
||||
' Centers text on given row
|
||||
Sub Center (row, text$)
|
||||
Locate row, 41 - Len(text$) / 2
|
||||
Print text$;
|
||||
End Sub
|
||||
|
||||
'DrawScreen:
|
||||
' Draws playing field
|
||||
Sub DrawScreen
|
||||
|
||||
'initialize screen
|
||||
View Print
|
||||
Color colorTable(1), colorTable(4)
|
||||
Cls
|
||||
|
||||
'Print title & message
|
||||
Center 1, "Nibbles!"
|
||||
Center 11, "Initializing Playing Field..."
|
||||
|
||||
'Initialize arena array
|
||||
For row = 1 To 50
|
||||
For col = 1 To 80
|
||||
arena(row, col).realRow = Int((row + 1) / 2)
|
||||
arena(row, col).sister = (row Mod 2) * 2 - 1
|
||||
Next col
|
||||
Next row
|
||||
End Sub
|
||||
|
||||
'EraseSnake:
|
||||
' Erases snake to facilitate moving through playing field
|
||||
Sub EraseSnake (snake() As snaketype, snakeBod() As snakeBody, snakeNum)
|
||||
|
||||
For c = 0 To 9
|
||||
For b = snake(snakeNum).length - c To 0 Step -10
|
||||
tail = (snake(snakeNum).head + MAXSNAKELENGTH - b) Mod MAXSNAKELENGTH
|
||||
Set snakeBod(tail, snakeNum).row, snakeBod(tail, snakeNum).col, colorTable(4)
|
||||
Next b
|
||||
_Delay .03
|
||||
Next c
|
||||
|
||||
End Sub
|
||||
|
||||
'GetInputs:
|
||||
' Gets player inputs
|
||||
Sub GetInputs (NumPlayers, speed, diff$, monitor$)
|
||||
|
||||
Color 7, 0
|
||||
Cls
|
||||
|
||||
Do
|
||||
Locate 5, 47: Print Space$(34);
|
||||
Locate 5, 20
|
||||
Input "How many players (1 or 2)"; num$
|
||||
Loop Until Val(num$) = 1 Or Val(num$) = 2
|
||||
NumPlayers = Val(num$)
|
||||
|
||||
Locate 8, 21: Print "Skill level (1 to 100)"
|
||||
Locate 9, 22: Print "1 = Novice"
|
||||
Locate 10, 22: Print "90 = Expert"
|
||||
Locate 11, 22: Print "100 = Twiddle Fingers"
|
||||
Locate 12, 15: Print "(Computer speed may affect your skill level)"
|
||||
Do
|
||||
Locate 8, 44: Print Space$(35);
|
||||
Locate 8, 43
|
||||
Input gamespeed$
|
||||
Loop Until Val(gamespeed$) >= 1 And Val(gamespeed$) <= 100
|
||||
speed = Val(gamespeed$)
|
||||
|
||||
speed = (100 - speed) * 2 + 1
|
||||
|
||||
Do
|
||||
Locate 15, 56: Print Space$(25);
|
||||
Locate 15, 15
|
||||
Input "Increase game speed during play (Y or N)"; diff$
|
||||
diff$ = UCase$(diff$)
|
||||
Loop Until diff$ = "Y" Or diff$ = "N"
|
||||
|
||||
Do
|
||||
Locate 17, 46: Print Space$(34);
|
||||
Locate 17, 17
|
||||
Input "Monochrome or color monitor (M or C)"; monitor$
|
||||
monitor$ = UCase$(monitor$)
|
||||
Loop Until monitor$ = "M" Or monitor$ = "C"
|
||||
|
||||
End Sub
|
||||
|
||||
'InitColors:
|
||||
'Initializes playing field colors
|
||||
Sub InitColors
|
||||
|
||||
For row = 1 To 50
|
||||
For col = 1 To 80
|
||||
arena(row, col).acolor = colorTable(4)
|
||||
Next col
|
||||
Next row
|
||||
|
||||
Cls
|
||||
|
||||
'Set (turn on) pixels for screen border
|
||||
For col = 1 To 80
|
||||
Set 3, col, colorTable(3)
|
||||
Set 50, col, colorTable(3)
|
||||
Next col
|
||||
|
||||
For row = 4 To 49
|
||||
Set row, 1, colorTable(3)
|
||||
Set row, 80, colorTable(3)
|
||||
Next row
|
||||
|
||||
End Sub
|
||||
|
||||
'Intro:
|
||||
' Displays game introduction
|
||||
Sub Intro
|
||||
Screen 0
|
||||
Width 80, 25
|
||||
Color 15, 0
|
||||
Cls
|
||||
|
||||
Center 4, "Q B a s i c N i b b l e s"
|
||||
Color 7
|
||||
Center 6, "Copyright (C) Microsoft Corporation 1990"
|
||||
Center 8, "Nibbles is a game for one or two players. Navigate your snakes"
|
||||
Center 9, "around the game board trying to eat up numbers while avoiding"
|
||||
Center 10, "running into walls or other snakes. The more numbers you eat up,"
|
||||
Center 11, "the more points you gain and the longer your snake becomes."
|
||||
Center 13, " Game Controls "
|
||||
Center 15, " General Player 1 Player 2 "
|
||||
Center 16, " (Up) (Up) "
|
||||
Center 17, "P - Pause " + Chr$(24) + " W "
|
||||
Center 18, " (Left) " + Chr$(27) + " " + Chr$(26) + " (Right) (Left) A D (Right) "
|
||||
Center 19, " " + Chr$(25) + " S "
|
||||
Center 20, " (Down) (Down) "
|
||||
Center 24, "Press any key to continue"
|
||||
|
||||
Play "MBT160O1L8CDEDCDL4ECC"
|
||||
SparklePause
|
||||
|
||||
End Sub
|
||||
|
||||
'Level:
|
||||
'Sets game level
|
||||
Sub Level (WhatToDO, sammy() As snaketype) Static
|
||||
|
||||
Select Case (WhatToDO)
|
||||
|
||||
Case STARTOVER
|
||||
curLevel = 1
|
||||
Case NEXTLEVEL
|
||||
curLevel = curLevel + 1
|
||||
End Select
|
||||
|
||||
sammy(1).head = 1 'Initialize Snakes
|
||||
sammy(1).length = 2
|
||||
sammy(1).alive = TRUE
|
||||
sammy(2).head = 1
|
||||
sammy(2).length = 2
|
||||
sammy(2).alive = TRUE
|
||||
|
||||
InitColors
|
||||
|
||||
Select Case curLevel
|
||||
Case 1
|
||||
sammy(1).row = 25: sammy(2).row = 25
|
||||
sammy(1).col = 50: sammy(2).col = 30
|
||||
sammy(1).direction = 4: sammy(2).direction = 3
|
||||
|
||||
|
||||
Case 2
|
||||
For i = 20 To 60
|
||||
Set 25, i, colorTable(3)
|
||||
Next i
|
||||
sammy(1).row = 7: sammy(2).row = 43
|
||||
sammy(1).col = 60: sammy(2).col = 20
|
||||
sammy(1).direction = 3: sammy(2).direction = 4
|
||||
|
||||
Case 3
|
||||
For i = 10 To 40
|
||||
Set i, 20, colorTable(3)
|
||||
Set i, 60, colorTable(3)
|
||||
Next i
|
||||
sammy(1).row = 25: sammy(2).row = 25
|
||||
sammy(1).col = 50: sammy(2).col = 30
|
||||
sammy(1).direction = 1: sammy(2).direction = 2
|
||||
|
||||
Case 4
|
||||
For i = 4 To 30
|
||||
Set i, 20, colorTable(3)
|
||||
Set 53 - i, 60, colorTable(3)
|
||||
Next i
|
||||
For i = 2 To 40
|
||||
Set 38, i, colorTable(3)
|
||||
Set 15, 81 - i, colorTable(3)
|
||||
Next i
|
||||
sammy(1).row = 7: sammy(2).row = 43
|
||||
sammy(1).col = 60: sammy(2).col = 20
|
||||
sammy(1).direction = 3: sammy(2).direction = 4
|
||||
|
||||
Case 5
|
||||
For i = 13 To 39
|
||||
Set i, 21, colorTable(3)
|
||||
Set i, 59, colorTable(3)
|
||||
Next i
|
||||
For i = 23 To 57
|
||||
Set 11, i, colorTable(3)
|
||||
Set 41, i, colorTable(3)
|
||||
Next i
|
||||
sammy(1).row = 25: sammy(2).row = 25
|
||||
sammy(1).col = 50: sammy(2).col = 30
|
||||
sammy(1).direction = 1: sammy(2).direction = 2
|
||||
|
||||
Case 6
|
||||
For i = 4 To 49
|
||||
If i > 30 Or i < 23 Then
|
||||
Set i, 10, colorTable(3)
|
||||
Set i, 20, colorTable(3)
|
||||
Set i, 30, colorTable(3)
|
||||
Set i, 40, colorTable(3)
|
||||
Set i, 50, colorTable(3)
|
||||
Set i, 60, colorTable(3)
|
||||
Set i, 70, colorTable(3)
|
||||
End If
|
||||
Next i
|
||||
sammy(1).row = 7: sammy(2).row = 43
|
||||
sammy(1).col = 65: sammy(2).col = 15
|
||||
sammy(1).direction = 2: sammy(2).direction = 1
|
||||
|
||||
Case 7
|
||||
For i = 4 To 49 Step 2
|
||||
Set i, 40, colorTable(3)
|
||||
Next i
|
||||
sammy(1).row = 7: sammy(2).row = 43
|
||||
sammy(1).col = 65: sammy(2).col = 15
|
||||
sammy(1).direction = 2: sammy(2).direction = 1
|
||||
|
||||
Case 8
|
||||
For i = 4 To 40
|
||||
Set i, 10, colorTable(3)
|
||||
Set 53 - i, 20, colorTable(3)
|
||||
Set i, 30, colorTable(3)
|
||||
Set 53 - i, 40, colorTable(3)
|
||||
Set i, 50, colorTable(3)
|
||||
Set 53 - i, 60, colorTable(3)
|
||||
Set i, 70, colorTable(3)
|
||||
Next i
|
||||
sammy(1).row = 7: sammy(2).row = 43
|
||||
sammy(1).col = 65: sammy(2).col = 15
|
||||
sammy(1).direction = 2: sammy(2).direction = 1
|
||||
|
||||
Case 9
|
||||
For i = 6 To 47
|
||||
Set i, i, colorTable(3)
|
||||
Set i, i + 28, colorTable(3)
|
||||
Next i
|
||||
sammy(1).row = 40: sammy(2).row = 15
|
||||
sammy(1).col = 75: sammy(2).col = 5
|
||||
sammy(1).direction = 1: sammy(2).direction = 2
|
||||
|
||||
Case Else
|
||||
For i = 4 To 49 Step 2
|
||||
Set i, 10, colorTable(3)
|
||||
Set i + 1, 20, colorTable(3)
|
||||
Set i, 30, colorTable(3)
|
||||
Set i + 1, 40, colorTable(3)
|
||||
Set i, 50, colorTable(3)
|
||||
Set i + 1, 60, colorTable(3)
|
||||
Set i, 70, colorTable(3)
|
||||
Next i
|
||||
sammy(1).row = 7: sammy(2).row = 43
|
||||
sammy(1).col = 65: sammy(2).col = 15
|
||||
sammy(1).direction = 2: sammy(2).direction = 1
|
||||
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
'PlayNibbles:
|
||||
' Main routine that controls game play
|
||||
Sub PlayNibbles (NumPlayers, speed, diff$)
|
||||
|
||||
'Initialize Snakes
|
||||
Dim sammyBody(MAXSNAKELENGTH - 1, 1 To 2) As snakeBody
|
||||
Dim sammy(1 To 2) As snaketype
|
||||
sammy(1).lives = 5
|
||||
sammy(1).score = 0
|
||||
sammy(1).scolor = colorTable(1)
|
||||
sammy(2).lives = 5
|
||||
sammy(2).score = 0
|
||||
sammy(2).scolor = colorTable(2)
|
||||
|
||||
Level STARTOVER, sammy()
|
||||
startRow1 = sammy(1).row: startCol1 = sammy(1).col
|
||||
startRow2 = sammy(2).row: startCol2 = sammy(2).col
|
||||
|
||||
curSpeed = speed
|
||||
|
||||
'play Nibbles until finished
|
||||
|
||||
SpacePause " Level" + Str$(curLevel) + ", Push Space"
|
||||
gameOver = FALSE
|
||||
Do
|
||||
If NumPlayers = 1 Then
|
||||
sammy(2).row = 0
|
||||
End If
|
||||
|
||||
number = 1 'Current number that snakes are trying to run into
|
||||
nonum = TRUE 'nonum = TRUE if a number is not on the screen
|
||||
|
||||
playerDied = FALSE
|
||||
PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives
|
||||
Play "T160O1>L20CDEDCDL10ECC"
|
||||
|
||||
Do
|
||||
'Print number if no number exists
|
||||
If nonum = TRUE Then
|
||||
Do
|
||||
numberRow = Int(Rnd(1) * 47 + 3)
|
||||
NumberCol = Int(Rnd(1) * 78 + 2)
|
||||
sisterRow = numberRow + arena(numberRow, NumberCol).sister
|
||||
Loop Until Not PointIsThere(numberRow, NumberCol, colorTable(4)) And Not PointIsThere(sisterRow, NumberCol, colorTable(4))
|
||||
numberRow = arena(numberRow, NumberCol).realRow
|
||||
nonum = FALSE
|
||||
Color colorTable(1), colorTable(4)
|
||||
Locate numberRow, NumberCol
|
||||
Print Right$(Str$(number), 1);
|
||||
count = 0
|
||||
End If
|
||||
|
||||
'Delay game
|
||||
_Delay .016 + .00042 * curSpeed
|
||||
|
||||
'Get keyboard input & Change direction accordingly
|
||||
kbd$ = InKey$
|
||||
Select Case kbd$
|
||||
Case "w", "W": If sammy(2).direction <> 2 Then sammy(2).direction = 1
|
||||
Case "s", "S": If sammy(2).direction <> 1 Then sammy(2).direction = 2
|
||||
Case "a", "A": If sammy(2).direction <> 4 Then sammy(2).direction = 3
|
||||
Case "d", "D": If sammy(2).direction <> 3 Then sammy(2).direction = 4
|
||||
Case Chr$(0) + "H": If sammy(1).direction <> 2 Then sammy(1).direction = 1
|
||||
Case Chr$(0) + "P": If sammy(1).direction <> 1 Then sammy(1).direction = 2
|
||||
Case Chr$(0) + "K": If sammy(1).direction <> 4 Then sammy(1).direction = 3
|
||||
Case Chr$(0) + "M": If sammy(1).direction <> 3 Then sammy(1).direction = 4
|
||||
Case "p", "P": SpacePause " Game Paused ... Push Space "
|
||||
Case Else
|
||||
End Select
|
||||
|
||||
For a = 1 To NumPlayers
|
||||
'Move Snake
|
||||
Select Case sammy(a).direction
|
||||
Case 1: sammy(a).row = sammy(a).row - 1
|
||||
Case 2: sammy(a).row = sammy(a).row + 1
|
||||
Case 3: sammy(a).col = sammy(a).col - 1
|
||||
Case 4: sammy(a).col = sammy(a).col + 1
|
||||
End Select
|
||||
|
||||
'If snake hits number, respond accordingly
|
||||
If numberRow = Int((sammy(a).row + 1) / 2) And NumberCol = sammy(a).col Then
|
||||
Play "MBO0L16>CCCE"
|
||||
If sammy(a).length < (MAXSNAKELENGTH - 30) Then
|
||||
sammy(a).length = sammy(a).length + number * 4
|
||||
End If
|
||||
sammy(a).score = sammy(a).score + number
|
||||
PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives
|
||||
number = number + 1
|
||||
If number = 10 Then
|
||||
For b = 1 To NumPlayers
|
||||
EraseSnake sammy(), sammyBody(), b
|
||||
Next b
|
||||
Locate numberRow, NumberCol: Print " "
|
||||
Level NEXTLEVEL, sammy()
|
||||
PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives
|
||||
SpacePause " Level" + Str$(curLevel) + ", Push Space"
|
||||
If NumPlayers = 1 Then sammy(2).row = 0
|
||||
number = 1
|
||||
If diff$ = "Y" Then curSpeed = curSpeed - 10
|
||||
End If
|
||||
nonum = TRUE
|
||||
If curSpeed < 1 Then curSpeed = 1
|
||||
End If
|
||||
Next a
|
||||
|
||||
For a = 1 To NumPlayers
|
||||
'If player runs into any point, or the head of the other snake, it dies.
|
||||
If PointIsThere(sammy(a).row, sammy(a).col, colorTable(4)) Or (sammy(1).row = sammy(2).row And sammy(1).col = sammy(2).col) Then
|
||||
Play "MBO0L32EFGEFDC"
|
||||
Color , colorTable(4)
|
||||
Locate numberRow, NumberCol
|
||||
Print " "
|
||||
|
||||
playerDied = TRUE
|
||||
sammy(a).alive = FALSE
|
||||
sammy(a).lives = sammy(a).lives - 1
|
||||
|
||||
'Otherwise, move the snake, and erase the tail
|
||||
Else
|
||||
sammy(a).head = (sammy(a).head + 1) Mod MAXSNAKELENGTH
|
||||
sammyBody(sammy(a).head, a).row = sammy(a).row
|
||||
sammyBody(sammy(a).head, a).col = sammy(a).col
|
||||
tail = (sammy(a).head + MAXSNAKELENGTH - sammy(a).length) Mod MAXSNAKELENGTH
|
||||
Set sammyBody(tail, a).row, sammyBody(tail, a).col, colorTable(4)
|
||||
sammyBody(tail, a).row = 0
|
||||
Set sammy(a).row, sammy(a).col, sammy(a).scolor
|
||||
End If
|
||||
Next a
|
||||
|
||||
Loop Until playerDied
|
||||
|
||||
curSpeed = speed ' reset speed to initial value
|
||||
|
||||
For a = 1 To NumPlayers
|
||||
EraseSnake sammy(), sammyBody(), a
|
||||
|
||||
'If dead, then erase snake in really cool way
|
||||
If sammy(a).alive = FALSE Then
|
||||
'Update score
|
||||
sammy(a).score = sammy(a).score - 10
|
||||
PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives
|
||||
|
||||
If a = 1 Then
|
||||
SpacePause " Sammy Dies! Push Space! --->"
|
||||
Else
|
||||
SpacePause " <---- Jake Dies! Push Space "
|
||||
End If
|
||||
End If
|
||||
Next a
|
||||
|
||||
Level SAMELEVEL, sammy()
|
||||
PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives
|
||||
|
||||
'Play next round, until either of snake's lives have run out.
|
||||
Loop Until sammy(1).lives = 0 Or sammy(2).lives = 0
|
||||
|
||||
End Sub
|
||||
|
||||
'PointIsThere:
|
||||
' Checks the global arena array to see if the boolean flag is set
|
||||
Function PointIsThere (row, col, acolor)
|
||||
If row <> 0 Then
|
||||
If arena(row, col).acolor <> acolor Then
|
||||
PointIsThere = TRUE
|
||||
Else
|
||||
PointIsThere = FALSE
|
||||
End If
|
||||
End If
|
||||
End Function
|
||||
|
||||
'PrintScore:
|
||||
' Prints players scores and number of lives remaining
|
||||
Sub PrintScore (NumPlayers, score1, score2, lives1, lives2)
|
||||
Color 15, colorTable(4)
|
||||
|
||||
If NumPlayers = 2 Then
|
||||
Locate 1, 1
|
||||
Print Using "#,###,#00 Lives: # <--JAKE"; score2; lives2
|
||||
End If
|
||||
|
||||
Locate 1, 49
|
||||
Print Using "SAMMY--> Lives: # #,###,#00"; lives1; score1
|
||||
End Sub
|
||||
|
||||
'Set:
|
||||
' Sets row and column on playing field to given color to facilitate moving
|
||||
' of snakes around the field.
|
||||
Sub Set (row, col, acolor)
|
||||
If row <> 0 Then
|
||||
arena(row, col).acolor = acolor 'assign color to arena
|
||||
realRow = arena(row, col).realRow 'Get real row of pixel
|
||||
topFlag = arena(row, col).sister + 1 / 2 'Deduce whether pixel
|
||||
'is on topß, or bottomÜ
|
||||
sisterRow = row + arena(row, col).sister 'Get arena row of sister
|
||||
sisterColor = arena(sisterRow, col).acolor 'Determine sister's color
|
||||
|
||||
Locate realRow, col
|
||||
|
||||
If acolor = sisterColor Then 'If both points are same
|
||||
Color acolor, acolor 'Print chr$(219) "Û"
|
||||
Print Chr$(219);
|
||||
Else
|
||||
If topFlag Then 'Since you cannot have
|
||||
If acolor > 7 Then 'bright backgrounds
|
||||
Color acolor, sisterColor 'determine best combo
|
||||
Print Chr$(223); 'to use.
|
||||
Else
|
||||
Color sisterColor, acolor
|
||||
Print Chr$(220);
|
||||
End If
|
||||
Else
|
||||
If acolor > 7 Then
|
||||
Color acolor, sisterColor
|
||||
Print Chr$(220);
|
||||
Else
|
||||
Color sisterColor, acolor
|
||||
Print Chr$(223);
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'SpacePause:
|
||||
' Pauses game play and waits for space bar to be pressed before continuing
|
||||
Sub SpacePause (text$)
|
||||
|
||||
Color colorTable(5), colorTable(6)
|
||||
Center 11, "ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ"
|
||||
Center 12, "Û " + Left$(text$ + Space$(29), 29) + " Û"
|
||||
Center 13, "ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ"
|
||||
While InKey$ <> "": Wend
|
||||
While InKey$ <> " ": Wend
|
||||
Color 15, colorTable(4)
|
||||
|
||||
For i = 21 To 26 ' Restore the screen background
|
||||
For j = 24 To 56
|
||||
Set i, j, arena(i, j).acolor
|
||||
Next j
|
||||
Next i
|
||||
|
||||
End Sub
|
||||
|
||||
'SparklePause:
|
||||
' Creates flashing border for intro screen
|
||||
Sub SparklePause
|
||||
|
||||
Color 4, 0
|
||||
a$ = "* * * * * * * * * * * * * * * * * "
|
||||
While InKey$ <> "": Wend 'Clear keyboard buffer
|
||||
|
||||
While InKey$ = ""
|
||||
For a = 1 To 5
|
||||
Locate 1, 1 'print horizontal sparkles
|
||||
Print Mid$(a$, a, 80);
|
||||
Locate 22, 1
|
||||
Print Mid$(a$, 6 - a, 80);
|
||||
|
||||
For b = 2 To 21 'Print Vertical sparkles
|
||||
c = (a + b) Mod 5
|
||||
If c = 1 Then
|
||||
Locate b, 80
|
||||
Print "*";
|
||||
Locate 23 - b, 1
|
||||
Print "*";
|
||||
Else
|
||||
Locate b, 80
|
||||
Print " ";
|
||||
Locate 23 - b, 1
|
||||
Print " ";
|
||||
End If
|
||||
Next b
|
||||
_Delay .06
|
||||
Next a
|
||||
Wend
|
||||
|
||||
End Sub
|
||||
|
||||
'StillWantsToPlay:
|
||||
' Determines if users want to play game again.
|
||||
Function StillWantsToPlay
|
||||
|
||||
Color colorTable(5), colorTable(6)
|
||||
Center 10, "ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ"
|
||||
Center 11, "Û G A M E O V E R Û"
|
||||
Center 12, "Û Û"
|
||||
Center 13, "Û Play Again? (Y/N) Û"
|
||||
Center 14, "ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ"
|
||||
|
||||
While InKey$ <> "": Wend
|
||||
Do
|
||||
kbd$ = UCase$(InKey$)
|
||||
Loop Until kbd$ = "Y" Or kbd$ = "N"
|
||||
|
||||
Color 15, colorTable(4)
|
||||
Center 10, " "
|
||||
Center 11, " "
|
||||
Center 12, " "
|
||||
Center 13, " "
|
||||
Center 14, " "
|
||||
|
||||
If kbd$ = "Y" Then
|
||||
StillWantsToPlay = TRUE
|
||||
Else
|
||||
StillWantsToPlay = FALSE
|
||||
Color 7, 0
|
||||
Cls
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: MANDALA 9 LINE
|
||||
## SAMPLE: PATTERN
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
|
|
9
samples/philipp-strathausen.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES BY PHILIPP STRATHAUSEN
|
||||
|
||||
**[QTrek](qtrek/index.md)**
|
||||
|
||||
[🐝 Philipp Strathausen](philipp-strathausen.md) 🔗 [game](game.md), [space shooter](space-shooter.md)
|
||||
|
||||
Star Trek-like game by Philipp Strathausen.
|
BIN
samples/phone/img/screenshot.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
22
samples/phone/index.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: PHONE
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Microsoft](../microsoft.md)
|
||||
|
||||
### Description
|
||||
|
||||
```text
|
||||
Simple phone directory by Microsoft.
|
||||
```
|
||||
|
||||
### File(s)
|
||||
|
||||
* [phone.bas](src/phone.bas)
|
||||
* [phone.zip](src/phone.zip)
|
||||
|
||||
🔗 [data management](../data-management.md)
|
523
samples/phone/src/phone.bas
Normal file
|
@ -0,0 +1,523 @@
|
|||
'For faster operation
|
||||
DefInt A-Z
|
||||
|
||||
'Declaration of sub programs
|
||||
DECLARE SUB ScrollDown ()
|
||||
DECLARE SUB Initialize ()
|
||||
DECLARE SUB PhoneEditor ()
|
||||
DECLARE FUNCTION GetString$ (row, col, start$, end$, vis, max)
|
||||
|
||||
'Declaration of constants
|
||||
Const TRUE = -1
|
||||
Const false = Not TRUE
|
||||
|
||||
'declaration of global arrays
|
||||
Dim Shared ScrollUpAsm(1 To 7) 'Stores asm routine to scroll up
|
||||
Dim Shared ScrollDownAsm(1 To 7) 'Stores asm routine to scroll down
|
||||
|
||||
'Program
|
||||
Initialize
|
||||
PhoneEditor
|
||||
|
||||
'assembly routines
|
||||
Data &HB8,&H01,&H06,&HB9,&H00,&H02,&HBA,&H4F,&H17,&HB7,&H00,&HCD,&H10,&HCB
|
||||
Data &HB8,&H01,&H07,&HB9,&H00,&H02,&HBA,&H4F,&H17,&HB7,&H00,&HCD,&H10,&HCB
|
||||
|
||||
' Max Chars Max
|
||||
' Title$ Column Visible Chars
|
||||
Data "Name",2,19,30
|
||||
Data "Phone",22,19,20
|
||||
Data "Address",42,19,30
|
||||
Data "City",62,9,20
|
||||
Data "St",72,2,2
|
||||
Data "Zip",75,5,5
|
||||
|
||||
'This funtion gets string input at location row,col. The string to
|
||||
'input is at most MAX characters long, and no more than VIS chars may be
|
||||
'displayed. The initial string is sent in START$, and the resulting
|
||||
'string is returned as END$
|
||||
'The function itself returns the keystroke that was used to exit this
|
||||
'routine, for example, arrow keys, function keys, return, escape, etc...
|
||||
'
|
||||
Function GetString$ (row, col, start$, end$, vis, max)
|
||||
|
||||
'establish current string
|
||||
curr$ = LTrim$(Left$(start$, max))
|
||||
|
||||
'force cursor to exist
|
||||
Locate , , 1
|
||||
|
||||
finished = false
|
||||
Do
|
||||
GoSub GetStringShowText
|
||||
GoSub GetStringGetKey
|
||||
|
||||
If Len(kbd$) > 1 Then 'Exit if special key
|
||||
finished = TRUE
|
||||
GetString$ = kbd$
|
||||
Else
|
||||
Select Case kbd$
|
||||
Case Chr$(13), Chr$(27), Chr$(9) 'Exit if special key
|
||||
finished = TRUE
|
||||
GetString$ = kbd$
|
||||
|
||||
Case Chr$(8) 'Handle backspace
|
||||
If curr$ <> "" Then
|
||||
curr$ = Left$(curr$, Len(curr$) - 1)
|
||||
End If
|
||||
|
||||
Case " " TO "}" 'Handle any text key
|
||||
If Len(curr$) < max Then
|
||||
curr$ = curr$ + kbd$
|
||||
End If
|
||||
|
||||
Case Else 'Beep for anything else
|
||||
Beep
|
||||
End Select
|
||||
End If
|
||||
|
||||
Loop Until finished
|
||||
|
||||
end$ = curr$
|
||||
Exit Function
|
||||
|
||||
|
||||
GetStringShowText: 'Show at most VIS chars
|
||||
Locate row, col 'of string
|
||||
If Len(curr$) > vis Then
|
||||
Print Right$(curr$, vis);
|
||||
Else
|
||||
Print curr$; Space$(vis - Len(curr$));
|
||||
Locate row, col + Len(curr$)
|
||||
End If
|
||||
Return
|
||||
|
||||
|
||||
GetStringGetKey: 'Standard inkey loop
|
||||
Do
|
||||
kbd$ = InKey$
|
||||
Loop While kbd$ = ""
|
||||
Return
|
||||
|
||||
End Function
|
||||
|
||||
Sub Initialize
|
||||
|
||||
'set up screen
|
||||
Width , 25
|
||||
View Print
|
||||
Locate , , 1
|
||||
|
||||
'read in first asm routine
|
||||
P = VarPtr(ScrollUpAsm(1))
|
||||
Def Seg = VarSeg(ScrollUpAsm(1))
|
||||
For i = 0 To 13
|
||||
Read j
|
||||
Poke (P + i), j
|
||||
Next i
|
||||
|
||||
'read in second asm routine
|
||||
P = VarPtr(ScrollDownAsm(1))
|
||||
Def Seg = VarSeg(ScrollDownAsm(1))
|
||||
For i = 0 To 13
|
||||
Read j
|
||||
Poke (P + i), j
|
||||
Next i
|
||||
|
||||
'return segment to normal
|
||||
Def Seg
|
||||
|
||||
End Sub
|
||||
|
||||
Sub PhoneEditor
|
||||
|
||||
'Dimension arrays
|
||||
Dim edit$(6) 'Current line being edited
|
||||
Dim Title$(6) 'Column titles
|
||||
Dim col(6) 'Column locations
|
||||
Dim vis(6) 'Maximum visible chars
|
||||
Dim max(6) 'Maximum chars allowes
|
||||
Dim io$(6) 'Used to RANDOM access file I/O
|
||||
Dim name1$(6) 'Temp storage to print names
|
||||
Dim name2$(6) 'Temp storage to print names
|
||||
Dim index(2000) 'Tells the editor where to find name on disk
|
||||
Dim key$(2000) 'Used for sorting
|
||||
|
||||
'prepare screen
|
||||
For a = 1 To 6
|
||||
Read Title$(a), col(a), vis(a), max(a)
|
||||
Next a
|
||||
|
||||
u1$ = "³\ \³\ \³\ \³\ \³\\³\ \³"
|
||||
u2$ = "ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÅÄÄÅÄÄÄÄÄ´"
|
||||
u3$ = "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÁÄÄÁÄÄÄÄÄÙ"
|
||||
|
||||
Color 14, 1
|
||||
Cls
|
||||
|
||||
Print Using u1$; Title$(1); Title$(2); Title$(3); Title$(4); Title$(5); Title$(6);
|
||||
Print u2$
|
||||
Locate 25, 1
|
||||
Print " <F2=Exit> <F5=Sort> <F6=Print> <F9=Insert> <F10=Delete>";
|
||||
|
||||
'Open random access file
|
||||
Open "Phone.dat" For Random As #1 Len = 107
|
||||
Field #1, 30 As io$(1), 20 As io$(2), 30 As io$(3), 15 As io$(4), 2 As io$(5), 5 As io$(6)
|
||||
Field #1, 11 As ioValid$, 5 As ioMaxRecord$
|
||||
|
||||
'get first record, if it's a new file, it will initialize it.
|
||||
'Record #1 contains the code word "THISISVALID" indicating the file is
|
||||
'properly initialized, and the number of records in the file
|
||||
Get #1, 1
|
||||
If ioValid$ <> "THISISVALID" Then
|
||||
For a = 1 To 6
|
||||
LSet io$(a) = ""
|
||||
Next a
|
||||
Put #1, 2
|
||||
LSet ioValid$ = "THISISVALID"
|
||||
RSet ioMaxRecord$ = "1"
|
||||
Put #1, 1
|
||||
End If
|
||||
|
||||
maxRecord = Val(ioMaxRecord$)
|
||||
|
||||
'Set up initial index
|
||||
For a = 1 To maxRecord
|
||||
index(a) = a
|
||||
Next a
|
||||
|
||||
|
||||
'Initialize editor variables
|
||||
currTopLine = 1
|
||||
GoSub printWholeScreen
|
||||
|
||||
currRow = 1
|
||||
currCol = 1
|
||||
GoSub GetLine
|
||||
|
||||
finished = false
|
||||
|
||||
'Main editor loop
|
||||
Do
|
||||
GoSub ShowCursor
|
||||
GoSub EditItem
|
||||
GoSub HideCursor
|
||||
|
||||
'Respond to user keystroke
|
||||
Select Case kbd$
|
||||
Case Chr$(0) + "H" 'up
|
||||
GoSub MoveUp
|
||||
Case Chr$(0) + "P" 'down
|
||||
GoSub MoveDown
|
||||
Case Chr$(0) + "K", Chr$(0) + Chr$(15) 'left or backtab
|
||||
currCol = (currCol + 4) Mod 6 + 1
|
||||
Case Chr$(0) + "M", Chr$(9) 'right, or tab
|
||||
currCol = (currCol) Mod 6 + 1
|
||||
Case Chr$(0) + "G" 'Home
|
||||
currCol = 1
|
||||
Case Chr$(0) + "O" 'End
|
||||
currCol = 6
|
||||
Case Chr$(0) + "I" 'Page up
|
||||
currRow = 1
|
||||
currTopLine = currTopLine - 22
|
||||
If currTopLine < 1 Then
|
||||
currTopLine = 1
|
||||
End If
|
||||
GoSub printWholeScreen
|
||||
currRow = 1
|
||||
GoSub GetLine
|
||||
Case Chr$(0) + "Q" 'Page Down
|
||||
currRow = 1
|
||||
currTopLine = currTopLine + 22
|
||||
If currTopLine > maxRecord Then
|
||||
currTopLine = maxRecord
|
||||
End If
|
||||
GoSub printWholeScreen
|
||||
currRow = 1
|
||||
GoSub GetLine
|
||||
Case Chr$(0) + "<" 'F2
|
||||
finished = TRUE
|
||||
Case Chr$(0) + "?" 'F5
|
||||
GoSub sort
|
||||
Case Chr$(0) + "@": 'F6
|
||||
GoSub PrintPhoneBook
|
||||
Case Chr$(0) + "C" 'F9
|
||||
GoSub AddRecord
|
||||
Case Chr$(0) + "D"
|
||||
GoSub DeleteRecord 'F10
|
||||
Case Chr$(13) 'Enter
|
||||
Case Else
|
||||
Beep
|
||||
End Select
|
||||
Loop Until finished
|
||||
Close
|
||||
Exit Sub
|
||||
|
||||
|
||||
MoveUp:
|
||||
If currRow = 1 Then
|
||||
If currTopLine = 1 Then
|
||||
Beep
|
||||
Else
|
||||
ScrollDown
|
||||
currTopLine = currTopLine - 1
|
||||
GoSub GetLine
|
||||
GoSub PrintLine
|
||||
End If
|
||||
Else
|
||||
currRow = currRow - 1
|
||||
GoSub GetLine
|
||||
End If
|
||||
Return
|
||||
|
||||
MoveDown:
|
||||
If (currRow + currTopLine - 1) >= maxRecord Then
|
||||
Beep
|
||||
Else
|
||||
If currRow = 22 Then
|
||||
ScrollDown
|
||||
currTopLine = currTopLine + 1
|
||||
GoSub GetLine
|
||||
GoSub PrintLine
|
||||
Else
|
||||
currRow = currRow + 1
|
||||
GoSub GetLine
|
||||
End If
|
||||
End If
|
||||
Return
|
||||
|
||||
PrintPhoneBook:
|
||||
Cls
|
||||
Print "THIS IS A TEMPORARY PRINT ROUTINE"
|
||||
|
||||
For a = 1 To maxRecord Step 2
|
||||
If a <= maxRecord Then
|
||||
Get #1, index(a) + 1
|
||||
For b = 1 To 6
|
||||
name1$(b) = RTrim$(io$(b))
|
||||
Next b
|
||||
Else
|
||||
For b = 1 To 6
|
||||
name1$(b) = ""
|
||||
Next b
|
||||
End If
|
||||
If a + 1 <= maxRecord Then
|
||||
Get #1, index(a + 1) + 1
|
||||
For b = 1 To 6
|
||||
name2$(b) = RTrim$(io$(b))
|
||||
Next b
|
||||
Else
|
||||
For b = 1 To 6
|
||||
name2$(b) = ""
|
||||
Next b
|
||||
End If
|
||||
u$ = "\" + Space$(35) + "\\" + Space$(38) + "\"
|
||||
Print Using u$; name1$(1); name2$(1)
|
||||
Print Using u$; name1$(3); name2$(3)
|
||||
Print Using u$; name1$(4) + "," + name1$(5) + " " + name1$(6); name2$(4) + "," + name2$(5) + " " + name2$(6)
|
||||
Print Using u$; name1$(2); name2$(2)
|
||||
Print
|
||||
Print
|
||||
Input a$
|
||||
Next a
|
||||
|
||||
GoSub printWholeScreen
|
||||
Return
|
||||
|
||||
ShowCursor:
|
||||
Color 0, 7
|
||||
Locate currRow + 2, col(currCol)
|
||||
Print Left$(edit$(currCol) + Space$(vis(currCol)), vis(currCol));
|
||||
Return
|
||||
|
||||
HideCursor:
|
||||
Color 14, 1
|
||||
Locate currRow + 2, col(currCol)
|
||||
Print Left$(edit$(currCol) + Space$(vis(currCol)), vis(currCol));
|
||||
Return
|
||||
|
||||
EditItem:
|
||||
'Wait for a keystroke
|
||||
Color 0, 7
|
||||
Do
|
||||
kbd$ = InKey$
|
||||
Loop Until kbd$ <> ""
|
||||
|
||||
'if a text char, edit the line, else return
|
||||
If kbd$ >= " " And kbd$ <= "~" Then
|
||||
kbd$ = GetString$(currRow + 2, col(currCol), kbd$, back$, vis(currCol), max(currCol))
|
||||
edit$(currCol) = back$
|
||||
GoSub putLine
|
||||
End If
|
||||
Return
|
||||
|
||||
|
||||
PrintLine:
|
||||
Color 14, 1
|
||||
currRecord = currTopLine + currRow - 1
|
||||
Locate currRow + 2, 1
|
||||
If currRecord = maxRecord + 1 Then
|
||||
Print u3$;
|
||||
ElseIf currRecord > maxRecord Then
|
||||
Print Space$(80);
|
||||
Else
|
||||
Print Using u1$; edit$(1); edit$(2); edit$(3); edit$(4); edit$(5); edit$(6);
|
||||
End If
|
||||
Return
|
||||
|
||||
|
||||
DeleteRecord:
|
||||
If maxRecord = 1 Then
|
||||
Beep
|
||||
Else
|
||||
currRecord = currTopLine + currRow - 1 'init currRecord
|
||||
maxRecord = maxRecord - 1 'Decrement maxRecord
|
||||
theRecord = index(currRecord) 'Save pointer to currRecord
|
||||
|
||||
'Removing a name leaves a hole. So...
|
||||
'Squeeze actual physical data records on disk
|
||||
For a = index(currRecord) To maxRecord
|
||||
Get #1, a + 2
|
||||
Put #1, a + 1
|
||||
Next a
|
||||
|
||||
'Squeeze the index stored in memory.
|
||||
For a = currRecord To maxRecord
|
||||
index(a) = index(a + 1)
|
||||
Next a
|
||||
|
||||
'Now that the actuall records were moved on disk, we need to
|
||||
'decrement the value of every pointer in the index array
|
||||
'that pointed to a name that was moved.
|
||||
For a = 1 To maxRecord
|
||||
If index(a) > theRecord Then
|
||||
index(a) = index(a) - 1
|
||||
End If
|
||||
Next a
|
||||
|
||||
'Update record#1
|
||||
LSet ioValid$ = "THISISVALID"
|
||||
RSet ioMaxRecord$ = Str$(maxRecord)
|
||||
Put #1, 1
|
||||
|
||||
'Reprint screen, restablish cursor position
|
||||
GoSub printWholeScreen
|
||||
currRecord = currTopLine + currRow - 1
|
||||
If currRecord > maxRecord Then
|
||||
GoSub MoveUp
|
||||
End If
|
||||
GoSub GetLine
|
||||
End If
|
||||
Return
|
||||
|
||||
|
||||
AddRecord:
|
||||
If maxRecord < 2000 Then
|
||||
currRecord = currTopLine + currRow - 1 'Establish current record#
|
||||
maxRecord = maxRecord + 1 'Increment maxRecord
|
||||
For a = 1 To 6 'Clear IO buffer
|
||||
LSet io$(a) = ""
|
||||
Next a
|
||||
Put #1, maxRecord + 1 'Insert into last pos in file
|
||||
|
||||
'We just added the new record to the physical file, now we
|
||||
'need to make room in the index
|
||||
a = maxRecord
|
||||
While a > currRecord
|
||||
index(a + 1) = index(a)
|
||||
a = a - 1
|
||||
Wend
|
||||
|
||||
'Assign new spot in index to the new record
|
||||
index(currRecord + 1) = maxRecord
|
||||
|
||||
'Update first record
|
||||
LSet ioValid$ = "THISISVALID"
|
||||
RSet ioMaxRecord$ = Str$(maxRecord)
|
||||
Put #1, 1
|
||||
|
||||
GoSub printWholeScreen
|
||||
GoSub GetLine
|
||||
Else
|
||||
Beep
|
||||
End If
|
||||
Return
|
||||
|
||||
|
||||
|
||||
printWholeScreen:
|
||||
temp = currRow
|
||||
For currRow = 1 To 22
|
||||
currRecord = currTopLine + currRow - 1
|
||||
If currRecord <= maxRecord Then
|
||||
GoSub GetLine
|
||||
End If
|
||||
GoSub PrintLine
|
||||
Next currRow
|
||||
currRow = temp
|
||||
Return
|
||||
|
||||
|
||||
putLine:
|
||||
currRecord = currTopLine + currRow - 1
|
||||
For a = 1 To 6
|
||||
LSet io$(a) = edit$(a)
|
||||
Next a
|
||||
Put #1, index(currRecord) + 1
|
||||
Return
|
||||
|
||||
GetLine:
|
||||
currRecord = currTopLine + currRow - 1
|
||||
Get #1, index(currRecord) + 1
|
||||
For a = 1 To 6
|
||||
edit$(a) = io$(a)
|
||||
Next a
|
||||
Return
|
||||
|
||||
|
||||
sort:
|
||||
'Scan database, collect the strings from the current col in key$()
|
||||
For a = 1 To maxRecord
|
||||
Get #1, index(a) + 1
|
||||
key$(a) = io$(currCol)
|
||||
Next a
|
||||
|
||||
'do the bubble sort
|
||||
Do
|
||||
swapFlag = false
|
||||
For i = 1 To maxRecord - 1
|
||||
If key$(i) > key$(i + 1) Then
|
||||
Swap key$(i), key$(i + 1)
|
||||
Swap index(i), index(i + 1)
|
||||
swapFlag = TRUE
|
||||
End If
|
||||
Next i
|
||||
Loop Until Not swapFlag
|
||||
|
||||
'Reprint the screen
|
||||
currTopLine = 1
|
||||
GoSub printWholeScreen
|
||||
currRow = 1
|
||||
GoSub GetLine
|
||||
Return
|
||||
|
||||
End Sub
|
||||
|
||||
Sub ScrollDown
|
||||
|
||||
'Call the asm routine stored in the array
|
||||
Def Seg = VarSeg(ScrollDownAsm(1))
|
||||
Call Absolute(VarPtr(ScrollDownAsm(1)))
|
||||
Def Seg
|
||||
|
||||
End Sub
|
||||
|
||||
Sub ScrollUp
|
||||
|
||||
'call the asm routnie stored in the array
|
||||
Def Seg = VarSeg(ScrollUpAsm(1))
|
||||
Call Absolute(VarPtr(ScrollUpAsm(1)))
|
||||
Def Seg
|
||||
|
||||
End Sub
|
||||
|
BIN
samples/phone/src/phone.zip
Normal file
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: PIPES PUZZLE (MAZE CONNECT)
|
||||
## SAMPLE: PIPES PUZZLE
|
||||
|
||||
![gameplay.png](img/gameplay.png)
|
||||
|
||||
|
|
BIN
samples/pixelplus/img/screenshot.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
53
samples/pixelplus/index.md
Normal file
|
@ -0,0 +1,53 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: PIXELPLUS
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Chris Chadwick](../chris-chadwick.md)
|
||||
|
||||
### Description
|
||||
|
||||
```text
|
||||
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
' PIXELplus 256 User Subroutines & Functions
|
||||
' FREEWARE version 1.0 - (C)1995 Chris Chadwick. All rights reserved.
|
||||
' For QBASIC, QuickBASIC and Visual BASIC for MS-DOS
|
||||
'
|
||||
' Consult your PIXELplus 256 User's Manual for full details on how to
|
||||
' incorporate and use the routines contained in this file.
|
||||
'
|
||||
' Note: The routines contained in this file do not contain error
|
||||
' checking. This makes the code easier to understand.
|
||||
'
|
||||
' *** BEFORE RUNNING THE DEMONSTRATION ***
|
||||
' Running the demonstration requires access to four files which should have
|
||||
' been supplied with this FREEWARE version of PIXELplus 256. They are:
|
||||
'
|
||||
' CHARSET1.PUT
|
||||
' CHARSET2.PUT
|
||||
' CHARSET3.PUT
|
||||
' STANDARD.PAL
|
||||
'
|
||||
' In your PIXELplus 256 directory (usually C:\PP256), the three .PUT files
|
||||
' should be located in the IMAGES subdirectory, and the .PAL file should be
|
||||
' located in the PALETTES subdirectory. If you have PIXELplus 256
|
||||
' installed in a directory other than C:\PP256 then the value of Path$
|
||||
' (see (*) below) should be altered appropriately before running the
|
||||
' demonstration.
|
||||
'
|
||||
' Note that CHARSET2.PUT is only a partial character set image file that
|
||||
' does not include lower case letters so text to be displayed using it
|
||||
' should only contain upper case letters.
|
||||
'
|
||||
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
```
|
||||
|
||||
### File(s)
|
||||
|
||||
* [pp256img.zip](src/pp256img.zip)
|
||||
* [usersubs.bas](src/usersubs.bas)
|
||||
|
||||
🔗 [graphics](../graphics.md), [bitmap](../bitmap.md)
|
BIN
samples/pixelplus/src/pp256img.zip
Normal file
1326
samples/pixelplus/src/usersubs.bas
Normal file
|
@ -1,6 +1,6 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: NON-PALETTE ROTATED PLASMA
|
||||
## SAMPLE: PLASMA NON-PAL
|
||||
|
||||
![screenshot.png](img/screenshot.png)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## SAMPLES: PLASMA
|
||||
|
||||
**[Non-Palette Rotated Plasma](plasma-non-pal/index.md)**
|
||||
**[Plasma Non-Pal](plasma-non-pal/index.md)**
|
||||
|
||||
[🐝 Relsoft](relsoft.md) 🔗 [screensaver](screensaver.md), [plasma](plasma.md)
|
||||
|
||||
|
|
9
samples/platform.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md)
|
||||
|
||||
## SAMPLES: PLATFORM
|
||||
|
||||
**[Platform](platform/index.md)**
|
||||
|
||||
[🐝 Fellippe Heitor](fellippe-heitor.md) 🔗 [game](game.md), [platform](platform.md)
|
||||
|
||||
# Platform What does a 2D platform game take? Made with QB64.
|
BIN
samples/platform/img/ss1.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
samples/platform/img/ss2.png
Normal file
After Width: | Height: | Size: 10 KiB |
34
samples/platform/index.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md)
|
||||
|
||||
## SAMPLE: PLATFORM
|
||||
|
||||
![ss1.png](img/ss1.png)
|
||||
|
||||
### Author
|
||||
|
||||
[🐝 Fellippe Heitor](../fellippe-heitor.md)
|
||||
|
||||
### Description
|
||||
|
||||
```text
|
||||
# Platform
|
||||
|
||||
What does a 2D platform game take?
|
||||
|
||||
Made with QB64.
|
||||
```
|
||||
|
||||
### File(s)
|
||||
|
||||
* [mrjumps.bas](src/mrjumps.bas)
|
||||
* [platform.bas](src/platform.bas)
|
||||
* [platform.zip](src/platform.zip)
|
||||
|
||||
### Additional Image(s)
|
||||
|
||||
![ss2.png](img/ss2.png)
|
||||
|
||||
🔗 [game](../game.md), [platform](../platform.md)
|
||||
|
||||
|
||||
<sub>Reference: [github.com](https://github.com/FellippeHeitor/Platform) </sub>
|
410
samples/platform/src/mrjumps.bas
Normal file
|
@ -0,0 +1,410 @@
|
|||
Option _Explicit
|
||||
|
||||
Const FALSE = 0, TRUE = Not false
|
||||
|
||||
Screen _NewImage(800, 450, 32)
|
||||
|
||||
Type newLevel
|
||||
As _Unsigned Long landColor, grassColor, waterColor
|
||||
As Long symbolSpacingX, symbolSpacingY
|
||||
End Type
|
||||
|
||||
Type object
|
||||
As Long id, w, h, img
|
||||
As Single x, xv, y, yv
|
||||
As _Byte imgPointer, standing, alive
|
||||
As _Unsigned Long color
|
||||
End Type
|
||||
|
||||
Const idPlatform = 1
|
||||
Const idGoal = 2
|
||||
Const idAirJump = 3
|
||||
Const idInfiniteJumps = 4
|
||||
Const idSpike = 5
|
||||
Const idCloud = 6
|
||||
Const idScene = 7
|
||||
Const idSky = 8
|
||||
Const idWater = 9
|
||||
|
||||
Dim Shared As Long thisLevel, arenaWidth, i, totalObjects, airJumps, hero, goal
|
||||
Dim Shared As Single x, y, camera, gravity
|
||||
Dim Shared As _Byte drowned, restartRequested, shadowCast
|
||||
Dim Shared As String platformDecoration, goalGlyph, airJumpGlyph
|
||||
Dim Shared As newLevel levelData
|
||||
Dim Shared As object obj(100), shadowCastOn
|
||||
|
||||
Randomize Timer
|
||||
|
||||
goalGlyph = "C" + Str$(_RGB32(255, 255, 255)) + "e10f10g10 h8e8f6g6 h4 e4f2g1"
|
||||
airJumpGlyph = "C" + Str$(_RGB32(255, 255, 255)) + "e10f10g10h10"
|
||||
gravity = .8
|
||||
thisLevel = 1
|
||||
|
||||
Restart:
|
||||
setLevel thisLevel
|
||||
|
||||
Do
|
||||
processInput
|
||||
doPhysics
|
||||
adjustCamera
|
||||
drawObjects
|
||||
If restartRequested Then restartRequested = FALSE: GoTo Restart
|
||||
If Not drowned Then drawHero
|
||||
checkVictory
|
||||
|
||||
If Not obj(hero).alive Then
|
||||
_PrintString (0, 0), "Dead"
|
||||
_PrintString (0, 20), Str$((obj(hero).x / arenaWidth) * 100) + "%"
|
||||
ElseIf obj(hero).standing Then
|
||||
_PrintString (0, 0), "Standing"
|
||||
End If
|
||||
|
||||
_Display
|
||||
_Limit 60
|
||||
Loop
|
||||
|
||||
Sub addWater
|
||||
Dim this As Long
|
||||
this = newObject
|
||||
obj(this).id = idWater
|
||||
obj(this).img = _NewImage(_Width, _Height, 32)
|
||||
_Dest obj(this).img
|
||||
Line (0, _Height - _Height / 4)-Step(_Width, _Height / 4), darken(levelData.waterColor, 55), BF
|
||||
Line (0, _Height - _Height / 4)-Step(_Width, _Height / 7), darken(levelData.waterColor, 70), BF
|
||||
Line (0, _Height - _Height / 4)-Step(_Width, _Height / 9), darken(levelData.waterColor, 85), BF
|
||||
Line (0, _Height - _Height / 4)-Step(_Width, _Height / 11), levelData.waterColor, BF
|
||||
_Dest 0
|
||||
End Sub
|
||||
|
||||
Sub drawObjects
|
||||
For i = 1 To totalObjects
|
||||
Select Case obj(i).id
|
||||
Case idPlatform
|
||||
_PutImage (obj(i).x + camera, obj(i).y), obj(i).img
|
||||
Case idGoal
|
||||
Draw "bm" + Str$(obj(goal).x + camera) + "," + Str$(obj(goal).y + obj(goal).h / 2)
|
||||
Draw goalGlyph
|
||||
Case idAirJump
|
||||
Draw "bm" + Str$(obj(i).x + camera) + "," + Str$(obj(i).y + obj(i).h / 2)
|
||||
Draw airJumpGlyph
|
||||
Case idCloud
|
||||
obj(i).x = obj(i).x - obj(i).xv
|
||||
If obj(i).x + obj(i).w < 0 Then obj(i).x = arenaWidth
|
||||
Line (obj(i).x + camera / 2.5, obj(i).y)-Step(obj(i).w, obj(i).h), _RGBA32(255, 255, 255, 30), BF
|
||||
Case idScene
|
||||
_PutImage (obj(i).x + camera / obj(i).xv, obj(i).y), obj(i).img
|
||||
Case idSky
|
||||
Line (0, 0)-(_Width, _Height), obj(i).color, BF
|
||||
Case idWater
|
||||
_PutImage , obj(i).img
|
||||
End Select
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub processInput
|
||||
Dim button As _Byte
|
||||
|
||||
If _KeyHit = 27 Then
|
||||
obj(hero).alive = TRUE
|
||||
obj(hero).yv = 0
|
||||
restartRequested = TRUE
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If obj(hero).alive = FALSE Then Exit Sub
|
||||
|
||||
'keep hero moving forward
|
||||
If obj(hero).x + obj(hero).w < arenaWidth + _Width Then obj(hero).x = obj(hero).x + 5
|
||||
|
||||
'If _KeyDown(19712) Then 'character goes left, screen goes right
|
||||
' obj(hero).x = obj(hero).x + 5
|
||||
'End If
|
||||
|
||||
'If _KeyDown(19200) Then 'character goes right, screen goes left
|
||||
' obj(hero).x = obj(hero).x - 5
|
||||
'End If
|
||||
|
||||
Static lastJump!, jumpKeyDown As _Byte
|
||||
Const jumpFactor = 3
|
||||
|
||||
While _MouseInput: Wend
|
||||
button = _MouseButton(1) Or _KeyDown(32)
|
||||
|
||||
If button Then '18432
|
||||
If jumpKeyDown = FALSE And (obj(hero).standing = TRUE Or airJumps > 0) Then
|
||||
If airJumps > 0 Then airJumps = airJumps - 1
|
||||
jumpKeyDown = TRUE
|
||||
obj(hero).standing = FALSE
|
||||
lastJump! = 0
|
||||
obj(hero).yv = obj(hero).yv - gravity * jumpFactor
|
||||
Else
|
||||
lastJump! = lastJump! + 1
|
||||
If lastJump! < 7 Then
|
||||
obj(hero).yv = obj(hero).yv - gravity * jumpFactor
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
jumpKeyDown = FALSE
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub adjustCamera
|
||||
camera = _Width / 4 - obj(hero).x
|
||||
If camera > 0 Then camera = 0
|
||||
If camera < -arenaWidth Then camera = -arenaWidth
|
||||
End Sub
|
||||
|
||||
Sub drawHero
|
||||
Dim shadow As object
|
||||
Line (obj(hero).x + camera, obj(hero).y)-Step(obj(hero).w, obj(hero).h), obj(hero).color, BF
|
||||
|
||||
If obj(hero).alive Then
|
||||
If shadowCast Then
|
||||
'shadow already cast on a platform
|
||||
shadow.x = (obj(hero).x + 1) + camera
|
||||
shadow.y = shadowCastOn.y + 5
|
||||
shadow.w = obj(hero).w - 2
|
||||
Do While shadow.x < shadowCastOn.x + camera
|
||||
shadow.x = shadow.x + 1
|
||||
shadow.w = shadow.w - 1
|
||||
Loop
|
||||
Do While shadow.x + shadow.w > shadowCastOn.x + shadowCastOn.w + camera
|
||||
shadow.w = shadow.w - 1
|
||||
Loop
|
||||
Line (shadow.x, shadow.y)-Step(shadow.w, 2), _RGBA32(0, 0, 0, 30), BF
|
||||
Else
|
||||
'cast shadow on water
|
||||
Line ((obj(hero).x + 1) + camera, _Height - _Height / 4 + _Height / 22)-Step(obj(hero).w - 2, 2), _RGBA32(0, 0, 0, 30), BF
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub doPhysics
|
||||
Dim j As Long
|
||||
|
||||
If Not obj(hero).alive Then Exit Sub
|
||||
|
||||
Const gravityCap = 15
|
||||
|
||||
obj(hero).standing = FALSE
|
||||
drowned = FALSE
|
||||
If obj(hero).y + obj(hero).yv + gravity > _Height - _Height / 4 + _Height / 22 Then drowned = TRUE: obj(hero).alive = FALSE: Exit Sub
|
||||
|
||||
shadowCast = FALSE
|
||||
For j = 1 To totalObjects
|
||||
If obj(j).id = idPlatform Then
|
||||
If obj(hero).x + obj(hero).w > obj(j).x And obj(hero).x < obj(j).x + obj(j).w Then
|
||||
shadowCast = TRUE
|
||||
shadowCastOn = obj(j)
|
||||
|
||||
If obj(hero).y + obj(hero).yv + gravity < obj(j).y - (obj(hero).h - 5) Then
|
||||
Exit For
|
||||
ElseIf obj(hero).y + obj(hero).yv + gravity <= obj(j).y - (obj(hero).h - 20) Then
|
||||
obj(hero).standing = TRUE
|
||||
obj(hero).y = obj(j).y - (obj(hero).h - 5)
|
||||
Exit For
|
||||
ElseIf obj(hero).y >= obj(j).y - (obj(hero).h - 20) Then
|
||||
obj(hero).alive = FALSE
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If Not obj(hero).standing Then
|
||||
obj(hero).yv = obj(hero).yv + gravity
|
||||
If obj(hero).yv > gravityCap Then obj(hero).yv = gravityCap
|
||||
obj(hero).y = obj(hero).y + obj(hero).yv
|
||||
obj(hero).color = _RGB32(255, 255, 255)
|
||||
Else
|
||||
obj(hero).yv = 0
|
||||
obj(hero).color = _RGB32(200, 200, 200)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Function hit%% (obj1 As object, obj2 As object)
|
||||
hit%% = obj1.x + obj1.w > obj2.x And obj1.x <= obj2.x + obj2.w And obj1.y + obj1.h > obj2.y And obj1.y < obj2.y + obj2.h
|
||||
End Function
|
||||
|
||||
Function darken~& (WhichColor~&, ByHowMuch%)
|
||||
darken~& = _RGB32(_Red32(WhichColor~&) * (ByHowMuch% / 100), _Green32(WhichColor~&) * (ByHowMuch% / 100), _Blue32(WhichColor~&) * (ByHowMuch% / 100))
|
||||
End Function
|
||||
|
||||
|
||||
Sub setLevel (level As Long)
|
||||
'the order of creation of objects is also the draw order
|
||||
|
||||
Dim totalPlatforms As Long
|
||||
Dim this As Long, firstPlatform As Long
|
||||
|
||||
resetObjects
|
||||
Select Case level
|
||||
Case 1
|
||||
arenaWidth = 3200
|
||||
totalPlatforms = 30
|
||||
levelData.landColor = _RGB32(194, 127, 67)
|
||||
levelData.waterColor = _RGB32(33, 166, 188)
|
||||
levelData.grassColor = _RGB32(83, 161, 72)
|
||||
|
||||
this = newObject
|
||||
obj(this).id = idSky
|
||||
obj(this).color = _RGB32(67, 200, 205)
|
||||
|
||||
addScene level
|
||||
|
||||
addWater
|
||||
|
||||
addClouds 5
|
||||
|
||||
platformDecoration = "c" + Str$(_RGB32(166, 111, 67)) + " bd5 e10r1g10r1e10r1g10r1e10r1g10r1e10r1g10"
|
||||
levelData.symbolSpacingX = 11
|
||||
levelData.symbolSpacingY = 11
|
||||
For i = 1 To totalPlatforms
|
||||
this = newObject
|
||||
obj(this).id = idPlatform
|
||||
obj(this).w = Rnd * 200 + 100
|
||||
obj(this).w = obj(this).w - (obj(this).w Mod 20)
|
||||
If i = 1 Then
|
||||
firstPlatform = this
|
||||
obj(this).h = 200
|
||||
obj(this).x = Rnd * (arenaWidth / totalPlatforms)
|
||||
Else
|
||||
obj(this).h = Rnd * 50 + 50
|
||||
obj(this).x = obj(this - 1).x + obj(this - 1).w + (Rnd * (arenaWidth / (totalPlatforms * 1.5)))
|
||||
End If
|
||||
obj(this).y = (_Height - _Height / 4 + (_Height / 20)) - obj(this).h
|
||||
drawPlatform obj(this)
|
||||
Next
|
||||
|
||||
goal = newObject
|
||||
obj(goal).id = idGoal
|
||||
obj(goal).x = arenaWidth
|
||||
obj(goal).y = _Height / 2
|
||||
obj(goal).h = 20
|
||||
obj(goal).w = 20
|
||||
|
||||
hero = newObject
|
||||
obj(hero).x = obj(firstPlatform).x
|
||||
obj(hero).y = obj(firstPlatform).y - 25
|
||||
obj(hero).w = 15
|
||||
obj(hero).h = 30
|
||||
obj(hero).alive = TRUE
|
||||
obj(hero).standing = TRUE
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Function newObject&
|
||||
totalObjects = totalObjects + 1
|
||||
If totalObjects > UBound(obj) Then
|
||||
ReDim _Preserve obj(totalObjects + 99) As object
|
||||
End If
|
||||
newObject& = totalObjects
|
||||
End Function
|
||||
|
||||
Sub resetObjects
|
||||
Dim emptyObject As object
|
||||
For i = 1 To UBound(obj)
|
||||
If obj(i).img < -1 And obj(i).imgPointer = FALSE Then _FreeImage obj(i).img
|
||||
obj(i) = emptyObject
|
||||
Next
|
||||
totalObjects = 0
|
||||
End Sub
|
||||
|
||||
Sub drawPlatform (this As object)
|
||||
this.img = _NewImage(this.w, this.h, 32)
|
||||
_Dest this.img
|
||||
Line (0, 10)-Step(this.w - 1, this.h - 1), levelData.landColor, BF
|
||||
For x = -10 To this.w Step levelData.symbolSpacingX
|
||||
For y = 15 To this.h + 10 Step levelData.symbolSpacingY
|
||||
PSet (x, y), 0
|
||||
Draw platformDecoration
|
||||
Next
|
||||
Next
|
||||
Line (0, 0)-Step(this.w - 1, 20), levelData.grassColor, BF
|
||||
Line (0, 0)-Step(this.w - 1, 10), _RGBA32(255, 255, 255, 30), BF
|
||||
Line (0, 10)-Step(5, this.h), _RGBA32(255, 255, 255, 30), BF
|
||||
Line (this.w - 6, 10)-Step(5, this.h), _RGBA32(0, 0, 0, 30), BF
|
||||
|
||||
Line (0, 5)-(5, 0), _RGB32(255, 0, 255)
|
||||
Paint (0, 0), _RGB32(255, 0, 255), _RGB32(255, 0, 255)
|
||||
Line (_Width - 1, 5)-(_Width - 6, 0), _RGB32(255, 0, 255)
|
||||
Paint (_Width - 1, 0), _RGB32(255, 0, 255), _RGB32(255, 0, 255)
|
||||
Line (0, this.h - 4)-Step(this.w, 3), _RGB32(255, 0, 255), BF
|
||||
_ClearColor _RGB32(255, 0, 255)
|
||||
Line (0, this.h - 5)-Step(this.w - 1, 5), _RGBA32(0, 0, 0, 30), BF
|
||||
_Dest 0
|
||||
End Sub
|
||||
|
||||
Sub addClouds (max As Long)
|
||||
Dim this As Long
|
||||
|
||||
For i = 1 To max
|
||||
this = newObject
|
||||
obj(this).id = idCloud
|
||||
obj(this).x = Rnd * arenaWidth
|
||||
obj(this).y = Rnd * (_Height / 2)
|
||||
obj(this).h = 30
|
||||
obj(this).w = arenaWidth / max
|
||||
obj(this).xv = Rnd
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub addScene (level As Long)
|
||||
Dim this As Long, firstItem As Long
|
||||
|
||||
Select Case level
|
||||
Case 1
|
||||
'green mountains, 2 layers
|
||||
|
||||
'farther range
|
||||
For i = 1 To 20
|
||||
this = newObject
|
||||
If i = 1 Then
|
||||
firstItem = this
|
||||
obj(this).img = _NewImage(_Width, _Height, 32)
|
||||
_Dest obj(this).img
|
||||
Line (0, _Height - 1)-(_Width / 2, 0), _RGB32(100, 150, 122)
|
||||
Line -(_Width - 1, _Height - 1), _RGB32(100, 150, 122)
|
||||
Line -(0, _Height - 1), _RGB32(100, 150, 122)
|
||||
Paint (_Width / 2, _Height / 2), _RGB32(100, 150, 122), _RGB32(100, 150, 122)
|
||||
_Dest 0
|
||||
Else
|
||||
obj(this).img = obj(firstItem).img
|
||||
obj(this).imgPointer = TRUE
|
||||
End If
|
||||
|
||||
obj(this).id = idScene
|
||||
obj(this).x = Rnd * arenaWidth
|
||||
obj(this).y = Rnd * (_Height / 2)
|
||||
obj(this).xv = 2.5
|
||||
Next
|
||||
|
||||
'closer range
|
||||
For i = 1 To 20
|
||||
this = newObject
|
||||
If i = 1 Then
|
||||
firstItem = this
|
||||
obj(this).img = _NewImage(_Width, _Height, 32)
|
||||
_Dest obj(this).img
|
||||
Line (0, _Height - 1)-(_Width / 2, 0), _RGB32(78, 111, 67)
|
||||
Line -(_Width - 1, _Height - 1), _RGB32(78, 111, 67)
|
||||
Line -(0, _Height - 1), _RGB32(78, 111, 67)
|
||||
Paint (_Width / 2, _Height / 2), _RGB32(78, 111, 67), _RGB32(78, 111, 67)
|
||||
_Dest 0
|
||||
Else
|
||||
obj(this).img = obj(firstItem).img
|
||||
obj(this).imgPointer = TRUE
|
||||
End If
|
||||
|
||||
obj(this).id = idScene
|
||||
obj(this).x = Rnd * arenaWidth
|
||||
obj(this).y = Rnd * (_Height / 2)
|
||||
obj(this).xv = 2
|
||||
Next
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Sub checkVictory
|
||||
If hit(obj(hero), obj(goal)) Then _AutoDisplay: _PrintString (_Width / 2 - _PrintWidth("Level complete!") / 2, _Height / 2 - _FontHeight / 2), "Level complete!": restartRequested = TRUE: Sleep
|
||||
End Sub
|
||||
|
340
samples/platform/src/platform.bas
Normal file
|
@ -0,0 +1,340 @@
|
|||
Const FALSE = 0, TRUE = Not FALSE
|
||||
|
||||
Const objHero = 1
|
||||
Const objEnemy = 2
|
||||
Const objFloor = 3
|
||||
Const objBonus = 4
|
||||
Const objBackground = 5
|
||||
Const objBlock = 6
|
||||
|
||||
Dim Shared kinds(1 To 6) As String
|
||||
kinds(1) = "Hero"
|
||||
kinds(2) = "Enemy"
|
||||
kinds(3) = "Floor"
|
||||
kinds(4) = "Bonus"
|
||||
kinds(5) = "Background"
|
||||
kinds(6) = "Block"
|
||||
|
||||
Const objShapeRect = 0
|
||||
Const objShapeRound = 1
|
||||
Const g = 1
|
||||
|
||||
Type Objects
|
||||
kind As Integer
|
||||
shape As Integer
|
||||
x As Integer
|
||||
xv As Single
|
||||
y As Integer
|
||||
yv As Single
|
||||
w As Integer
|
||||
h As Integer
|
||||
color As _Unsigned Long
|
||||
landedOn As Long
|
||||
taken As _Byte
|
||||
End Type
|
||||
|
||||
ReDim Shared Object(1 To 100) As Objects
|
||||
Dim Shared TotalObjects As Long
|
||||
Dim Shared Hero As Long, NewObj As Long
|
||||
Dim Shared Dead As _Byte, CameraX As Long, CameraY As Long
|
||||
Dim Shared Points As Long
|
||||
|
||||
Screen _NewImage(800, 600, 32)
|
||||
_PrintMode _KeepBackground
|
||||
|
||||
Do
|
||||
Level = Level + 1
|
||||
SetLevel Level
|
||||
|
||||
Do
|
||||
ProcessInput
|
||||
DoPhysics
|
||||
UpdateScreen
|
||||
_Limit 35
|
||||
Loop
|
||||
Loop
|
||||
|
||||
System
|
||||
|
||||
Function AddObject (Kind As Integer, x As Single, y As Single, w As Single, h As Single, c As _Unsigned Long)
|
||||
TotalObjects = TotalObjects + 1
|
||||
If TotalObjects > UBound(Object) Then
|
||||
ReDim _Preserve Object(1 To UBound(Object) + 99) As Objects
|
||||
End If
|
||||
|
||||
Object(TotalObjects).kind = Kind
|
||||
|
||||
Object(TotalObjects).x = x
|
||||
Object(TotalObjects).y = y
|
||||
Object(TotalObjects).w = w
|
||||
Object(TotalObjects).h = h
|
||||
Object(TotalObjects).color = c
|
||||
|
||||
AddObject = TotalObjects
|
||||
End Function
|
||||
|
||||
Sub ProcessInput
|
||||
Static JumpButton As _Byte
|
||||
If _KeyDown(19712) And Not Dead Then
|
||||
If _KeyDown(100306) Then
|
||||
Object(Hero).x = Object(Hero).x + 1
|
||||
Do While _KeyDown(19712): Loop
|
||||
Else
|
||||
If Object(Hero).xv < 0 Then
|
||||
Object(Hero).xv = Object(Hero).xv + 2
|
||||
Else
|
||||
Object(Hero).xv = 4
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If _KeyDown(19200) And Not Dead Then
|
||||
If _KeyDown(100306) Then
|
||||
Object(Hero).x = Object(Hero).x - 1
|
||||
Do While _KeyDown(19200): Loop
|
||||
Else
|
||||
If Object(Hero).xv > 0 Then
|
||||
Object(Hero).xv = Object(Hero).xv - 2
|
||||
Else
|
||||
Object(Hero).xv = -4
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If _KeyDown(18432) And Not Dead Then
|
||||
If Not JumpButton Then
|
||||
JumpButton = TRUE
|
||||
If Object(Hero).landedOn > 0 Then Object(Hero).yv = -20: Object(Hero).landedOn = 0
|
||||
End If
|
||||
ElseIf Not _KeyDown(18432) Then
|
||||
If JumpButton Then JumpButton = FALSE
|
||||
End If
|
||||
If _KeyDown(13) And Dead Then
|
||||
Dead = 0
|
||||
Object(Hero).x = 25
|
||||
Object(Hero).y = _Height - _Height / 5 - 22
|
||||
Object(Hero).yv = 0
|
||||
Object(Hero).xv = 0
|
||||
Object(Hero).landedOn = 0
|
||||
End If
|
||||
If _KeyDown(27) Then System
|
||||
End Sub
|
||||
|
||||
Sub DoPhysics
|
||||
For i = 1 To TotalObjects
|
||||
If Object(i).kind = objHero Or Object(i).kind = objEnemy Then
|
||||
|
||||
If Object(i).kind = objEnemy Then
|
||||
If Object(Hero).x < Object(i).x Then Object(i).xv = -1.5 Else Object(i).xv = 1.5
|
||||
End If
|
||||
|
||||
Object(i).x = Object(i).x + Object(i).xv
|
||||
Object(i).y = Object(i).y + Object(i).yv
|
||||
|
||||
If Object(i).landedOn = 0 Then
|
||||
Object(i).yv = Object(i).yv + g
|
||||
End If
|
||||
|
||||
For j = 1 To TotalObjects
|
||||
|
||||
If Object(i).yv < 0 Then
|
||||
If Object(j).kind = objBlock Then
|
||||
If Object(i).x + Object(i).w > Object(j).x And Object(i).x < Object(j).x + Object(j).w Then
|
||||
If Object(i).y > Object(j).y And Object(i).y < Object(j).y + Object(j).h + 1 Then
|
||||
Object(i).yv = 2
|
||||
Object(i).y = Object(i).y + 2
|
||||
If Object(j).taken = FALSE Then
|
||||
Object(j).taken = TRUE
|
||||
Object(j).color = _RGB32(122, 100, 78)
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Object(i).kind = objHero And Object(j).kind = objBonus And Object(j).taken = FALSE Then
|
||||
If Object(i).y + Object(i).h >= Object(j).y And Object(i).y <= Object(j).y + Object(j).h Then
|
||||
If Object(i).x + Object(i).w > Object(j).x And Object(i).x < Object(j).x + Object(j).w Then
|
||||
Object(j).taken = TRUE
|
||||
Points = Points + 10
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Object(i).xv > 0 Then
|
||||
If Object(j).kind = objBlock Or Object(j).kind = objEnemy Then
|
||||
If Object(i).y + Object(i).h >= Object(j).y And Object(i).y <= Object(j).y + Object(j).h Then
|
||||
If Object(i).x + Object(i).w > Object(j).x And Object(i).x < Object(j).x + Object(j).w Then
|
||||
Object(i).x = Object(j).x - Object(i).w - 1
|
||||
Object(i).xv = 0
|
||||
If Object(i).kind = objHero And Object(j).kind = objEnemy And Object(j).taken = FALSE Then Dead = TRUE: Object(j).taken = TRUE
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
ElseIf Object(i).xv < 0 Then
|
||||
If Object(j).kind = objBlock Then
|
||||
If Object(i).y + Object(i).h >= Object(j).y And Object(i).y <= Object(j).y + Object(j).h Then
|
||||
If Object(i).x + Object(i).w > Object(j).x And Object(i).x < Object(j).x + Object(j).w Then
|
||||
Object(i).x = Object(j).x + Object(j).w + 1
|
||||
Object(i).xv = 0
|
||||
If Object(i).kind = objHero And Object(j).kind = objEnemy And Object(j).taken = FALSE Then Dead = TRUE: Object(j).taken = TRUE
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Object(i).yv >= 0 Then
|
||||
If Object(j).kind = objFloor Or Object(j).kind = objBlock Then
|
||||
If Object(i).x + Object(i).w >= Object(j).x And Object(i).x <= Object(j).x + Object(j).w Then
|
||||
If Object(i).y + Object(i).h > Object(j).y And Object(i).y < Object(j).y + Object(j).h Then
|
||||
Object(i).y = Object(j).y - Object(i).h - 1
|
||||
Object(i).yv = 0
|
||||
Object(i).landedOn = j
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
If Object(i).landedOn = j Then
|
||||
Object(i).landedOn = 0
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If Object(Hero).y > _Height Then Dead = TRUE
|
||||
|
||||
If Object(i).xv > 0 Then Object(i).xv = Object(i).xv - 1
|
||||
If Object(i).xv < 0 Then Object(i).xv = Object(i).xv + 1
|
||||
If Object(i).yv <> 0 Then Object(i).yv = Object(i).yv + g
|
||||
End If
|
||||
Next
|
||||
|
||||
If Object(Hero).x + CameraX > _Width / 2 Then
|
||||
CameraX = _Width / 2 - Object(Hero).x
|
||||
ElseIf Object(Hero).x + CameraX < _Width / 5 Then
|
||||
CameraX = _Width / 5 - Object(Hero).x
|
||||
End If
|
||||
|
||||
If Object(Hero).y + CameraY < _Height / 3 Then
|
||||
CameraY = -Object(Hero).y + _Height / 3
|
||||
ElseIf Object(Hero).y + CameraY > _Height / 2 Then
|
||||
CameraY = _Height / 2 - Object(Hero).y
|
||||
End If
|
||||
|
||||
If CameraX > 0 Then CameraX = 0
|
||||
If CameraY < 0 Then CameraY = 0
|
||||
End Sub
|
||||
|
||||
Sub UpdateScreen
|
||||
Cls
|
||||
|
||||
Dim this As Objects
|
||||
|
||||
For i = 1 To TotalObjects
|
||||
this = Object(i)
|
||||
If this.kind > 0 Then
|
||||
If this.kind = objBackground Then
|
||||
thisCameraX = CameraX / 2
|
||||
thisCameraY = CameraY / 2
|
||||
Else
|
||||
thisCameraX = CameraX
|
||||
thisCameraY = CameraY
|
||||
End If
|
||||
If (this.kind = objEnemy Or this.kind = objBonus) And this.taken Then GoTo Continue
|
||||
If this.x + this.w + thisCameraX < 0 And this.shape <> objShapeRound Then
|
||||
GoTo Continue
|
||||
ElseIf thisCameraX + this.x + this.w + this.w / 2 < 0 And this.shape = objShapeRound Then
|
||||
GoTo Continue
|
||||
End If
|
||||
If this.x + thisCameraX > _Width Then GoTo Continue
|
||||
If this.shape = objShapeRect Then
|
||||
Line (this.x + thisCameraX, this.y + thisCameraY)-Step(this.w, this.h), this.color, BF
|
||||
Line (this.x + thisCameraX, this.y + thisCameraY)-Step(this.w, this.h), _RGB32(0, 0, 0), B
|
||||
'_PRINTSTRING (this.x + CameraX, this.y), LTRIM$(STR$(this.x)) + STR$(this.x + this.w)
|
||||
ElseIf this.shape = objShapeRound Then
|
||||
For k = 1 To this.w
|
||||
Circle (thisCameraX + this.x + this.w / 2, thisCameraY + this.y + this.h / 2), k, this.color, , , this.w / this.h
|
||||
Next
|
||||
Circle (thisCameraX + this.x + this.w / 2, thisCameraY + this.y + this.h / 2), this.w, _RGB32(0, 0, 0), , , this.w / this.h
|
||||
End If
|
||||
'IF this.kind = objHero AND this.landedOn > 0 THEN _PRINTSTRING (this.x + CameraX, this.y - _FONTHEIGHT), "Landed on" + STR$(this.landedOn)
|
||||
Print i; kinds(this.kind)
|
||||
End If
|
||||
Continue:
|
||||
Next
|
||||
|
||||
Print "CameraX"; CameraX
|
||||
Print "CameraY"; CameraY
|
||||
|
||||
If Dead Then
|
||||
_PrintString (_Width / 2 - _PrintWidth("You're dead!") / 2, _Height / 2 - _FontHeight), "You're dead!"
|
||||
_PrintString (_Width / 2 - _PrintWidth("(hit ENTER)") / 2, _Height / 2 + _FontHeight), "(hit ENTER)"
|
||||
End If
|
||||
|
||||
If Points > 0 Then _PrintString (0, 0), Str$(Points)
|
||||
|
||||
_Display
|
||||
End Sub
|
||||
|
||||
Sub SetLevel (__Level As Integer)
|
||||
Dim Level As Integer, MaxLevels As Integer
|
||||
|
||||
MaxLevels = 1
|
||||
|
||||
If __Level > MaxLevels Then
|
||||
Level = _Ceil(Rnd * MaxLevels)
|
||||
Else
|
||||
Level = __Level
|
||||
End If
|
||||
|
||||
Select Case Level
|
||||
Case 1
|
||||
NewObj = AddObject(objBackground, 0, 0, _Width * 2, _Height, _RGB32(61, 161, 222))
|
||||
|
||||
For i = 1 To 10
|
||||
NewObj = AddObject(objBackground, Rnd * _Width * 2, Rnd * -_Height, 50, 100, _RGB32(255, 255, 255))
|
||||
Object(NewObj).shape = objShapeRound
|
||||
Next
|
||||
|
||||
NewObj = AddObject(objFloor, 20, _Height - _Height / 5, _Width * 1.5, 150, _RGB32(111, 89, 50))
|
||||
NewObj = AddObject(objFloor, 1300, _Height - _Height / 5, _Width * 1.5, 150, _RGB32(111, 89, 50))
|
||||
|
||||
NewObj = AddObject(objFloor, 110, 400, 110, 10, _RGB32(111, 89, 50))
|
||||
|
||||
NewObj = AddObject(objFloor, 400, 400, 110, 10, _RGB32(111, 89, 50))
|
||||
NewObj = AddObject(objFloor, 575, 330, 110, 10, _RGB32(111, 89, 50))
|
||||
NewObj = AddObject(objFloor, 700, 260, 110, 10, _RGB32(111, 89, 50))
|
||||
NewObj = AddObject(objFloor, 875, 200, 110, 10, _RGB32(111, 89, 50))
|
||||
NewObj = AddObject(objFloor, 1000, 140, 110, 10, _RGB32(111, 89, 50))
|
||||
NewObj = AddObject(objFloor, 1175, 70, 110, 10, _RGB32(111, 89, 50))
|
||||
NewObj = AddObject(objFloor, 1000, 10, 110, 10, _RGB32(111, 89, 50))
|
||||
NewObj = AddObject(objFloor, 875, -50, 110, 10, _RGB32(111, 89, 50))
|
||||
NewObj = AddObject(objFloor, 700, -110, 110, 10, _RGB32(111, 89, 50))
|
||||
|
||||
NewObj = AddObject(objBlock, 20, 400, 25, 25, _RGB32(216, 166, 50))
|
||||
|
||||
NewObj = AddObject(objBlock, 200, _Height - _Height / 5 - 16, 15, 15, _RGB32(216, 166, 50))
|
||||
NewObj = AddObject(objBlock, 216, _Height - _Height / 5 - 16, 15, 15, _RGB32(216, 166, 50))
|
||||
NewObj = AddObject(objBlock, 232, _Height - _Height / 5 - 16, 15, 15, _RGB32(216, 166, 50))
|
||||
NewObj = AddObject(objBlock, 216, _Height - _Height / 5 - 32, 15, 15, _RGB32(216, 166, 50))
|
||||
NewObj = AddObject(objBlock, 232, _Height - _Height / 5 - 32, 15, 15, _RGB32(216, 166, 50))
|
||||
NewObj = AddObject(objBlock, 232, _Height - _Height / 5 - 48, 15, 15, _RGB32(216, 166, 50))
|
||||
|
||||
NewObj = AddObject(objBonus, 800, 270, 15, 10, _RGB32(249, 244, 55))
|
||||
Object(NewObj).shape = objShapeRound
|
||||
|
||||
NewObj = AddObject(objBonus, 820, 320, 15, 10, _RGB32(249, 244, 55))
|
||||
Object(NewObj).shape = objShapeRound
|
||||
|
||||
NewObj = AddObject(objBonus, 1200, _Height - _Height / 5 - 22, 15, 10, _RGB32(249, 244, 55))
|
||||
Object(NewObj).shape = objShapeRound
|
||||
|
||||
NewObj = AddObject(objEnemy, 1200, _Height - _Height / 5 - 22, 15, 10, _RGB32(150, 89, 238))
|
||||
|
||||
Hero = AddObject(objHero, 25, _Height - _Height / 5 - 22, 10, 20, _RGB32(127, 244, 127))
|
||||
End Select
|
||||
End Sub
|
||||
|
BIN
samples/platform/src/platform.zip
Normal file
|
@ -2,7 +2,7 @@
|
|||
|
||||
## SAMPLES: PLATFORMER
|
||||
|
||||
**[ArcDemo](arc-demo/index.md)**
|
||||
**[Arc Demo](arc-demo/index.md)**
|
||||
|
||||
[🐝 Tsiplacov Sergey](tsiplacov-sergey.md) 🔗 [game](game.md), [platformer](platformer.md)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## SAMPLES: PONG
|
||||
|
||||
**[4 Player Pong](four-player-pong/index.md)**
|
||||
**[Four Player Pong](four-player-pong/index.md)**
|
||||
|
||||
[🐝 Matthew](matthew.md) 🔗 [game](game.md), [pong](pong.md)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## SAMPLES: PUZZLE
|
||||
|
||||
**[Pipes Puzzle (Maze Connect)](pipes-puzzle/index.md)**
|
||||
**[Pipes Puzzle](pipes-puzzle/index.md)**
|
||||
|
||||
[🐝 Dav](dav.md) 🔗 [game](game.md), [puzzle](puzzle.md)
|
||||
|
||||
|
|