Skip to content

Commit

Permalink
apps/games: Rename Shift game to Brickmatch
Browse files Browse the repository at this point in the history
  • Loading branch information
acassis authored and xiaoxiang781216 committed Oct 24, 2023
1 parent e55f285 commit dfea0aa
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 47 deletions.
28 changes: 14 additions & 14 deletions games/shift/Kconfig → games/brickmatch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# see the file kconfig-language.txt in the NuttX tools repository.
#

config GAMES_SHIFT
bool "Shift Game"
config GAMES_BRICKMATCH
bool "Brickmatch Game"
default n
---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
from a Shift game that was available for Android in the
F-Droid store. The original game source code still here:
Expand All @@ -16,21 +16,21 @@ config GAMES_SHIFT
NOTE: The source code here is not based on that code from
above github.

if GAMES_SHIFT
if GAMES_BRICKMATCH

config GAMES_SHIFT_PROGNAME
config GAMES_BRICKMATCH_PROGNAME
string "Program name"
default "shift"
default "brick"
---help---
This is the name of the program that will be used when the NSH ELF
program is installed.

config GAMES_SHIFT_PRIORITY
int "Shift Game task priority"
config GAMES_BRICKMATCH_PRIORITY
int "Brickmatch Game task priority"
default 100

config GAMES_SHIFT_STACKSIZE
int "Shift Game stack size"
config GAMES_BRICKMATCH_STACKSIZE
int "Brickmatch Game stack size"
default DEFAULT_TASK_STACKSIZE

#
Expand All @@ -39,17 +39,17 @@ config GAMES_SHIFT_STACKSIZE

choice
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"
depends on !INPUT_DJOYSTICK && !SENSORS_APDS9960

config GAMES_SHIFT_USE_DJOYSTICK
config GAMES_BRICKMATCH_USE_DJOYSTICK
bool "Discrete Joystick as Input"
depends on INPUT_DJOYSTICK

config GAMES_SHIFT_USE_GESTURE
config GAMES_BRICKMATCH_USE_GESTURE
bool "Gesture Sensor APDS-9960 as Input"
depends on SENSORS_APDS9960

Expand Down
6 changes: 3 additions & 3 deletions games/shift/Make.defs → games/brickmatch/Make.defs
Original file line number Diff line number Diff line change
@@ -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
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -18,6 +18,6 @@
#
############################################################################

ifneq ($(CONFIG_GAMES_SHIFT),)
CONFIGURED_APPS += $(APPDIR)/games/shift
ifneq ($(CONFIG_GAMES_BRICKMATCH),)
CONFIGURED_APPS += $(APPDIR)/games/brickmatch
endif
16 changes: 8 additions & 8 deletions games/shift/Makefile → games/brickmatch/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################
# apps/games/shift/Makefile
# apps/games/brickmatch/Makefile
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -20,15 +20,15 @@

include $(APPDIR)/Make.defs

# Shift game info
# Brickmatch game info

PROGNAME = $(CONFIG_GAMES_SHIFT_PROGNAME)
PRIORITY = $(CONFIG_GAMES_SHIFT_PRIORITY)
STACKSIZE = $(CONFIG_GAMES_SHIFT_STACKSIZE)
MODULE = $(CONFIG_GAMES_SHIFT)
PROGNAME = $(CONFIG_GAMES_BRICKMATCH_PROGNAME)
PRIORITY = $(CONFIG_GAMES_BRICKMATCH_PRIORITY)
STACKSIZE = $(CONFIG_GAMES_BRICKMATCH_STACKSIZE)
MODULE = $(CONFIG_GAMES_BRICKMATCH)

# Shift game application
# Brickmatch game application

MAINSRC = shift_main.c
MAINSRC = bm_main.c

include $(APPDIR)/Application.mk
Original file line number Diff line number Diff line change
@@ -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
* contributor license agreements. See the NOTICE file distributed with
Expand All @@ -25,7 +25,7 @@
#include <nuttx/config.h>
#include <termios.h>

#include "shift_inputs.h"
#include "bm_inputs.h"

/****************************************************************************
* Preprocessor Definitions
Expand Down
Original file line number Diff line number Diff line change
@@ -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
* contributor license agreements. See the NOTICE file distributed with
Expand All @@ -26,7 +26,7 @@

#include <nuttx/sensors/apds9960.h>

#include "shift_inputs.h"
#include "bm_inputs.h"

/****************************************************************************
* Preprocessor Definitions
Expand Down
Original file line number Diff line number Diff line change
@@ -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
* contributor license agreements. See the NOTICE file distributed with
Expand All @@ -26,7 +26,7 @@

#include <nuttx/input/djoystick.h>

#include "shift_inputs.h"
#include "bm_inputs.h"

/****************************************************************************
* Preprocessor Definitions
Expand Down
8 changes: 4 additions & 4 deletions games/shift/shift_inputs.h → games/brickmatch/bm_inputs.h
Original file line number Diff line number Diff line change
@@ -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
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -50,13 +50,13 @@

struct input_state_s
{
#ifdef CONFIG_GAMES_SHIFT_USE_CONSOLEKEY
#ifdef CONFIG_GAMES_BRICKMATCH_USE_CONSOLEKEY
int fd_con;
#endif
#ifdef CONFIG_GAMES_SHIFT_USE_DJOYSTICK
#ifdef CONFIG_GAMES_BRICKMATCH_USE_DJOYSTICK
int fd_joy;
#endif
#ifdef CONFIG_GAMES_SHIFT_USE_GESTURE
#ifdef CONFIG_GAMES_BRICKMATCH_USE_GESTURE
int fd_gest;
#endif
int dir; /* Direction to move the blocks */
Expand Down
24 changes: 12 additions & 12 deletions games/shift/shift_main.c → games/brickmatch/bm_main.c
Original file line number Diff line number Diff line change
@@ -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
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -36,16 +36,16 @@
#include <nuttx/video/fb.h>
#include <nuttx/video/rgbcolors.h>

#ifdef CONFIG_GAMES_SHIFT_USE_CONSOLEKEY
#include "shift_input_console.h"
#ifdef CONFIG_GAMES_BRICKMATCH_USE_CONSOLEKEY
#include "bm_input_console.h"
#endif

#ifdef CONFIG_GAMES_SHIFT_USE_DJOYSTICK
#include "shift_input_joystick.h"
#ifdef CONFIG_GAMES_BRICKMATCH_USE_DJOYSTICK
#include "bm_input_joystick.h"
#endif

#ifdef CONFIG_GAMES_SHIFT_USE_GESTURE
#include "shift_input_gesture.h"
#ifdef CONFIG_GAMES_BRICKMATCH_USE_GESTURE
#include "bm_input_gesture.h"
#endif

/****************************************************************************
Expand Down Expand Up @@ -302,7 +302,7 @@ void draw_board(FAR struct screen_state_s *state,
* Draw the board including the user non-visible border for debugging.
****************************************************************************/

#ifdef DEBUG_SHIFT_GAME
#ifdef DEBUG_BRICKMATCH_GAME
void print_board(void)
{
int row;
Expand Down Expand Up @@ -750,7 +750,7 @@ int check_board(void)
****************************************************************************/

/****************************************************************************
* shift_main
* brick_main
****************************************************************************/

int main(int argc, FAR char *argv[])
Expand Down Expand Up @@ -854,7 +854,7 @@ int main(int argc, FAR char *argv[])

screen.dir = input.dir;

#ifdef DEBUG_SHIFT_GAME
#ifdef DEBUG_BRICKMATCH_GAME
printf("Before moving:\n");
print_board();
usleep(2000000);
Expand All @@ -868,7 +868,7 @@ int main(int argc, FAR char *argv[])

draw_board(&state, &area, &screen);

#ifdef DEBUG_SHIFT_GAME
#ifdef DEBUG_BRICKMATCH_GAME
printf("After moving:\n");
print_board();
usleep(1000000);
Expand Down Expand Up @@ -907,7 +907,7 @@ int main(int argc, FAR char *argv[])
usleep(500000);
}

#ifdef DEBUG_SHIFT_GAME
#ifdef DEBUG_BRICKMATCH_GAME
printf("After checking:\n");
print_board();
usleep(1000000);
Expand Down

0 comments on commit dfea0aa

Please sign in to comment.