aboutsummaryrefslogtreecommitdiff
path: root/games/open-invaders
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2023-01-22 10:14:57 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2023-01-28 08:22:57 +0700
commit89c4e960be0d6783bf9cddba504776d9f2747b79 (patch)
treea5faa782efea7805671d9ad711478391528e8106 /games/open-invaders
parenta095f6cbbede9ba0c04026b2d5aca4dfd49bead7 (diff)
games/open-invaders: Added (game similar to space invaders)
Signed-off-by: bedlam <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/open-invaders')
-rw-r--r--games/open-invaders/48.pngbin0 -> 15522 bytes
-rw-r--r--games/open-invaders/64.pngbin0 -> 3780 bytes
-rw-r--r--games/open-invaders/README5
-rw-r--r--games/open-invaders/check_env_home.diff15
-rw-r--r--games/open-invaders/doinst.sh9
-rw-r--r--games/open-invaders/open-invaders.6113
-rw-r--r--games/open-invaders/open-invaders.SlackBuild172
-rw-r--r--games/open-invaders/open-invaders.info12
-rw-r--r--games/open-invaders/open-invaders.rst96
-rw-r--r--games/open-invaders/skippable_intro.diff63
-rw-r--r--games/open-invaders/slack-desc19
11 files changed, 504 insertions, 0 deletions
diff --git a/games/open-invaders/48.png b/games/open-invaders/48.png
new file mode 100644
index 000000000000..38cd87f9a2b0
--- /dev/null
+++ b/games/open-invaders/48.png
Binary files differ
diff --git a/games/open-invaders/64.png b/games/open-invaders/64.png
new file mode 100644
index 000000000000..c751eb15e8bd
--- /dev/null
+++ b/games/open-invaders/64.png
Binary files differ
diff --git a/games/open-invaders/README b/games/open-invaders/README
new file mode 100644
index 000000000000..3dea5b37d458
--- /dev/null
+++ b/games/open-invaders/README
@@ -0,0 +1,5 @@
+open-invaders (game similar to space invaders)
+
+open-invaders is a Space Invaders clone with updated graphics and
+sound. It can be played with either the keyboard or a game controller,
+and features 'unlockable' content.
diff --git a/games/open-invaders/check_env_home.diff b/games/open-invaders/check_env_home.diff
new file mode 100644
index 000000000000..37644132f879
--- /dev/null
+++ b/games/open-invaders/check_env_home.diff
@@ -0,0 +1,15 @@
+diff -Naur open-invaders-0.3/src/main.cc open-invaders-0.3.patched/src/main.cc
+--- open-invaders-0.3/src/main.cc 2007-11-11 05:04:57.000000000 -0500
++++ open-invaders-0.3.patched/src/main.cc 2023-01-22 03:00:59.915438072 -0500
+@@ -48,6 +48,11 @@
+
+ int main(int argc, char *argv[])
+ {
++ if(!getenv("HOME")) {
++ fprintf(stderr, "%s: HOME not set in environment, bailing.\n", argv[0]);
++ exit(1);
++ }
++
+ cout << PACKAGE_DATA_DIR << endl;
+
+ // Parse parameters, perhaps include -windowed and -fullscreen?
diff --git a/games/open-invaders/doinst.sh b/games/open-invaders/doinst.sh
new file mode 100644
index 000000000000..3e5691a052b5
--- /dev/null
+++ b/games/open-invaders/doinst.sh
@@ -0,0 +1,9 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/games/open-invaders/open-invaders.6 b/games/open-invaders/open-invaders.6
new file mode 100644
index 000000000000..759ea8d238e2
--- /dev/null
+++ b/games/open-invaders/open-invaders.6
@@ -0,0 +1,113 @@
+.\" Man page generated from reStructuredText.
+.
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.TH "OPEN-INVADERS" 6 "2023-01-22" "0.3_8" "SlackBuilds.org"
+.SH NAME
+open-invaders \- game similar to Space Invaders
+.\" RST source for open-invaders(1) man page. Convert with:
+.
+.\" rst2man.py open-invaders.rst > open-invaders.6
+.
+.SH SYNOPSIS
+.sp
+open\-invaders [\fB\-f\fP | \fB\-w\fP]
+.SH DESCRIPTION
+.sp
+\fBopen\-invaders\fP is a Space Invaders clone with updated graphics and
+sound. It can be played with either the keyboard or a game controller,
+and features \(aqunlockable\(aq content.
+.sp
+For more information about gameplay, see:
+.INDENT 0.0
+.INDENT 3.5
+/usr/doc/open\-invaders\-0.3_8/README
+.UNINDENT
+.UNINDENT
+.SH OPTIONS
+.INDENT 0.0
+.TP
+.B \-f
+Start in fullscreen mode (overrides config file).
+.TP
+.B \-w
+Start in windowed mode (overrides config file).
+.UNINDENT
+.SH KEYBOARD
+.sp
+These keystrokes can be changed from the Options menu within the game. The
+defaults are:
+.INDENT 0.0
+.TP
+.B \fBArrow Keys\fP
+Move left/right/up/down.
+.TP
+.B \fBLeft Shift\fP
+Fire.
+.TP
+.B \fBP\fP
+Pause game.
+.TP
+.B \fBQ\fP
+Quit game, return to main menu.
+.UNINDENT
+.sp
+These keystrokes cannot be changed:
+.INDENT 0.0
+.TP
+.B \fBControl\-F\fP, \fBAlt\-Enter\fP
+Toggle fullscreen mode.
+.TP
+.B \fBControl\-S\fP
+Save screenshot. Screenshots are in \fB\&.bmp\fP format, and will be saved
+to \fB~/oi_screen_NNNN.bmp\fP, where \fINNNN\fP is a random 4\-digit number.
+.TP
+.B \fBControl\-C\fP
+Exit the application.
+.UNINDENT
+.SH FILES
+.INDENT 0.0
+.TP
+.B ~/.openinvaders/config
+Config file. Can be edited with a text editor, or via the Options menu
+in the game.
+.TP
+.B ~/.openinvaders/hiscore
+High scores. Not human\-readable.
+.UNINDENT
+.SH COPYRIGHT
+.sp
+See the file /usr/doc/open\-invaders\-0.3_8/COPYING for license information.
+.SH AUTHORS
+.sp
+\fBopen\-invaders\fP was written by Darryl LeCount.
+.sp
+This man page written for the SlackBuilds.org project
+by B. Watson, and is licensed under the WTFPL.
+.\" Generated by docutils manpage writer.
+.
diff --git a/games/open-invaders/open-invaders.SlackBuild b/games/open-invaders/open-invaders.SlackBuild
new file mode 100644
index 000000000000..5e7b3621d89a
--- /dev/null
+++ b/games/open-invaders/open-invaders.SlackBuild
@@ -0,0 +1,172 @@
+#!/bin/bash
+
+# Slackware build script for open-invaders
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# This isn't really that great a game. The developer spent a lot
+# of time on bling-ey graphics and sound, but it's missing some of
+# the basic gameplay elements that made Space Invaders a classic:
+# the enemies don't speed up during the level as you kill them,
+# and there are no UFOs (at least, not on the first 7 levels; maybe
+# later?). To be fair, the README says it's "still in development"
+# and not finished (maybe the author planned to add that stuff later,
+# but development stopped in 2007 or so).
+
+# I patched the game a bit to make it less annoying to play (made the
+# intro screens skippable).
+
+# The part of VERSION after the _ is the Debian patchlevel. They've
+# done a good bit of patching and bugfixing to keep this usable on a
+# modern system.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=open-invaders
+VERSION=${VERSION:-0.3_8}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+SRCVER="$( echo $VERSION | cut -d_ -f1 )"
+DEBVER="$( echo $VERSION | cut -d_ -f2 )"
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$SRCVER
+tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz
+cd $PRGNAM-$SRCVER
+tar xvf $CWD/${PRGNAM}_$SRCVER-$DEBVER.debian.tar.xz
+chown -R root:root .
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+# Make the intro skippable by keypress or joystick button. The damn
+# thing is like 10 seconds long. Also speed up the fadeout when
+# you exit the game via the menu, so it ends when the "goodbye"
+# sample is done playing.
+patch -p1 < $CWD/skippable_intro.diff
+
+# Exit with a meaningful error message, if HOME isn't set in the
+# environment (instead of crashing with a C++ exception).
+patch -p1 < $CWD/check_env_home.diff
+
+# Apply all of debian's patches. Some fix build failures, some
+# fix bugs in the game.
+for i in $( cat debian/patches/series ); do
+ patch -p1 < debian/patches/$i
+done
+
+# From debian/rules:
+sed -i 's/ALLEGRO_LINUX/ALLEGRO_UNIX/g' src/*.cc headers/*.h
+sed -i -e 's/laldmd/laldmb/g' -e 's/ldumbd/ldumb/g' src/Makefile.*
+
+# Fix for dumb-2.x API:
+sed -i '/dumb_load_mod_quick/s|)|,0)|' src/{intro,init,ending}.cc
+
+DOCDIR=/usr/doc/$PRGNAM-$VERSION
+PKGDOC=$PKG/$DOCDIR
+
+# The -Dnullptr=0 is a bit of a dirty hack. We use debian's
+# gcc6.patch, which fixes "return false" in a function returning
+# a pointer... but replaces 'false' with 'nullptr'. In our gcc 11,
+# we need std=gnu++98 to get it to build, which means nullptr isn't
+# defined. So define it. Not sure why C++11 needs yet another keyword
+# that's just an alias for 0 (it already had NULL). This kind of
+# stuff is why I never code in C++: it's a moving target, it has been
+# since day 1, and the C++ standards gurus make sure it keeps moving
+# perpetually.
+
+# Need this for dumb.h on 32-bit, it does no harm on 64-bit. See
+# /usr/include/dumb.h, lines 124-142.
+SLKCFLAGS+=" -D_FILE_OFFSET_BITS=64"
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS -std=gnu++98 -Dnullptr=0" \
+./configure \
+ --bindir=/usr/games \
+ --datadir=/usr/share/games \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --build=$ARCH-slackware-linux
+
+make open_invadersdatadir=$PKG/usr/share/games/$PRGNAM
+make install-strip \
+ open_invadersdatadir=/usr/share/games/$PRGNAM \
+ open_invadersdocdir=$DOCDIR \
+ DESTDIR=$PKG
+
+# Debian ships a man page, but I like mine better.
+mkdir -p $PKG/usr/man/man6
+gzip -9c < $CWD/$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
+
+# Icons made from ship.pcx (debian's icon is fugly, sorry).
+for px in 48 64; do
+ size=${px}x${px}
+ dir=$PKG/usr/share/icons/hicolor/$size/apps
+ mkdir -p $dir
+ cat $CWD/$px.png > $dir/$PRGNAM.png
+done
+
+mkdir -p $PKG/usr/share/pixmaps
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
+
+# Use debian's .desktop, but with full path to binary, and get
+# rid of the -w argument (so the user can set fullscreen mode in
+# the config, and it'll actually work).
+mkdir -p $PKG/usr/share/applications
+sed '/^Exec/s,=.*,=/usr/games/open-invaders,' debian/$PRGNAM.desktop > \
+ $PKG/usr/share/applications/$PRGNAM.desktop
+
+# Docs already installed, get rid of useless ones and fix CRLFs.
+# ChangeLog is 0 bytes, INSTALL is generic autotools cruft.
+rm -f $PKGDOC/{ChangeLog,INSTALL}
+sed -i 's,\r,,' $PKGDOC/*
+
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/games/open-invaders/open-invaders.info b/games/open-invaders/open-invaders.info
new file mode 100644
index 000000000000..1e3818e7bdd5
--- /dev/null
+++ b/games/open-invaders/open-invaders.info
@@ -0,0 +1,12 @@
+PRGNAM="open-invaders"
+VERSION="0.3_8"
+HOMEPAGE="https://sourceforge.net/projects/open-invaders/"
+DOWNLOAD="https://downloads.sourceforge.net/project/open-invaders/open-invaders-0.3/open-invaders-0.3.tar.gz \
+ https://deb.debian.org/debian/pool/main/o/open-invaders/open-invaders_0.3-8.debian.tar.xz"
+MD5SUM="35c0d8ec3beacfc97389d38eef3555b2 \
+ 721e802c86637979405aca7b908bfe0c"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="dumb"
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"
diff --git a/games/open-invaders/open-invaders.rst b/games/open-invaders/open-invaders.rst
new file mode 100644
index 000000000000..c4060039a876
--- /dev/null
+++ b/games/open-invaders/open-invaders.rst
@@ -0,0 +1,96 @@
+.. RST source for open-invaders(1) man page. Convert with:
+.. rst2man.py open-invaders.rst > open-invaders.6
+
+.. |version| replace:: 0.3_8
+.. |date| date::
+
+=============
+open-invaders
+=============
+
+------------------------------
+game similar to Space Invaders
+------------------------------
+
+:Manual section: 6
+:Manual group: SlackBuilds.org
+:Date: |date|
+:Version: |version|
+
+SYNOPSIS
+========
+
+open-invaders [**-f** | **-w**]
+
+DESCRIPTION
+===========
+
+**open-invaders** is a Space Invaders clone with updated graphics and
+sound. It can be played with either the keyboard or a game controller,
+and features 'unlockable' content.
+
+For more information about gameplay, see:
+
+ /usr/doc/open-invaders-|version|/README
+
+OPTIONS
+=======
+
+-f
+ Start in fullscreen mode (overrides config file).
+
+-w
+ Start in windowed mode (overrides config file).
+
+KEYBOARD
+========
+
+These keystrokes can be changed from the Options menu within the game. The
+defaults are:
+
+**Arrow Keys**
+ Move left/right/up/down.
+
+**Left Shift**
+ Fire.
+
+**P**
+ Pause game.
+
+**Q**
+ Quit game, return to main menu.
+
+These keystrokes cannot be changed:
+
+**Control-F**, **Alt-Enter**
+ Toggle fullscreen mode.
+
+**Control-S**
+ Save screenshot. Screenshots are in **.bmp** format, and will be saved
+ to **~/oi_screen_NNNN.bmp**, where *NNNN* is a random 4-digit number.
+
+**Control-C**
+ Exit the application.
+
+FILES
+=====
+
+~/.openinvaders/config
+ Config file. Can be edited with a text editor, or via the Options menu
+ in the game.
+
+~/.openinvaders/hiscore
+ High scores. Not human-readable.
+
+COPYRIGHT
+=========
+
+See the file /usr/doc/open-invaders-|version|/COPYING for license information.
+
+AUTHORS
+=======
+
+**open-invaders** was written by Darryl LeCount.
+
+This man page written for the SlackBuilds.org project
+by B. Watson, and is licensed under the WTFPL.
diff --git a/games/open-invaders/skippable_intro.diff b/games/open-invaders/skippable_intro.diff
new file mode 100644
index 000000000000..5e21b12dfb23
--- /dev/null
+++ b/games/open-invaders/skippable_intro.diff
@@ -0,0 +1,63 @@
+diff -Naur open-invaders-0.3/src/intro.cc open-invaders-0.3.patched/src/intro.cc
+--- open-invaders-0.3/src/intro.cc 2007-11-11 04:30:53.000000000 -0500
++++ open-invaders-0.3.patched/src/intro.cc 2022-01-12 00:13:31.351070181 -0500
+@@ -99,6 +99,14 @@
+ "SCRLOCK", "NUMLOCK", "CAPSLOCK", "MAX"
+ };
+
++bool interruptible_rest(int ms) {
++ int i, count = ms / 20;
++ for(i = 0; i < count; i++) {
++ if(input_pressed()) return true;
++ rest(20);
++ }
++ return false;
++}
+
+ void intro_sequence()
+ {
+@@ -137,24 +145,24 @@
+
+ clear_to_color(screen,0);
+ set_palette(black_palette);
+- rest(2000);
+
+- alt_fade_in(jamyskis,5);
+-
+ blit(jamyskis,screen,0,0,0,0,800,600);
+
+- rest(2000);
+- alt_fade_between(jamyskis,allegro,5);
++ if(!interruptible_rest(2000)) {
++ alt_fade_between(jamyskis,allegro,5);
+
+- blit(allegro,screen,0,0,0,0,800,600);
++ blit(allegro,screen,0,0,0,0,800,600);
+
+- rest(2000);
+- alt_fade_between(allegro,linuxlogo,5);
++ if(!interruptible_rest(2000)) {
++ alt_fade_between(allegro,linuxlogo,5);
+
+- blit(linuxlogo,screen,0,0,0,0,800,600);
++ blit(linuxlogo,screen,0,0,0,0,800,600);
+
+- rest(2000);
+- alt_fade_out(linuxlogo,5);
++ if(!interruptible_rest(2000)) {
++ alt_fade_out(linuxlogo,5);
++ }
++ }
++ }
+
+ destroy_bitmap(jamyskis);
+ destroy_bitmap(allegro);
+@@ -494,7 +502,7 @@
+ program_active=false;
+ al_pause_duh(titlesongplayer);
+ play_sample(goodbye_sound,sfx_volume,128,1000,0);
+- alt_fade_out(screen,1);
++ alt_fade_out(screen,3);
+ title_screen_active=false;
+ break;
+ }
diff --git a/games/open-invaders/slack-desc b/games/open-invaders/slack-desc
new file mode 100644
index 000000000000..6e456fdd0031
--- /dev/null
+++ b/games/open-invaders/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+open-invaders: open-invaders (game similar to space invaders)
+open-invaders:
+open-invaders: open-invaders is a Space Invaders clone with updated graphics and
+open-invaders: sound. It can be played with either the keyboard or a game controller,
+open-invaders: and features 'unlockable' content.
+open-invaders:
+open-invaders:
+open-invaders:
+open-invaders:
+open-invaders:
+open-invaders: