Giter VIP home page Giter VIP logo

bouncer's Introduction

bouncer's People

Contributors

laurentj avatar matthfleury avatar orestevisari avatar philippebenoit avatar rim-k avatar yoric avatar zekdar avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bouncer's Issues

Let's make it fun

So far, the game is not fun.

Here is a possible design to make it fun:

  • start with one ball, don't automatically launch new balls;
  • whenever a ball hits a pad, it splits and become two balls of the same random kind/colors;
  • whenever a ball leaves the screen, it disappears;
  • the game is over when we have no balls left.

We'll add special effects to ball kind/colors in followup issues. Here are a few ideas:

  • pad breaker (issue #36);
  • balls that increase or decrease the size of the pad whenever they bounce on one (issue #55);
  • balls that increase or decrease the speed of the game whenever they bounce on a pad;
  • balls with gravity effect that attract/repulse all other balls;
  • balls that create/destroy other balls when they collide with them;
  • balls that increase/decrease the score whenever they bounce;
  • ...

Edit See also #69.

Refine bouncing

When the ball bounces close to the edge of a pad, we should not apply purely a vertical/horizontal mirror, but modify it to make it feel more natural.

Bonus: Portals!

A special case of bonus in which we show not one but two objects, the ends of the portal. Whenever the ball collides with one of the ends of the portal, it immediately re-appears with the same speed at the other end of the portal.

Make it work with Chrome

Issue #20 indicates clearly that Bouncer doesn't work with Chrome because we use for (x of ...) which Chrome doesn't implement yet.

We need to fix this.

Bonus: Gravity

Add two kinds of bonus objects:

  • black holes, that attract the ball;
  • white holes, that push the ball away.

Requires #21.

Support bonus/malus objects

Every few seconds, display an object somewhere on the screen, with the following properties:

  • after two seconds, the object disappears;
  • when a ball collides with the object, the object disappears, the ball doesn't bounce;
  • when a ball collides with the object, the ball becomes slower.

In future issues, we will add other kinds of bonus objects.

Assign a color to balls

When we create balls, we should assign them a kind and color.
From this point, whenever a ball bounces, its color changes a little, randomly.

We will use the color at a later stage for bonus/malus stuff.

Color: pad breaker

When a ball is black (i.e. all its color components are < 0.1), reverse its behavior: touching the ball with the pad decreases the health, touching the walls doesn't.

Requires #29, #17.

Instead of changing ball color, we should change its CSS class

At the moment, we write directly to ball.style.color. This is too hardcoded and too low-level. Rather, we should:

  • define in style.css a set of ball classes;
  • pick a class name instead of a color name;
  • set it in ball.element.classList instead of ball.style.color.

Nicer display for the score

Since #22, we have a score, but its display is ugly. Make it nicer.
This can also serve later when/if we start displaying health.

Malus: Black hole

Add a bonus/malus object (requires issue #21) that "eats" the balls. When a ball is eaten, it disappears.

Bonus: Color mixer

Add a color mixer bonus object that randomly changes the color of a ball.

Requires #21.

Make it possible to lose

At the moment, the game never ends.
We should make it possible to lose:

  • players start with a health of 100;
  • whenever a ball touches one of the borders of the screen, decrease health by 10;
  • whenever health reaches 0, the game is over;
  • whenever a ball touches a pad, increase health by 1 (i.e. regenerate).

This health should be visible somewhere, e.g. by the color of the background or that of the screen borders.

Add a score

Whenever the ball bounces on a pad, increase the score by 100 points.
The score should be displayed somewhere on the screen.

Use a transformation to move sprites

At the moment, sprites are moved by using style.left: ... and style.top: .... It would be much faster if we used transform: translateX(...) translateY(...).

Score multiplier

Initially the score increases by 100 points per bounce. Progressively increase this when the game lasts longer.

We also need to display a message with the multiplier once we enter this multiplier mode.

This requires issue #22.

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.