2015-05-16 17:28:19 +00:00
|
|
|
;;; packages.el --- games Layer packages File for Spacemacs
|
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2015-05-16 17:28:19 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2015-05-16 17:28:19 +00:00
|
|
|
|
2016-01-18 03:06:04 +00:00
|
|
|
(setq games-packages
|
|
|
|
'(
|
|
|
|
2048-game
|
2016-05-30 02:39:21 +00:00
|
|
|
(helm-games :location local
|
2017-07-03 07:52:54 +00:00
|
|
|
:requires helm)
|
2016-01-18 03:06:04 +00:00
|
|
|
pacmacs
|
|
|
|
(tetris :location built-in)
|
2016-11-14 01:37:12 +00:00
|
|
|
sudoku
|
2016-04-06 02:28:16 +00:00
|
|
|
typit
|
2016-01-18 03:06:04 +00:00
|
|
|
))
|
2015-05-16 17:28:19 +00:00
|
|
|
|
|
|
|
(defun games/init-2048-game ()
|
|
|
|
(use-package 2048-mode
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-05-16 17:28:19 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2015-05-17 03:57:28 +00:00
|
|
|
(push '("2048" . (2048-game :quit (kill-buffer-ask (get-buffer "2048"))
|
|
|
|
:reset 2048-init)) helm-games-list)
|
2015-11-21 10:07:14 +00:00
|
|
|
(evilified-state-evilify 2048-mode 2048-mode-map
|
|
|
|
"j" '2048-down
|
|
|
|
"k" '2048-up
|
|
|
|
"h" '2048-left
|
|
|
|
"l" '2048-right))))
|
2015-10-13 17:54:12 +00:00
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
(defun games/init-helm-games ()
|
|
|
|
(use-package helm-games
|
|
|
|
:commands helm-games
|
|
|
|
:init
|
|
|
|
(progn
|
2020-06-28 21:25:04 +00:00
|
|
|
(spacemacs/declare-prefix "afg" "games")
|
|
|
|
(spacemacs/set-leader-keys "afg" 'helm-games))))
|
2016-01-18 03:06:04 +00:00
|
|
|
|
2015-10-13 17:54:12 +00:00
|
|
|
(defun games/init-pacmacs ()
|
|
|
|
(use-package pacmacs
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-10-13 17:54:12 +00:00
|
|
|
:init
|
2016-04-06 02:28:16 +00:00
|
|
|
(push '("pacmacs" . (pacmacs-start
|
|
|
|
:quit (kill-buffer-ask (get-buffer "*Pacmacs*"))
|
|
|
|
:reset pacmacs-start)) helm-games-list)
|
2015-11-21 10:07:14 +00:00
|
|
|
(evilified-state-evilify pacmacs-mode pacmacs-mode-map
|
|
|
|
"h" 'pacmacs-left
|
|
|
|
"j" 'pacmacs-down
|
|
|
|
"k" 'pacmacs-up
|
|
|
|
"l" 'pacmacs-right)))
|
2016-01-18 03:06:04 +00:00
|
|
|
|
|
|
|
(defun games/init-tetris ()
|
|
|
|
(use-package tetris
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-01-18 03:06:04 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(push '("Tetris" . (tetris :quit spacemacs/tetris-quit-game
|
|
|
|
:reset tetris-start-game)) helm-games-list)
|
|
|
|
(setq tetris-score-file (concat spacemacs-games-cache-directory
|
2016-04-06 02:28:16 +00:00
|
|
|
"tetris-scores.txt")))
|
2016-01-18 03:06:04 +00:00
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(evilified-state-evilify tetris-mode tetris-mode-map
|
|
|
|
"h" 'tetris-move-left
|
|
|
|
"i" 'tetris-rotate-prev
|
|
|
|
"j" 'tetris-move-bottom
|
|
|
|
"k" 'tetris-rotate-next
|
|
|
|
"l" 'tetris-move-right
|
|
|
|
"q" 'spacemacs/tetris-quit-game))))
|
2016-04-06 02:28:16 +00:00
|
|
|
|
2016-11-14 01:37:12 +00:00
|
|
|
(defun games/init-sudoku ()
|
|
|
|
(use-package sudoku
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-11-14 01:37:12 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(push '("sudoku" . (sudoku :quit (kill-buffer-ask (get-buffer "*Sudoku*"))
|
|
|
|
:reset sudoku-restart)) helm-games-list)
|
|
|
|
(evilified-state-evilify sudoku-mode sudoku-mode-map
|
|
|
|
;; Movement
|
|
|
|
"j" 'sudoku-move-point-down
|
|
|
|
"J" 'sudoku-move-point-downmost
|
|
|
|
"k" 'sudoku-move-point-up
|
|
|
|
"K" 'sudoku-move-point-upmost
|
|
|
|
"h" 'sudoku-move-point-left
|
|
|
|
"H" 'sudoku-move-point-leftmost
|
|
|
|
"l" 'sudoku-move-point-right
|
|
|
|
"L" 'sudoku-move-point-rightmost
|
|
|
|
|
|
|
|
;; Start/quit/print game
|
|
|
|
"N" 'sudoku
|
|
|
|
"q" 'sudoku-quit
|
|
|
|
"Q" 'sudoku-quit-immediately
|
|
|
|
"P" 'sudoku-print
|
|
|
|
|
|
|
|
;; Undo/redo
|
|
|
|
"u" 'sudoku-undo
|
|
|
|
"\C-r" 'sudoku-redo
|
|
|
|
|
|
|
|
;; Inserting values
|
|
|
|
"1" 'sudoku-change-point
|
|
|
|
"2" 'sudoku-change-point
|
|
|
|
"3" 'sudoku-change-point
|
|
|
|
"4" 'sudoku-change-point
|
|
|
|
"5" 'sudoku-change-point
|
|
|
|
"6" 'sudoku-change-point
|
|
|
|
"7" 'sudoku-change-point
|
|
|
|
"8" 'sudoku-change-point
|
|
|
|
"9" 'sudoku-change-point)
|
|
|
|
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'sudoku-mode
|
|
|
|
"c" 'sudoku-comment-puzzle
|
|
|
|
"h" 'sudoku-hint
|
|
|
|
"l" 'sudoku-load-puzzle
|
|
|
|
"L" 'sudoku-load-puzzle-collection
|
|
|
|
"s" 'sudoku-save-puzzle))))
|
|
|
|
|
2016-04-06 02:28:16 +00:00
|
|
|
(defun games/init-typit ()
|
|
|
|
(use-package typit
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-04-06 02:28:16 +00:00
|
|
|
:init
|
2016-04-06 02:41:36 +00:00
|
|
|
(progn
|
|
|
|
(push '("typit (beginner)" .
|
|
|
|
(spacemacs/games-start-typit-beginner
|
|
|
|
:quit (kill-buffer-ask (get-buffer "*typit*"))
|
|
|
|
:reset spacemacs/games-start-typit-beginner))
|
|
|
|
helm-games-list)
|
|
|
|
(push '("typit (expert)" .
|
|
|
|
(spacemacs/games-start-typit-expert
|
|
|
|
:quit (kill-buffer-ask (get-buffer "*typit*"))
|
|
|
|
:reset spacemacs/games-start-typit-expert))
|
|
|
|
helm-games-list))))
|