forked from jaildesigner-jailgames/jaildoctors_dilemma
Merge branch 'master' of https://gitea.sustancia.synology.me/JailDesigner/jaildoctors_dilemma
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,3 +9,4 @@ thumbs.db
|
|||||||
*.tar.gz
|
*.tar.gz
|
||||||
*.zip
|
*.zip
|
||||||
*.app
|
*.app
|
||||||
|
*_debug
|
||||||
14
Makefile
14
Makefile
@@ -14,7 +14,7 @@ windows:
|
|||||||
@echo off
|
@echo off
|
||||||
powershell if (Test-Path data\config) {Remove-Item data\config -Recurse -Force}
|
powershell if (Test-Path data\config) {Remove-Item data\config -Recurse -Force}
|
||||||
powershell if (-not (Test-Path data\config)) {New-Item data\config -ItemType Directory}
|
powershell if (-not (Test-Path data\config)) {New-Item data\config -ItemType Directory}
|
||||||
g++ $(source) -std=c++11 -Wall -Os -lmingw32 -lSDL2main -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o $(executable).exe
|
g++ $(source) -D DEBUG -std=c++11 -Wall -Os -lmingw32 -lSDL2main -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o $(executable).exe
|
||||||
strip -s -R .comment -R .gnu.version $(executable).exe --strip-unneeded
|
strip -s -R .comment -R .gnu.version $(executable).exe --strip-unneeded
|
||||||
|
|
||||||
windows_release:
|
windows_release:
|
||||||
@@ -39,7 +39,7 @@ windows_release:
|
|||||||
powershell if (Test-Path "$(releaseFolder)\data\room\standard.tsx") {Remove-Item "$(releaseFolder)\data\room\standard.tsx" -Recurse -Force}
|
powershell if (Test-Path "$(releaseFolder)\data\room\standard.tsx") {Remove-Item "$(releaseFolder)\data\room\standard.tsx" -Recurse -Force}
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
g++ $(source) -D RELEASE -std=c++11 -Wall -Os -lmingw32 -lSDL2main -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o "$(releaseFolder)/$(executable).exe"
|
g++ $(source) -std=c++11 -Wall -Os -lmingw32 -lSDL2main -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o "$(releaseFolder)/$(executable).exe"
|
||||||
strip -s -R .comment -R .gnu.version "$(releaseFolder)/$(executable).exe" --strip-unneeded
|
strip -s -R .comment -R .gnu.version "$(releaseFolder)/$(executable).exe" --strip-unneeded
|
||||||
|
|
||||||
# Create ZIP
|
# Create ZIP
|
||||||
@@ -52,7 +52,7 @@ windows_release:
|
|||||||
macos:
|
macos:
|
||||||
rm -rdf data/config
|
rm -rdf data/config
|
||||||
mkdir -p data/config
|
mkdir -p data/config
|
||||||
clang++ $(source) -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -o $(executable)_macos
|
clang++ $(source) -D DEBUG -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -o $(executable)_macos
|
||||||
|
|
||||||
macos_release:
|
macos_release:
|
||||||
# Remove data
|
# Remove data
|
||||||
@@ -80,7 +80,7 @@ macos_release:
|
|||||||
cp release/Info.plist "$(releaseFolder)/$(appName).app/Contents"
|
cp release/Info.plist "$(releaseFolder)/$(appName).app/Contents"
|
||||||
|
|
||||||
# Build INTEL
|
# Build INTEL
|
||||||
clang++ $(source) -D RELEASE -D MACOS_BUNDLE -std=c++11 -Wall -Os -framework SDL2 -F ./Frameworks -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.12
|
clang++ $(source) -D MACOS_BUNDLE -std=c++11 -Wall -Os -framework SDL2 -F ./Frameworks -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.12
|
||||||
|
|
||||||
# Build INTEL DMG
|
# Build INTEL DMG
|
||||||
rm -f "$(macosIntelRelease)"
|
rm -f "$(macosIntelRelease)"
|
||||||
@@ -89,7 +89,7 @@ macos_release:
|
|||||||
rm -f tmp.dmg
|
rm -f tmp.dmg
|
||||||
|
|
||||||
# Build APPLE SILICON
|
# Build APPLE SILICON
|
||||||
clang++ $(source) -D RELEASE -D MACOS_BUNDLE -std=c++11 -Wall -Os -framework SDL2 -F ./Frameworks -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos11
|
clang++ $(source) -D MACOS_BUNDLE -std=c++11 -Wall -Os -framework SDL2 -F ./Frameworks -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos11
|
||||||
|
|
||||||
# Build APPLE SILICON DMG
|
# Build APPLE SILICON DMG
|
||||||
rm -f "$(macosAppleSiliconRelease)"
|
rm -f "$(macosAppleSiliconRelease)"
|
||||||
@@ -104,7 +104,7 @@ macos_release:
|
|||||||
linux:
|
linux:
|
||||||
rm -rdf data/config
|
rm -rdf data/config
|
||||||
mkdir -p data/config
|
mkdir -p data/config
|
||||||
g++ $(source) -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -o $(executable)_linux
|
g++ $(source) -D DEBUG -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -o $(executable)_linux
|
||||||
strip -s -R .comment -R .gnu.version $(executable)_linux --strip-unneeded
|
strip -s -R .comment -R .gnu.version $(executable)_linux --strip-unneeded
|
||||||
|
|
||||||
linux_release:
|
linux_release:
|
||||||
@@ -126,7 +126,7 @@ linux_release:
|
|||||||
rm -f "$(releaseFolder)/data/room/standard.tsx"
|
rm -f "$(releaseFolder)/data/room/standard.tsx"
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
g++ $(source) -D RELEASE -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -o $(releaseFolder)/$(executable)
|
g++ $(source) -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -o $(releaseFolder)/$(executable)
|
||||||
strip -s -R .comment -R .gnu.version $(releaseFolder)/$(executable) --strip-unneeded
|
strip -s -R .comment -R .gnu.version $(releaseFolder)/$(executable) --strip-unneeded
|
||||||
|
|
||||||
# Pack files
|
# Pack files
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
16,16,0,0,0,0,0,349,16,349,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,16,
|
16,16,0,0,0,0,0,349,16,349,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,16,
|
||||||
16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,
|
16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,
|
||||||
16,0,0,0,0,16,0,0,16,0,0,0,0,0,0,0,0,0,0,0,423,423,423,423,423,0,0,0,0,0,0,16,
|
16,0,0,0,0,16,0,0,16,0,0,0,0,0,0,0,0,0,0,0,423,423,423,423,423,0,0,0,0,0,0,16,
|
||||||
|
16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,423,423,423,423,423,0,0,0,0,0,0,16,
|
||||||
16,0,0,0,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,
|
16,0,0,0,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,
|
||||||
16,0,0,0,0,0,0,16,16,16,16,0,0,0,423,0,0,0,423,547,0,0,0,0,0,0,0,0,0,0,0,16,
|
16,0,0,0,0,0,0,16,16,16,16,0,0,0,423,0,0,0,423,547,0,0,0,0,0,0,0,0,0,0,0,16,
|
||||||
16,0,0,0,0,0,0,0,16,16,0,0,0,0,0,0,0,0,0,0,547,0,0,0,0,424,422,424,422,0,0,16,
|
16,0,0,0,0,0,0,0,16,16,0,0,0,0,0,0,0,0,0,0,547,0,0,0,0,424,422,424,422,0,0,16,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Director::Director(int argc, char *argv[])
|
|||||||
section.name = SECTION_PROG_LOGO;
|
section.name = SECTION_PROG_LOGO;
|
||||||
section.subsection = SUBSECTION_LOGO_TO_INTRO;
|
section.subsection = SUBSECTION_LOGO_TO_INTRO;
|
||||||
|
|
||||||
#ifndef RELEASE
|
#ifdef DEBUG
|
||||||
section.name = SECTION_PROG_GAME;
|
section.name = SECTION_PROG_GAME;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
|
|||||||
this->debug = debug;
|
this->debug = debug;
|
||||||
this->options = options;
|
this->options = options;
|
||||||
|
|
||||||
#ifndef RELEASE
|
#ifdef DEBUG
|
||||||
currentRoom = "33.room";
|
currentRoom = "14.room";
|
||||||
const int x1 = 1;
|
const int x1 = 1;
|
||||||
const int y1 = 13;
|
const int y1 = 13;
|
||||||
spawnPoint = {x1 * 8, y1 * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL};
|
spawnPoint = {x1 * 8, y1 * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL};
|
||||||
@@ -96,7 +96,7 @@ void Game::checkEventHandler()
|
|||||||
case SDL_SCANCODE_ESCAPE:
|
case SDL_SCANCODE_ESCAPE:
|
||||||
section.name = SECTION_PROG_TITLE;
|
section.name = SECTION_PROG_TITLE;
|
||||||
break;
|
break;
|
||||||
#ifndef RELEASE
|
#ifdef DEBUG
|
||||||
case SDL_SCANCODE_G:
|
case SDL_SCANCODE_G:
|
||||||
debug->switchEnabled();
|
debug->switchEnabled();
|
||||||
options->cheat.invincible = debug->getEnabled();
|
options->cheat.invincible = debug->getEnabled();
|
||||||
|
|||||||
@@ -195,6 +195,13 @@ void Player::checkInput()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (input->checkInput(INPUT_UP, REPEAT_TRUE))
|
if (input->checkInput(INPUT_UP, REPEAT_TRUE))
|
||||||
|
{
|
||||||
|
// Solo puede saltar si ademas de estar (state == s_standing)
|
||||||
|
// Esta sobre el suelo, rampa o suelo que se mueve
|
||||||
|
// Esto es para evitar el salto desde el vacio al cambiar de pantalla verticalmente
|
||||||
|
// Ya que se coloca el estado s_standing al cambiar de pantalla
|
||||||
|
|
||||||
|
if (isOnFloor() || isOnAutoSurface())
|
||||||
{
|
{
|
||||||
setState(s_jumping);
|
setState(s_jumping);
|
||||||
vy = -maxVY;
|
vy = -maxVY;
|
||||||
@@ -202,6 +209,7 @@ void Player::checkInput()
|
|||||||
jumpCounter = 0;
|
jumpCounter = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Indica si el jugador esta en uno de los cuatro bordes de la pantalla
|
// Indica si el jugador esta en uno de los cuatro bordes de la pantalla
|
||||||
bool Player::getOnBorder()
|
bool Player::getOnBorder()
|
||||||
@@ -265,10 +273,19 @@ void Player::checkState()
|
|||||||
vy = 0.0f;
|
vy = 0.0f;
|
||||||
jumpCounter = 0;
|
jumpCounter = 0;
|
||||||
fallCounter = 0;
|
fallCounter = 0;
|
||||||
|
if (!isOnFloor() && !isOnAutoSurface())
|
||||||
|
{
|
||||||
|
setState(s_falling);
|
||||||
|
vx = 0.0f;
|
||||||
|
vy = maxVY;
|
||||||
|
fallCounter++;
|
||||||
|
playFallSound();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (state == s_jumping)
|
else if (state == s_jumping)
|
||||||
{
|
{
|
||||||
|
fallCounter = 0;
|
||||||
jumpCounter++;
|
jumpCounter++;
|
||||||
playJumpSound();
|
playJumpSound();
|
||||||
}
|
}
|
||||||
@@ -281,7 +298,6 @@ void Player::switchBorders()
|
|||||||
{
|
{
|
||||||
y = PLAY_AREA_BOTTOM - h - 0 - BLOCK;
|
y = PLAY_AREA_BOTTOM - h - 0 - BLOCK;
|
||||||
setState(s_standing);
|
setState(s_standing);
|
||||||
// jumpIni += 128;
|
|
||||||
}
|
}
|
||||||
else if (border == BORDER_BOTTOM)
|
else if (border == BORDER_BOTTOM)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user