fant0men

Game starter script

Mar 21st, 2020
173
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # This script will create a simple menu to run games listed in the
  3. # 'games' array. You need these packages installed to run the games:
  4.  
  5. # * wolf4sdl-registered-id (wolfenstein 3d source port)
  6. # * wolf4sdl-spear (spear of destiny source port)
  7. # * rott-registered (rise of the triad source port)
  8. # * prboom-plus (doom source port)
  9. # * darkplaces (quake engine)
  10. # * quake2 (yamagi engine)
  11. # * quake3 (ioquake3 engine)
  12.  
  13. games=("Wolfenstein 3D" "Spear of Destiny" "Rise of the Triad" "DOOM 1" "DOOM 2" "DOOM: TNT - Evilution" "DOOM: The Plutonia Experiment" "Doom 64 EX" "Quake" "Quake: Scourge of Armagon" "Quake: Dissolution of Eternity" "Quake 2" "Quake 3" "Quit")
  14.  
  15. doom_dir="${HOME}/id_games/doom_wads"
  16.  
  17. while true; do
  18.  
  19.     clear
  20.  
  21.     n='0'
  22.  
  23.     echo -e "\n*** CHOOSE GAME ***\n"
  24.  
  25.     for (( i = 0; i < ${#games[@]}; i++ )); do
  26.  
  27.         n=$(( n + 1 ))
  28.  
  29.         echo "${n}) ${games[${i}]}"
  30.  
  31.     done
  32.  
  33.     printf '>'
  34.     read game
  35.  
  36.     case "$game" in
  37.         1)
  38.             wolf4sdl-registered-id --res 1600 1000 || exit
  39.         ;;
  40.         2)
  41.             wolf4sdl-spear --res 1600 1000 --goodtimes || exit
  42.         ;;
  43.         3)
  44.             rott-registered fullscreen resolution 800x600 || exit
  45.         ;;
  46.         4)
  47.             prboom-plus -iwad "${doom_dir}/doom.wad" || exit
  48.         ;;
  49.         5)
  50.             prboom-plus -iwad "${doom_dir}/doom2.wad" || exit
  51.         ;;
  52.         6)
  53.             prboom-plus -iwad "${doom_dir}/tnt.wad" || exit
  54.         ;;
  55.         7)
  56.             prboom-plus -iwad "${doom_dir}/plutonia.wad" || exit
  57.         ;;
  58.         8)
  59.             doom64ex || exit
  60.         ;;
  61.         9)
  62.             darkplaces-glx || exit
  63.         ;;
  64.         10)
  65.             darkplaces-glx -hipnotic || exit
  66.         ;;
  67.         11)
  68.             darkplaces-glx -rogue || exit
  69.         ;;
  70.         12)
  71.             quake2 || exit
  72.         ;;
  73.         13)
  74.             quake3 || exit
  75.         ;;
  76.         14)
  77.             exit
  78.         ;;
  79.     esac
  80. done
RAW Paste Data