Code Monkey home page Code Monkey logo

moon-invaders's Introduction

Moon Invaders

A Space Invaders emulator powered by LÖVE and lua-8080.

Moon Invaders

Features

  • Persistent high scores that are saved between runs!
  • Authentic-looking CRT shaders, customizable colored gel overlay and background
  • Gamepad controller support
  • Sound support (for user-provided sound files)

Controls

You can use the keyboard or gamepad controllers (up to two, for two players).

Key Button Action
Arrow keys D-pad / Joystick Move (both players)
Space A / B / X / Y Fire (both players)
C Back Insert coin
1 Start Start 1 player mode
2 Start Start 2 player mode
T Tilt

How to run

Windows / macOS

Download the latest release from the Releases page.

Linux

First install LÖVE 11.4. Your Linux distribution might have it in its package repository, but there are no guarantees that this emulator works with older versions of LÖVE.

For Ubuntu, there's a third-party repository you can use to install LÖVE 11.4:

sudo add-apt-repository ppa:bartbes/love-stable
sudo apt install love

Then clone or download this repository, including submodules with --recursive, and run LÖVE:

git clone --recursive https://github.com/tobiasvl/moon-invaders.git
love moon-invaders/

Note that to get the menu bar at the top of the window you will need to install love-imgui, but you will need to build it yourself since the Lua rock requires an older version of LÖVE.

Setup

You will then need to supply the emulator with ROM files, and some additional optional assets, in order to play.

For all the following files, put them in the following locations:

  • Windows, one of the following:
    • The assets directory inside the game's folder (containing the .exe file)
    • C:\Users\<your username>\AppData\Roaming\Moon Invaders\assets\
  • Linux, one of the following:
    • $XDG_DATA_HOME/love/Moon\ Invaders/assets/
    • ~/.local/share/love/Moon\ Invaders/assets/
  • macOS: /Users/<your username>/Library/Application Support/LOVE/Moon Invaders/assets/

ROM

You will need to supply your own Space Invaders ROM files. There are four files:

  • invaders.e
  • invaders.f
  • invaders.g
  • invaders.h

Images

These are optional:

  • background.png: Background image
  • overlay.png: Colored gel overlay, see the default one for the format

Sounds

This emulator doesn't emulate the sound chip (yet?), so to get sound, you'll need to download a sound pack online.

The sound files found online have different file names, so two variations per file are supported. These are optional.

  • 0.wav / ufo_highpitch.wav (UFO flying)
  • 1.wav / shoot.wav (player firing)
  • 2.wav / explosion.wav (player death)
  • 3.wav / invaderkilled.wav (alien death)
  • 4.wav / fastinvader1.wav (alien fleet movement "heartbeat")
  • 5.wav / fastinvader2.wav
  • 6.wav / fastinvader3.wav
  • 7.wav / fastinvader4.wav
  • 8.wav / ufo_lowpitch.wav (UFO death)
  • 9.wav / extendedplay.wav (extra life)

Note that at least one website that provides these files for download have swapped the names of shoot.wav and invaderkilled.wav.

moon-invaders's People

Contributors

tobiasvl 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

Watchers

 avatar  avatar  avatar

moon-invaders's Issues

Make "no ROM" screen better

On macOS, running the app in "Protected mode" suggests putting the ROMs in a weird sandbox directory.

Also the screen should just be prettier in general.

Controller support

In addition to fullscreen, xinput controller support is the only thing keeping me from replacing mame with this.

Make Linux instructions more clear

I'm not a LOVE user, nor a Lua user (nor even a git expert), but I really wanted to check this out. So it was with more than a bit of pain that it took me to get this running. Could you update the instructions from:

If you're on Linux, clone or download this repository (remember the submodules!).

Could it be changed to something like this?

If you're on Linux, clone or download this repository (including submodules with --recursive!):

git clone --recursive https://github.com/tobiasvl/moon-invaders.git
# use next line only if running Ubuntu/Kubuntu/Lubuntu/Mint/etc 18.04 or lower
sudo add-apt-repository ppa:bartbes/love-stable
sudo apt install love
# then run it
love moon-invaders

I actually had such a hard time figuring out how to actually run the game! I tried love main.lua but it would give me cryptic errors. I was about to give up. Even tutorials online assume you'll be running Windows so they don't really say how to do it from Linux.

Improve resizing the window

Support drawing the game in different resolutions and make the window resizable.

Also, support "desktop" fullscreen mode (see #11).

Lua typo error

Running under Kubuntu 18.04 with the latest LOVE PPA installed, when I ran the game, I was greeted with this and I didn't understand why:

Error: main.lua:123: attempt to call field 'newSourcer' (a nil value)
stack traceback:
        [string "boot.lua"]:777: in function 'newSourcer'
        main.lua:123: in function 'load'
        [string "boot.lua"]:586: in function <[string "boot.lua"]:585>
        [C]: in function 'xpcall'
        [string "boot.lua"]:793: in function <[string "boot.lua"]:780>
        [C]: in function 'xpcall'

I finally realized that there's a typo on line 123 of main.lua. It should be love.audio.newSource not love.audio.newSourcer. When I changed that, it ran.

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.