Giter Club home page Giter Club logo

jumpshot's Introduction

JumpShot

Introduction

JumpShot is an app that blends basketball and JavaScript together for maximum fun. The goal of the game is keep the ball bouncing higher and pass through hoops to score extra points. Don't go out of bounds!

Play JumpShot!

alt text

Gameplay

After pressing enter to start, the player uses the left and right arrows to keep the basketball bouncing on platforms. Every new platform reached adds ten points to the score, and new levels are achieved every 200 points. But be careful! The platforms get smaller every level, and just like with the sport the ball can't go out of bounds.

alt text

Technologies

JumpShot utilizes HTML's Canvas to render interactive objects on the screen. JavaScript and jQuery create the game cycle, physics, and points and bounds logic.

Several aspects are constantly checked: whether the ball is rising or falling, the positions of the ball and all the platforms, and whether the ball and a platform have collided.

The below function is applied to the ball when it reaches it peak. It checks if the the ball's y-coordinate on the canvas is above the canvas' floor. If it is, then the ball continues to "fall" by having its y-coordinate lowered. If not, then the "falling" condition is stopped.

fallCon() {
  let ballContext = this.ball;

  if (ballContext.Y < height - ballContext.height) {
    ballContext.setPos(ballContext.X, ballContext.Y + ballContext.fallVel);
    ballContext.fallVel++;
  } else {
    ballContext.fallStop();
  }
}

jumpshot's People

Contributors

rgoc123 avatar

Watchers

 avatar

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.