Giter Site home page Giter Site logo

franciscoknebel / spaceinvader Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 1.0 43.23 MB

MelonJS Space Invaders-like space shooter game implementation.

Home Page: https://franciscoknebel.github.io/spaceinvader/

License: MIT License

JavaScript 98.97% CSS 0.49% HTML 0.54%
melonjs space-invaders spaceinvaders

spaceinvader's Introduction

Space Invader

A MelonJS Space Invaders-like space shooter game. You can play the latest stable release right here in your browser, at https://franciscoknebel.github.io/spaceinvader/.

Instructions to create an executable for most platforms can be found below.

Inspired by the example from http://melonjs.github.io/tutorial-space-invaders/

development Travis AppVeyor

master Travis AppVeyor

Greenkeeper badge

Development

Before anything, please read the CONTRIBUTING.md file, for all the project guidelines.

To build, be sure you have node installed. Clone the project:

git clone --recurse-submodules https://github.com/FranciscoKnebel/spaceinvader.git

Then in the cloned directory, simply run:

npm install

Install the submodule dependencies too:

npm run install-submodules

Be sure to check if the module projects have any other setup on their respective README.md files.

You must also have grunt-cli installed globally:

npm install -g grunt-cli

Developing the game:

grunt dev

And you will have the game running on http://localhost:8000

Building Release Versions

To build:

grunt

This will create a build directory containing the files that can be uploaded to a server, or packaged into a mobile app.

Updating docs folder for web release

npm run build-docs

Packaging a standalone desktop release via scripts

grunt dist
npm run build-**

Where ** can be win32 (Windows), linux (Linux) and darwin (OSX).

Packaging all desktop releases

npm run build-all

Building a standalone desktop release

grunt dist
Running the desktop release on Windows
.\bin\electron.exe
Running the desktop release on macOS
open ./bin/Electron.app
Running the desktop release on Linux
./bin/electron

Credits

Authors


Francisco Knebel
Contributions by FranciscoKnebel

See also the full list of contributors who participated in this project.

Other credited work

Music, artwork and other accreditations can be found on the CREDITS.md file.

Music bitrate change using MP3 Quality Modifier 2.5.3.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

spaceinvader's People

Contributors

franciscoknebel avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

crowsveldt

spaceinvader's Issues

An in-range update of eslint is breaking the build 🚨

Version 4.18.0 of eslint was just published.

Branch Build failing 🚨
Dependency eslint
Current Version 4.17.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… continuous-integration/travis-ci/push The Travis CI build passed Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Commits

The new version differs by 14 commits.

  • 883a2a2 4.18.0
  • 89d55ca Build: changelog update for 4.18.0
  • 70f22f3 Chore: Apply memoization to config creation within glob utils (#9944)
  • 0e4ae22 Update: fix indent bug with binary operators/ignoredNodes (fixes #9882) (#9951)
  • 47ac478 Update: add named imports and exports for object-curly-newline (#9876)
  • e8efdd0 Fix: support Rest/Spread Properties (fixes #9885) (#9943)
  • f012b8c Fix: support Async iteration (fixes #9891) (#9957)
  • 74fa253 Docs: Clarify no-mixed-operators options (fixes #9962) (#9964)
  • 426868f Docs: clean up key-spacing docs (fixes #9900) (#9963)
  • 4a6f22e Update: support eslint-disable-* block comments (fixes #8781) (#9745)
  • 777283b Docs: Propose fix typo for function (#9965)
  • bf3d494 Docs: Fix typo in max-len ignorePattern example. (#9956)
  • d64fbb4 Docs: fix typo in prefer-destructuring.md example (#9930)
  • f8d343f Chore: Fix default issue template (#9946)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

End credits

Self-explanatory.
Needs to contain all contributions to the project.

Compress music files

The new bgm tracks are very heavy, causing more stress than needed to the network.

Add Touchscreen support

  • Could be implemented with a two-button system for movement, and shooting could be anywhere else on the canvas?

  • "Press Enter to Continue" states also need to be adapted for touchscreen.

  • Cordova support should also be implemented.

Options menu

// To do

EDIT: implemented options menu on commits below. MelonJS me.save for storing values on localStorage was bugged, so I used another solution.

Create multiple styles of player attack types

  • Multiple small lasers shoot at the same time
  • Lasers firing in three directions: \ | /
  • Laser bomb (explodes in all directions after a couple of seconds)

Health concept should also be added to enemies.

An in-range update of eslint-plugin-import is breaking the build 🚨

Version 2.6.1 of eslint-plugin-import just got published.

Branch Build failing 🚨
Dependency eslint-plugin-import
Current Version 2.6.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-plugin-import is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Commits

The new version differs by 4 commits.

  • d9b712a bump to v2.6.1 to bump dep on node resolver to latest 😳
  • 4d561e3 Merge pull request #881 from futpib/named-flow-import-interface
  • 56e60e4 Update no-extraneous-dependencies.md (#878)
  • 9a06426 Fix flow interface imports giving false-negative with named rule

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Start Menu

After the MelonJS loader, the game should present a start menu to the user. It should contain the following buttons:

  • Start New Game
  • How to Play
  • Options
  • Credits
  • Exit Game

A placeholder for Load Game could be placed too, if the feature is ever implemented.

An in-range update of electron-builder is breaking the build 🚨

Version 17.5.0 of electron-builder just got published.

Branch Build failing 🚨
Dependency electron-builder
Current Version 17.4.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As electron-builder is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details,- ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes 17.5.0

Features

  • local path to custom electron build (windows support) (521aea6), closes #1534 #1342
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Spacebar and Left Mouse shoot at the same time

Non-Intended, needs a lock variable, so you can only shoot with one at a time.
In later levels, maybe you could use both, so the levels become easier?

Further detailing

You can smash both buttons at the same time, creating a stream with double the amount of shoots it would fire if the default behavior was being used. Spacebar and Left mouse shooting should be considered alternative controls, not separate entities.

A lock between these buttons should be created, so you can't use both at the same time.
A future implementation could add this shooting behavior as an upgrade to the shooting mechanisms.

Boss Mode

In some predefined stages, the pattern of stages should change, for a boss mode challenge.
Maybe a list could contain all different bosses, with their patterns of movement and challenges, so stages change over time, and maybe could contain different style of enemies on the same map.

Create Highscores implementation

  • App running on Heroku, with an endpoint to receive new highscores.
  • When an user loses, ask for their name and send it, along with the score.
  • Create a state to see highscores data.

Fix Win32 deployment by AppVeyor

Code snippet from build log:

Packaging app for platform win32 ia32 using electron v1.4.16
Packaging app for platform win32 x64 using electron v1.4.16
Packager finished.
Application Paths: 
"apps\Space Invader-win32-ia32"
"apps\Space Invader-win32-x64"
Building installer for Platform: "win32" and Arch: "ia32". Please wait...
Building installer for Platform: "win32" and Arch: "x64". Please wait...
{ Error: Command failed: node deployment/installer "apps\Space Invader-win32-ia32" --platform win32 --arch ia32
Error: Error creating package: Error executing file (1): 
C:\projects\spaceinvader\node_modules\electron-installer-windows\vendor\nuget\NuGet.exe pack C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-2964-is4393.u9v534bo6r\spaceinvader_0.0.6\nuget\spaceinvader.nuspec -BasePath C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-2964-is4393.u9v534bo6r\spaceinvader_0.0.6\spaceinvader -OutputDirectory C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-2964-is4393.u9v534bo6r\spaceinvader_0.0.6\nuget -NoDefaultExcludes
File not found: 'spaceinvader.exe'.
    at C:\projects\spaceinvader\node_modules\electron-installer-windows\src\installer.js:273:21
    at ChildProcess.<anonymous> (C:\projects\spaceinvader\node_modules\electron-installer-windows\src\installer.js:62:5)
    at emitTwo (events.js:111:20)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 'Error: Error creating package: Error executing file (1): \nC:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\vendor\\nuget\\NuGet.exe pack C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-2964-is4393.u9v534bo6r\\spaceinvader_0.0.6\\nuget\\spaceinvader.nuspec -BasePath C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-2964-is4393.u9v534bo6r\\spaceinvader_0.0.6\\spaceinvader -OutputDirectory C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-2964-is4393.u9v534bo6r\\spaceinvader_0.0.6\\nuget -NoDefaultExcludes\nFile not found: \'spaceinvader.exe\'.\r\n\n    at C:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\src\\installer.js:273:21\n    at ChildProcess.<anonymous> (C:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\src\\installer.js:62:5)\n    at emitTwo (events.js:111:20)\n    at ChildProcess.emit (events.js:191:7)\n    at maybeClose (internal/child_process.js:886:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)'
    at ChildProcess.exithandler (child_process.js:204:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:501:12)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'node deployment/installer "apps\\Space Invader-win32-ia32" --platform win32 --arch ia32' }
Error: Error creating package: Error executing file (1): 
C:\projects\spaceinvader\node_modules\electron-installer-windows\vendor\nuget\NuGet.exe pack C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-2964-is4393.u9v534bo6r\spaceinvader_0.0.6\nuget\spaceinvader.nuspec -BasePath C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-2964-is4393.u9v534bo6r\spaceinvader_0.0.6\spaceinvader -OutputDirectory C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-2964-is4393.u9v534bo6r\spaceinvader_0.0.6\nuget -NoDefaultExcludes
File not found: 'spaceinvader.exe'.
    at C:\projects\spaceinvader\node_modules\electron-installer-windows\src\installer.js:273:21
    at ChildProcess.<anonymous> (C:\projects\spaceinvader\node_modules\electron-installer-windows\src\installer.js:62:5)
    at emitTwo (events.js:111:20)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 'Error: Error creating package: Error executing file (1): \nC:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\vendor\\nuget\\NuGet.exe pack C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-2964-is4393.u9v534bo6r\\spaceinvader_0.0.6\\nuget\\spaceinvader.nuspec -BasePath C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-2964-is4393.u9v534bo6r\\spaceinvader_0.0.6\\spaceinvader -OutputDirectory C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-2964-is4393.u9v534bo6r\\spaceinvader_0.0.6\\nuget -NoDefaultExcludes\nFile not found: \'spaceinvader.exe\'.\r\n\n    at C:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\src\\installer.js:273:21\n    at ChildProcess.<anonymous> (C:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\src\\installer.js:62:5)\n    at emitTwo (events.js:111:20)\n    at ChildProcess.emit (events.js:191:7)\n    at maybeClose (internal/child_process.js:886:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)'
{ Error: Command failed: node deployment/installer "apps\Space Invader-win32-x64" --platform win32 --arch x64
Error: Error creating package: Error executing file (1): 
C:\projects\spaceinvader\node_modules\electron-installer-windows\vendor\nuget\NuGet.exe pack C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-1360-ektddd.nzg2xa8aor\spaceinvader_0.0.6\nuget\spaceinvader.nuspec -BasePath C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-1360-ektddd.nzg2xa8aor\spaceinvader_0.0.6\spaceinvader -OutputDirectory C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-1360-ektddd.nzg2xa8aor\spaceinvader_0.0.6\nuget -NoDefaultExcludes
File not found: 'spaceinvader.exe'.
    at C:\projects\spaceinvader\node_modules\electron-installer-windows\src\installer.js:273:21
    at ChildProcess.<anonymous> (C:\projects\spaceinvader\node_modules\electron-installer-windows\src\installer.js:62:5)
    at emitTwo (events.js:111:20)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 'Error: Error creating package: Error executing file (1): \nC:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\vendor\\nuget\\NuGet.exe pack C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-1360-ektddd.nzg2xa8aor\\spaceinvader_0.0.6\\nuget\\spaceinvader.nuspec -BasePath C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-1360-ektddd.nzg2xa8aor\\spaceinvader_0.0.6\\spaceinvader -OutputDirectory C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-1360-ektddd.nzg2xa8aor\\spaceinvader_0.0.6\\nuget -NoDefaultExcludes\nFile not found: \'spaceinvader.exe\'.\r\n\n    at C:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\src\\installer.js:273:21\n    at ChildProcess.<anonymous> (C:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\src\\installer.js:62:5)\n    at emitTwo (events.js:111:20)\n    at ChildProcess.emit (events.js:191:7)\n    at maybeClose (internal/child_process.js:886:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)'
    at ChildProcess.exithandler (child_process.js:204:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'node deployment/installer "apps\\Space Invader-win32-x64" --platform win32 --arch x64' }
Error: Error creating package: Error executing file (1): 
C:\projects\spaceinvader\node_modules\electron-installer-windows\vendor\nuget\NuGet.exe pack C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-1360-ektddd.nzg2xa8aor\spaceinvader_0.0.6\nuget\spaceinvader.nuspec -BasePath C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-1360-ektddd.nzg2xa8aor\spaceinvader_0.0.6\spaceinvader -OutputDirectory C:\Users\appveyor\AppData\Local\Temp\1\electron-11744-1360-ektddd.nzg2xa8aor\spaceinvader_0.0.6\nuget -NoDefaultExcludes
File not found: 'spaceinvader.exe'.
    at C:\projects\spaceinvader\node_modules\electron-installer-windows\src\installer.js:273:21
    at ChildProcess.<anonymous> (C:\projects\spaceinvader\node_modules\electron-installer-windows\src\installer.js:62:5)
    at emitTwo (events.js:111:20)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 'Error: Error creating package: Error executing file (1): \nC:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\vendor\\nuget\\NuGet.exe pack C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-1360-ektddd.nzg2xa8aor\\spaceinvader_0.0.6\\nuget\\spaceinvader.nuspec -BasePath C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-1360-ektddd.nzg2xa8aor\\spaceinvader_0.0.6\\spaceinvader -OutputDirectory C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\electron-11744-1360-ektddd.nzg2xa8aor\\spaceinvader_0.0.6\\nuget -NoDefaultExcludes\nFile not found: \'spaceinvader.exe\'.\r\n\n    at C:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\src\\installer.js:273:21\n    at ChildProcess.<anonymous> (C:\\projects\\spaceinvader\\node_modules\\electron-installer-windows\\src\\installer.js:62:5)\n    at emitTwo (events.js:111:20)\n    at ChildProcess.emit (events.js:191:7)\n    at maybeClose (internal/child_process.js:886:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)'
Compressing "Space Invader-win32-ia32."
node deployment/compress "apps/Space Invader-win32-ia32" "apps/installers/Space Invader-win32-ia32" --zip
Compressing "Space Invader-win32-x64."
node deployment/compress "apps/Space Invader-win32-x64" "apps/installers/Space Invader-win32-x64" --zip
{ Error: Command failed: node deployment/compress "apps/Space Invader-win32-ia32" "apps/installers/Space Invader-win32-ia32" --zip
events.js:160
      throw er; // Unhandled 'error' event
      ^
Error: ENOENT: no such file or directory, open 'C:\projects\spaceinvader\apps\installers\Space Invader-win32-ia32.zip'
    at Error (native)
    at ChildProcess.exithandler (child_process.js:204:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'node deployment/compress "apps/Space Invader-win32-ia32" "apps/installers/Space Invader-win32-ia32" --zip' }
events.js:160
      throw er; // Unhandled 'error' event
      ^
Error: ENOENT: no such file or directory, open 'C:\projects\spaceinvader\apps\installers\Space Invader-win32-ia32.zip'
    at Error (native)
{ Error: Command failed: node deployment/compress "apps/Space Invader-win32-x64" "apps/installers/Space Invader-win32-x64" --zip
events.js:160
      throw er; // Unhandled 'error' event
      ^
Error: ENOENT: no such file or directory, open 'C:\projects\spaceinvader\apps\installers\Space Invader-win32-x64.zip'
    at Error (native)
    at ChildProcess.exithandler (child_process.js:204:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:501:12)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'node deployment/compress "apps/Space Invader-win32-x64" "apps/installers/Space Invader-win32-x64" --zip' }
events.js:160
      throw er; // Unhandled 'error' event
      ^
Error: ENOENT: no such file or directory, open 'C:\projects\spaceinvader\apps\installers\Space Invader-win32-x64.zip'
    at Error (native)

Art style for enemies

A new set of graphics should be created for new monsters and ships, with more details and variations.

Create Multiple style of levels

There are already color definitions for backgrounds, but sets of levels should be themed, related to #9.
Different amounts of monsters, with different speeds, and with independent movement between groups could also be implemented.

Help menu resets the level

Changing to the Help menu, pressing the H key, resets the current level, which could save you from a losing situation. Your score when reseting also keeps the score earned from the level you were, which is unintentional.

Add different screen resolutions

Monster spawn is based on screen width, so it may need some downscaling on velocity gain, based on screen width.

Width and height could be defined by cookies, or separate from the game variable, and once updated the instance is created again.

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.