Skip to content

Latest commit

 

History

History
70 lines (47 loc) · 1.99 KB

README.md

File metadata and controls

70 lines (47 loc) · 1.99 KB

FRUIT NINJA 🥝

Fruit Ninja - the most popular fruit-slicing game in the world! This game is built completely using the p5js JavaScript library.

GETTING STARTED 📝

To start playing:

HOW TO PLAY? ⁉️

RULE 1: Slice fruit 🥝
RULE 2: Don't slice bombs 💣
...and that is all you need to know to get started with the addictive Fruit Ninja action!!

TO-DO 📋

  • Add sounds
  • Fix bugs
  • Add modes
  • Mobile friendly

ABOUT p5js 💬

Basic sketch

  • This is the basic setup for a p5.js sketch- setup() and draw().

  • Note: p5.js will also require an empty HTML file that links to the p5.js library and your sketch file in the header.

    function setup() {
      // setup stuff
    }
    function draw() {
      // draw stuff
    }
  • Alternatively, you could use the preload() function.

  • If a preload() block exists it runs first, then setup() will wait until everything in there has completed before it gets run, so you can make use of things loaded in preload in setup and draw.

    let img;
    function preload() {
      img = loadImage('img.jpg');
    }

Game Snapshot 📷

Fruit Ninja

REFERENCES 📚

p5js Documentation: A complete guide on how to use the p5js library.

CONTRIBUTE :shipit:

Issues, PRs, and all your suggestions and discussions are very welcome!