Skip to content

Commit a899ccf

Browse files
committed
First full game commit
1 parent 5335394 commit a899ccf

9 files changed

+1160
-52
lines changed

.gitignore

-52
This file was deleted.

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "raylib"]
2+
path = raylib
3+
url = https://github.com/raysan5/raylib.git

CMakeLists.txt

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
cmake_minimum_required(VERSION 3.22)
2+
project(tetris42 VERSION 1.0.0)
3+
4+
LIST(APPEND SRC tetris42.c)
5+
IF(WIN32)
6+
LIST(APPEND SRC tetris42.rc)
7+
ENDIF()
8+
9+
# Player count names are define via agruments
10+
add_executable(tetris42 ${SRC})
11+
# Players use generic names PLAYERn and below are seperate
12+
# clickable executables for different number of players
13+
add_executable(tetris4-1 ${SRC})
14+
add_executable(tetris4-2 ${SRC})
15+
add_executable(tetris4-3 ${SRC})
16+
add_executable(tetris4-4 ${SRC})
17+
18+
target_compile_definitions(tetris4-1 PUBLIC PLAYERS=1)
19+
target_compile_definitions(tetris4-2 PUBLIC PLAYERS=2)
20+
target_compile_definitions(tetris4-3 PUBLIC PLAYERS=3)
21+
target_compile_definitions(tetris4-4 PUBLIC PLAYERS=4)
22+
23+
set (CMAKE_BUILD_TYPE "Release")
24+
add_subdirectory(raylib)
25+
26+
find_path(RAYLIB_DIR "raylib.h" HINTS raylib/src)
27+
include_directories(${RAYLIB_DIR})
28+
LIST(APPEND LIBS raylib)
29+
target_link_libraries(tetris42 ${LIBS})
30+
target_link_libraries(tetris4-1 ${LIBS})
31+
target_link_libraries(tetris4-2 ${LIBS})
32+
target_link_libraries(tetris4-3 ${LIBS})
33+
target_link_libraries(tetris4-4 ${LIBS})
34+
35+
INSTALL(TARGETS tetris42 tetris4-1 tetris4-2 tetris4-3 tetris4-4
36+
DESTINATION bin)
37+
38+
# CPack support -
39+
set(CPACK_GENERATOR "ZIP;TGZ")
40+
include (CPack)

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Tetris42
2+
3+
Tetris tournament for up to 4 players. After a while the game moves on to more complicated forms.
4+
5+
## [Releases download](https://github.com/tpanj/tetris42/releases)
6+
7+
![Screenshot for two players](tetris42.png)
8+
9+
## Controls: __Rotate, movements.._
10+
11+
1. Player
12+
* `Keys_↑←↓→`
13+
1. Players
14+
* `KEYS_WASD` for player 1 on left
15+
* `Keys_↑←↓→` for player 2 on right
16+
1. Players
17+
* `KEYS_WASD` for player 1 on left
18+
* `Keys_↑←↓→` for player 2 on right
19+
* `GPAD1_5876` for player 3 below
20+
1. Players
21+
* `KEYS_WASD` for player 1 on left
22+
* `Keys_↑←↓→` for player 2 on right
23+
* `GPAD1_5876` for player 3 on left below
24+
* `GPAD2_5876` for player 4 on right below

raylib

Submodule raylib added at dbdbbea

0 commit comments

Comments
 (0)