Giter Club home page Giter Club logo

space-invaders's Introduction

Space Invaders

This code is the starting point of a coding Dojo held by the Lambda Rennes functional programming meetup. The goal is to implement a clone of all-time video game classic: SPACE INVADERS !

We use the Haskell programming language, which embraces pure functional programming. We rely on the Gloss library, which exposes an Elm-ish API for writing interactive applications using 2D graphics.

Your tasks

As it is, the code compiles and displays:

  • The spaceship.
  • A monster.
  • A trippy background image.

The game is entirely static and does not respond to user input. Your are asked to fill in the blanks and implement the missing features.

TASK 1: Move spaceship and monsters to Game

Current status: the rendering function displays a single monster at a fixed position, irrelevant of the game state. The same holds for the spaceship.

Intended status: monsters and spaceships are rendered based on the state of the game (Game).

TASK 2: Allow the spaceship to move

The player should be able to move the spaceship with left and right arrow keys. The spaceship should not be allowed to move past window boundaries.

TASK 3: Missiles

Allow the user to send missiles by hitting spacebar. Make sure to remove missiles out of the drawing area !

TASK 4: Monster / missile collision

When a missile hits a monster, both should be destroyed.

TASK 5: Scoring

Keep track of and render the player's score. Each monster should give 10 points.

TASK 6: Invasion

Monsters should move downwards, row-by-row, every few seconds.

TASK 7: Death

A collision between the spaceship and a monster should end the game

Project structure

The project is composed of:

  • A library, which contains all of the type definitions and application logic. Its code is found in src/.
  • An executable that performs all the necessary plumbing for starting up the game. Its code is found in app/.

The interesting part of the code, where most of your work will take place, is found in the SpaceInvaders module of the library (src/SpaceInvaders.hs)

Compiling your code

To compile your code, type:

stack build

To run the program, type:

stack exec space-invaders

Have fun !!

space-invaders's People

Contributors

akhesacaro avatar akhesacaro-fretlink 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.