Skip to content

Commit

Permalink
First full game commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tpanj committed Dec 28, 2022
1 parent 5335394 commit a899ccf
Show file tree
Hide file tree
Showing 9 changed files with 1,160 additions and 52 deletions.
52 changes: 0 additions & 52 deletions .gitignore

This file was deleted.

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "raylib"]
path = raylib
url = https://github.com/raysan5/raylib.git
40 changes: 40 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
cmake_minimum_required(VERSION 3.22)
project(tetris42 VERSION 1.0.0)

LIST(APPEND SRC tetris42.c)
IF(WIN32)
LIST(APPEND SRC tetris42.rc)
ENDIF()

# Player count names are define via agruments
add_executable(tetris42 ${SRC})
# Players use generic names PLAYERn and below are seperate
# clickable executables for different number of players
add_executable(tetris4-1 ${SRC})
add_executable(tetris4-2 ${SRC})
add_executable(tetris4-3 ${SRC})
add_executable(tetris4-4 ${SRC})

target_compile_definitions(tetris4-1 PUBLIC PLAYERS=1)
target_compile_definitions(tetris4-2 PUBLIC PLAYERS=2)
target_compile_definitions(tetris4-3 PUBLIC PLAYERS=3)
target_compile_definitions(tetris4-4 PUBLIC PLAYERS=4)

set (CMAKE_BUILD_TYPE "Release")
add_subdirectory(raylib)

find_path(RAYLIB_DIR "raylib.h" HINTS raylib/src)
include_directories(${RAYLIB_DIR})
LIST(APPEND LIBS raylib)
target_link_libraries(tetris42 ${LIBS})
target_link_libraries(tetris4-1 ${LIBS})
target_link_libraries(tetris4-2 ${LIBS})
target_link_libraries(tetris4-3 ${LIBS})
target_link_libraries(tetris4-4 ${LIBS})

INSTALL(TARGETS tetris42 tetris4-1 tetris4-2 tetris4-3 tetris4-4
DESTINATION bin)

# CPack support -
set(CPACK_GENERATOR "ZIP;TGZ")
include (CPack)
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Tetris42

Tetris tournament for up to 4 players. After a while the game moves on to more complicated forms.

## [Releases download](https://github.com/tpanj/tetris42/releases)

![Screenshot for two players](tetris42.png)

## Controls: __Rotate, movements.._

1. Player
* `Keys_↑←↓→`
1. Players
* `KEYS_WASD` for player 1 on left
* `Keys_↑←↓→` for player 2 on right
1. Players
* `KEYS_WASD` for player 1 on left
* `Keys_↑←↓→` for player 2 on right
* `GPAD1_5876` for player 3 below
1. Players
* `KEYS_WASD` for player 1 on left
* `Keys_↑←↓→` for player 2 on right
* `GPAD1_5876` for player 3 on left below
* `GPAD2_5876` for player 4 on right below
1 change: 1 addition & 0 deletions raylib
Submodule raylib added at dbdbbe
Loading

0 comments on commit a899ccf

Please sign in to comment.