Git Product home page Git Product logo

fishy-game's Introduction

Fishy-Game

Help our player eat as much fishes as you can and avoid getting killed by sharks and underwater bombs!

Game description:

The game starts with the main page where you can choose which mode you want to play war or peace, and can go to the options page.

In the option page, you can chose the shape of the fish that you want to play with and also you can choose the sea that you want to play your game in.


In both of the 2 modes you have to eat 30 fish to win the game, and every 5 fish you eat, makes you grow!
In the peace mode, you have 2 enemies: the shark which makes you lose once it eats you! and the stinky fish which makes you rotate and prevent you from eating anything.
Stiky fish

In the war mode, your only enemy is the bombs that come from the warship, you have to avoid them at all costs!

A demo video bfor our game: https://youtu.be/sUe1R777zTM

Code Description:

**Language: ** java

Versions of Processing 3:

-we run this code on those versions of processing:
    -Processing 3.5.3 
    -Processing 3.5.4

We used different oop techniques:

  • We used the concept of " Inheritance " where class "Shark" and class "Food" extend from class "Fishs"(parent)
  • We also made sure to apply the abstraction concept.

To help you understand the code

If you are new to processing3, you need to know that the setup function will be called only 1 time and that is why we use it to load all the images at once, load the sound and also initializing our fishes hashmaps.

the start_page class is the only class which is clled at the draw function - which is looping all the game - and it calls all the other classes based on the page_flag that's raised.

Initially the page_flag = 0 so the start page will be showed, if the player pressed "options" page_flag will be equal to 700 and the options class will be called.
if the player pressed "start peace" page_flag will be equal to -8 and the Body and Player classes will be called.
if the player pressed "start war" page_flag will be equal to -7 and the Body, Player and War classes will be called.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.