Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PfAndrey committed Mar 8, 2019
0 parents commit 082a8d9
Show file tree
Hide file tree
Showing 29 changed files with 5,271 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "ext/SFML"]
path = ext/SFML
url = https://github.com/SFML/SFML.git
65 changes: 65 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
cmake_minimum_required(VERSION 3.5)
project(PacMan VERSION 0.99 LANGUAGES C CXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()

# BUILD EXTERNAL LIBRARIES
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
ExternalProject_Add(SFML
#GIT_REPOSITORY https://github.com/SFML/SFML.git GIT_TAG 2.5.1
SOURCE_DIR ${CMAKE_SOURCE_DIR}/ext/SFML
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
ExternalProject_Get_Property(SFML INSTALL_DIR)
set(SFML_LIB ${INSTALL_DIR})

# ADD SOURCE FILES AND HEADERS OF EXECUTABLE
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${SFML_LIB}/include ${TINY_XML_LIB}/include)

set(SOURCE
${CMAKE_SOURCE_DIR}/source/GameEngine.h
${CMAKE_SOURCE_DIR}/source/GameEngine.cpp
${CMAKE_SOURCE_DIR}/source/Geometry.h
${CMAKE_SOURCE_DIR}/source/Geometry.cpp
${CMAKE_SOURCE_DIR}/source/TileMap.h
${CMAKE_SOURCE_DIR}/source/GhostStates.h
${CMAKE_SOURCE_DIR}/source/GhostStates.cpp
${CMAKE_SOURCE_DIR}/source/PacManGame.h
${CMAKE_SOURCE_DIR}/source/PacManGame.cpp
${CMAKE_SOURCE_DIR}/source/Main.cpp
)

# LINK EXTERNAL LIBRARIES TO EXECUTABLE
LINK_DIRECTORIES(${SFML_LIB}/lib)

# ADD EXECUTABLE
add_executable(PacMan ${SOURCE})
if (MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT PacMan)
set_target_properties( PacMan PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/Build")
set_target_properties( PacMan PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/Build")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
endif(MSVC)

# ADD DEPENDISIES FOR EXECUTABLE
add_dependencies(PacMan SFML)

TARGET_LINK_LIBRARIES(PacMan
optimized sfml-system debug sfml-system-d
optimized sfml-window debug sfml-window-d
optimized sfml-graphics debug sfml-graphics-d
optimized sfml-audio debug sfml-audio-d)

# POST BUILD SCRIPTS
set(POST_LIB_DIR "lib")
if (WIN32)
set(POST_LIB_DIR "bin")
endif()

ADD_CUSTOM_COMMAND(TARGET PacMan POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${SFML_LIB}/${POST_LIB_DIR}" "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/res" "${CMAKE_CURRENT_BINARY_DIR}/res")
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mkdir build
cd build
cmake ..
cmake --build . --config Release
1 change: 1 addition & 0 deletions ext/SFML
Submodule SFML added at 4043f7
Binary file added res/Thumbs.db
Binary file not shown.
Binary file added res/begininng_sound.wav
Binary file not shown.
Binary file added res/eat_dot_sound.wav
Binary file not shown.
Binary file added res/ghost_eaten_sound.wav
Binary file not shown.
Binary file added res/ghost_regenerate_sound.wav
Binary file not shown.
Binary file added res/ghosts_frightened_sound.wav
Binary file not shown.
Binary file added res/life_lost_sound.wav
Binary file not shown.
Binary file added res/main_font.ttf
Binary file not shown.
Binary file added res/menu_font.ttf
Binary file not shown.
Binary file added res/score_font.ttf
Binary file not shown.
Binary file added res/some_font.ttf
Binary file not shown.
Binary file added res/sprites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions res/stage1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
****************************
*............**............*
*.****.*****.**.*****.****.*
*p****.*****.**.*****.****p*
*.****.*****.**.*****.****.*
*..........................*
*.****.**.********.**.****.*
*.****.**.********.**.****.*
*......**....**....**......*
******.***** ** *****.******
******.***** ** *****.******
******.** **.******
******.** ***12*** **.******
******.** ***34*** **.******
. **GGGG** .
******.** ******** **.******
******.** ******** **.******
******.** F **.******
******.** ******** **.******
******.** ******** **.******
*............**............*
*.****.*****.**.*****.****.*
*.****.*****.**.*****.****.*
*p..**.......P .......**..p*
***.**.**.********.**.**.***
***.**.**.********.**.**.***
*......**....**....**......*
*.**********.**.**********.*
*.**********.**.**********.*
*..........................*
****************************
31 changes: 31 additions & 0 deletions res/stage2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
****************************
............................
******.**************.******
******.**************.******
*............**............*
*.*******.**.**.**.*******.*
*.*******.**.**.**.*******.*
*.**p.....**.**.**.....p**.*
*.**.****.**....**.****.**.*
*.**.****.********.****.**.*
*......**.********.**......*
******.**..........**.******
******.**.***12***.**.******
*......**.***34***.**......*
*.****....**....**....****.*
*.****.**.********.**.****.*
*...**.**.********.**.**...*
***.**.**..........**.**.***
***.**.****.****.****.**.***
***.**.****.****.****.**.***
*...........****...........*
*.*********.****.*********.*
*.*********.****.*********.*
.......**....P.....**.......
***.**.**.********.**.**.***
***.**.**.********.**.**.***
*..p**.......**.......**p..*
*.****.*****.**.*****.****.*
*.****.*****.**.*****.****.*
*..........................*
****************************
Loading

0 comments on commit 082a8d9

Please sign in to comment.