Giter VIP home page Giter VIP logo

invaderz's Introduction

InvaderZ

InvaderZ is like the game Space Invaders, except InvaderZ uses the genetic algorithm to mutate the invaders as you play.

InvaderZ

If you want to see a live version of it, it's hosted here.

Alternative link.

You can also add it as an app to your phone (menu / add to home screen), if you wish so.

How to Play

Left arrow or A keys - move the cannon to the left

Right arrow or D keys - move the cannon to the right

Space bar - Shoots;

IF you are on your phone or tablet, use the buttons

About

You are the last hope of the human kind as the defense against the InvaderZ. They are deployed by their mothership with the sole purpose of entering earth's atmosphere. Although they are not a danger for you as an individual, if 5 of them gets through, everything is doomed. You can only shoot one projectile at the time, so be mindful, as you are not getting another shot until the last fired projectile disperse into the space or hits a target. Each InvaderZ has a shape that influence how they move. When a InvaderZ dies, they upload their progress to the mothership, so it can generate more InvaderZ like the ones who did well before. After each 7 generations of InvaderZ, the mothership generates a complete new wave of InvaderZ keeping only the very best of the last past 7 generations.

Genetic Algorithm

A random population of InvaderZ are generated at the beginning of the game.

The fit score of the InvaderZ is how far it made through the earth's atmosphere.

The way they move are directly related to their body shape.

After they die, a new wave of InvaderZ are created by crossing over the InvaderZ with the higher fit score.

The cross over could happen of 6 different forms:

  • First horizontal half of the first parent with the second horizontal half of the second parent.
  • First horizontal half of the second parent with the second horizontal half of the first parent.
  • First vertical half of the first parent with the second vertical half of the second parent.
  • First vertical half of the second parent with the second vertical half of the first parent.
  • Odd genes from the first parent, even genes from the second parent.
  • Even genes from the first parent, odd genes from the second parent.

There's a 10% chance of mutation after each cross over, altering their body shape and so the way they move.

To keep things interesting, after 7 generations, a new wave is created from scratch and only the best of the 7 past generations is keep.

Donations

invaderz's People

Contributors

bkbeckman avatar imgbotapp avatar jwharrie avatar victorqribeiro avatar vocalfan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

invaderz's Issues

Player moves too slow

The hardest part of the game are not the invaders, but the inability of the player to move from left to right, in the code the player moves at increments of 0.01, I updated the value in the developer console to 0.05 and the game becomes more "playable".

Zoom on Ipad Pro in Safari

Hey there,
the soon as I start playing the game on the live version,
I get zoomed in, and can‘t see the upper halve of the game anymore.
Know any way this could be fixed?
Cool idea, btw!

Demo is not opening

I tried opening the mentioned link of the demo. But it didn't open and showed an error, Site cannot be reached

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.