apps/games: Rename Shift game to Brickmatch
This commit is contained in:
parent
e55f28594c
commit
dfea0aad48
@ -3,11 +3,11 @@
|
|||||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||||
#
|
#
|
||||||
|
|
||||||
config GAMES_SHIFT
|
config GAMES_BRICKMATCH
|
||||||
bool "Shift Game"
|
bool "Brickmatch Game"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Enable Shift games. Shift is a brick game, like a mix
|
Enable Brickmatch games. Brickmatch is like a mix
|
||||||
between Tetris and Crush Candy. The inspiration came
|
between Tetris and Crush Candy. The inspiration came
|
||||||
from a Shift game that was available for Android in the
|
from a Shift game that was available for Android in the
|
||||||
F-Droid store. The original game source code still here:
|
F-Droid store. The original game source code still here:
|
||||||
@ -16,21 +16,21 @@ config GAMES_SHIFT
|
|||||||
NOTE: The source code here is not based on that code from
|
NOTE: The source code here is not based on that code from
|
||||||
above github.
|
above github.
|
||||||
|
|
||||||
if GAMES_SHIFT
|
if GAMES_BRICKMATCH
|
||||||
|
|
||||||
config GAMES_SHIFT_PROGNAME
|
config GAMES_BRICKMATCH_PROGNAME
|
||||||
string "Program name"
|
string "Program name"
|
||||||
default "shift"
|
default "brick"
|
||||||
---help---
|
---help---
|
||||||
This is the name of the program that will be used when the NSH ELF
|
This is the name of the program that will be used when the NSH ELF
|
||||||
program is installed.
|
program is installed.
|
||||||
|
|
||||||
config GAMES_SHIFT_PRIORITY
|
config GAMES_BRICKMATCH_PRIORITY
|
||||||
int "Shift Game task priority"
|
int "Brickmatch Game task priority"
|
||||||
default 100
|
default 100
|
||||||
|
|
||||||
config GAMES_SHIFT_STACKSIZE
|
config GAMES_BRICKMATCH_STACKSIZE
|
||||||
int "Shift Game stack size"
|
int "Brickmatch Game stack size"
|
||||||
default DEFAULT_TASK_STACKSIZE
|
default DEFAULT_TASK_STACKSIZE
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -39,17 +39,17 @@ config GAMES_SHIFT_STACKSIZE
|
|||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Input Device (Joystick, Gesture Sensor, etc)"
|
prompt "Input Device (Joystick, Gesture Sensor, etc)"
|
||||||
default GAMES_SHIFT_USE_CONSOLEKEY
|
default GAMES_BRICKMATCH_USE_CONSOLEKEY
|
||||||
|
|
||||||
config GAMES_SHIFT_USE_CONSOLEKEY
|
config GAMES_BRICKMATCH_USE_CONSOLEKEY
|
||||||
bool "Serial Console as Input"
|
bool "Serial Console as Input"
|
||||||
depends on !INPUT_DJOYSTICK && !SENSORS_APDS9960
|
depends on !INPUT_DJOYSTICK && !SENSORS_APDS9960
|
||||||
|
|
||||||
config GAMES_SHIFT_USE_DJOYSTICK
|
config GAMES_BRICKMATCH_USE_DJOYSTICK
|
||||||
bool "Discrete Joystick as Input"
|
bool "Discrete Joystick as Input"
|
||||||
depends on INPUT_DJOYSTICK
|
depends on INPUT_DJOYSTICK
|
||||||
|
|
||||||
config GAMES_SHIFT_USE_GESTURE
|
config GAMES_BRICKMATCH_USE_GESTURE
|
||||||
bool "Gesture Sensor APDS-9960 as Input"
|
bool "Gesture Sensor APDS-9960 as Input"
|
||||||
depends on SENSORS_APDS9960
|
depends on SENSORS_APDS9960
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# apps/games/shift/Make.defs
|
# apps/games/brickmatch/Make.defs
|
||||||
#
|
#
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
# contributor license agreements. See the NOTICE file distributed with
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -18,6 +18,6 @@
|
|||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
ifneq ($(CONFIG_GAMES_SHIFT),)
|
ifneq ($(CONFIG_GAMES_BRICKMATCH),)
|
||||||
CONFIGURED_APPS += $(APPDIR)/games/shift
|
CONFIGURED_APPS += $(APPDIR)/games/brickmatch
|
||||||
endif
|
endif
|
@ -1,5 +1,5 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# apps/games/shift/Makefile
|
# apps/games/brickmatch/Makefile
|
||||||
#
|
#
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
# contributor license agreements. See the NOTICE file distributed with
|
# contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -20,15 +20,15 @@
|
|||||||
|
|
||||||
include $(APPDIR)/Make.defs
|
include $(APPDIR)/Make.defs
|
||||||
|
|
||||||
# Shift game info
|
# Brickmatch game info
|
||||||
|
|
||||||
PROGNAME = $(CONFIG_GAMES_SHIFT_PROGNAME)
|
PROGNAME = $(CONFIG_GAMES_BRICKMATCH_PROGNAME)
|
||||||
PRIORITY = $(CONFIG_GAMES_SHIFT_PRIORITY)
|
PRIORITY = $(CONFIG_GAMES_BRICKMATCH_PRIORITY)
|
||||||
STACKSIZE = $(CONFIG_GAMES_SHIFT_STACKSIZE)
|
STACKSIZE = $(CONFIG_GAMES_BRICKMATCH_STACKSIZE)
|
||||||
MODULE = $(CONFIG_GAMES_SHIFT)
|
MODULE = $(CONFIG_GAMES_BRICKMATCH)
|
||||||
|
|
||||||
# Shift game application
|
# Brickmatch game application
|
||||||
|
|
||||||
MAINSRC = shift_main.c
|
MAINSRC = bm_main.c
|
||||||
|
|
||||||
include $(APPDIR)/Application.mk
|
include $(APPDIR)/Application.mk
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/games/shift/shift_input_console.h
|
* apps/games/brickmatch/bm_input_console.h
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -25,7 +25,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
|
||||||
#include "shift_inputs.h"
|
#include "bm_inputs.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Preprocessor Definitions
|
* Preprocessor Definitions
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/games/shift/shift_input_gesture.h
|
* apps/games/brickmatch/bm_input_gesture.h
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <nuttx/sensors/apds9960.h>
|
#include <nuttx/sensors/apds9960.h>
|
||||||
|
|
||||||
#include "shift_inputs.h"
|
#include "bm_inputs.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Preprocessor Definitions
|
* Preprocessor Definitions
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/games/shift/shift_input_joystick.h
|
* apps/games/brickmatch/bm_input_joystick.h
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <nuttx/input/djoystick.h>
|
#include <nuttx/input/djoystick.h>
|
||||||
|
|
||||||
#include "shift_inputs.h"
|
#include "bm_inputs.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Preprocessor Definitions
|
* Preprocessor Definitions
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/games/shift/shift_inputs.h
|
* apps/games/brickmatch/bm_inputs.h
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -50,13 +50,13 @@
|
|||||||
|
|
||||||
struct input_state_s
|
struct input_state_s
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_GAMES_SHIFT_USE_CONSOLEKEY
|
#ifdef CONFIG_GAMES_BRICKMATCH_USE_CONSOLEKEY
|
||||||
int fd_con;
|
int fd_con;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_GAMES_SHIFT_USE_DJOYSTICK
|
#ifdef CONFIG_GAMES_BRICKMATCH_USE_DJOYSTICK
|
||||||
int fd_joy;
|
int fd_joy;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_GAMES_SHIFT_USE_GESTURE
|
#ifdef CONFIG_GAMES_BRICKMATCH_USE_GESTURE
|
||||||
int fd_gest;
|
int fd_gest;
|
||||||
#endif
|
#endif
|
||||||
int dir; /* Direction to move the blocks */
|
int dir; /* Direction to move the blocks */
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/games/shift/shift_main.c
|
* apps/games/brickmatch/bm_main.c
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -36,16 +36,16 @@
|
|||||||
#include <nuttx/video/fb.h>
|
#include <nuttx/video/fb.h>
|
||||||
#include <nuttx/video/rgbcolors.h>
|
#include <nuttx/video/rgbcolors.h>
|
||||||
|
|
||||||
#ifdef CONFIG_GAMES_SHIFT_USE_CONSOLEKEY
|
#ifdef CONFIG_GAMES_BRICKMATCH_USE_CONSOLEKEY
|
||||||
#include "shift_input_console.h"
|
#include "bm_input_console.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_GAMES_SHIFT_USE_DJOYSTICK
|
#ifdef CONFIG_GAMES_BRICKMATCH_USE_DJOYSTICK
|
||||||
#include "shift_input_joystick.h"
|
#include "bm_input_joystick.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_GAMES_SHIFT_USE_GESTURE
|
#ifdef CONFIG_GAMES_BRICKMATCH_USE_GESTURE
|
||||||
#include "shift_input_gesture.h"
|
#include "bm_input_gesture.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -302,7 +302,7 @@ void draw_board(FAR struct screen_state_s *state,
|
|||||||
* Draw the board including the user non-visible border for debugging.
|
* Draw the board including the user non-visible border for debugging.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef DEBUG_SHIFT_GAME
|
#ifdef DEBUG_BRICKMATCH_GAME
|
||||||
void print_board(void)
|
void print_board(void)
|
||||||
{
|
{
|
||||||
int row;
|
int row;
|
||||||
@ -750,7 +750,7 @@ int check_board(void)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* shift_main
|
* brick_main
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int main(int argc, FAR char *argv[])
|
int main(int argc, FAR char *argv[])
|
||||||
@ -854,7 +854,7 @@ int main(int argc, FAR char *argv[])
|
|||||||
|
|
||||||
screen.dir = input.dir;
|
screen.dir = input.dir;
|
||||||
|
|
||||||
#ifdef DEBUG_SHIFT_GAME
|
#ifdef DEBUG_BRICKMATCH_GAME
|
||||||
printf("Before moving:\n");
|
printf("Before moving:\n");
|
||||||
print_board();
|
print_board();
|
||||||
usleep(2000000);
|
usleep(2000000);
|
||||||
@ -868,7 +868,7 @@ int main(int argc, FAR char *argv[])
|
|||||||
|
|
||||||
draw_board(&state, &area, &screen);
|
draw_board(&state, &area, &screen);
|
||||||
|
|
||||||
#ifdef DEBUG_SHIFT_GAME
|
#ifdef DEBUG_BRICKMATCH_GAME
|
||||||
printf("After moving:\n");
|
printf("After moving:\n");
|
||||||
print_board();
|
print_board();
|
||||||
usleep(1000000);
|
usleep(1000000);
|
||||||
@ -907,7 +907,7 @@ int main(int argc, FAR char *argv[])
|
|||||||
usleep(500000);
|
usleep(500000);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_SHIFT_GAME
|
#ifdef DEBUG_BRICKMATCH_GAME
|
||||||
printf("After checking:\n");
|
printf("After checking:\n");
|
||||||
print_board();
|
print_board();
|
||||||
usleep(1000000);
|
usleep(1000000);
|
Loading…
x
Reference in New Issue
Block a user