Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #16

Merged
merged 78 commits into from
Jul 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
f0a9d96
Added keyboard map movement
noxytrux May 10, 2018
6318f1f
Resolve conflicts
noxytrux May 10, 2018
95b0fce
Added move in Windows
noxytrux May 10, 2018
21b20f5
Removed armeabi from possible ABIs to build.
May 24, 2018
015530b
Removed unused dependencies.
May 24, 2018
334307e
Compile against the newest stable SDK. Gradle, plugins and libraries …
May 24, 2018
d66b315
Removed action bar from the project and cleaned up styles.xml.
May 24, 2018
5d872e5
Converted the try-catch-finally to try-with-resources to reduce the a…
May 24, 2018
4dff841
Pixfight now uses an adaptive launcher icon for Android 8.0+ (or, for…
May 25, 2018
aa4a1a4
Removed background from the new game layout.
May 25, 2018
221211c
Removed overdraw also from other layouts.
May 25, 2018
679f28a
Changed timer to CLOCK_MONOTONIC for Android.
May 25, 2018
503f71b
Initial commit
May 26, 2018
7c04944
Added RaspberryPi
noxytrux May 25, 2018
52e9c0e
Merge pull request #11 from inFullMobile/feature/RaspberyPi
noxytrux May 26, 2018
86ec36c
Replaced most Activities with Fragments as per current recommendation…
May 29, 2018
065ffb7
Corrected declarations of JNI bindings to fix extra warnings/errors o…
May 29, 2018
f97594b
Enabled Java 8 support and converted anonymous classes to lambdas/met…
May 29, 2018
a803359
Added creating a .nomedia file to the folder with game assets.
May 29, 2018
9084f0a
Compressed losslessly all MP3/PNG assets, gaining a 25% reduction in …
May 29, 2018
81d1cd1
Added ProGuard rules for release builds.
May 29, 2018
8198d2d
Implemented muting/unmuting music on app pausing/resuming.
May 29, 2018
7669063
Fixed OpenGL renderer crashing on exiting the rendering fragment or g…
May 30, 2018
9307290
Main font is now loaded from assets only once and shared later if nee…
May 30, 2018
8c4aa09
Added full server
Jun 1, 2018
60caec0
Lint warnings/errors fixes and a small resource cleanup.
Jun 2, 2018
df125a9
Replaced support-v4 with support-fragment.
Jun 2, 2018
45de11e
Fixed switches in the settings layout not being centered.
Jun 2, 2018
ebefd2e
Increased version number to 1.1.
Jun 2, 2018
267d024
Merge pull request #12 from Parseus/develop
noxytrux Jun 2, 2018
83e0df9
Initial Client code
Jun 2, 2018
48c182e
Merge branch 'develop' into feature/multiplayer
Jun 2, 2018
37db8f3
Android settings fixes
Jun 2, 2018
e220b4e
Added missing file
Jun 2, 2018
fe92ccf
Current game state is now properly preserved after going to background!
Jun 2, 2018
9ecc5dc
Fixed a crash accidentally introduced in a previous commit.
Jun 2, 2018
a16c11e
Replaced deprecated getColor()/getDrawable() methods with their equiv…
Jun 2, 2018
2cab9ff
PixFight doesn't need to rely on loading the FFF Atlantis font from a…
Jun 2, 2018
a6124fb
Converted global Button fields to the local ones in the RenderFragmen…
Jun 2, 2018
58211c8
Changed screen orientation of the activity to sensorLandscape.
Jun 3, 2018
77b430d
Assets in core files should also be compressed, otherwise CMake will …
Jun 3, 2018
b1e3d53
More PNG compression :D
Jun 3, 2018
eb1c892
Small cleanup in resources and a .gitignore update.
Jun 3, 2018
f631e61
Release builds should not remove thumbnails for levels.
Jun 3, 2018
d950bc3
Replaced a deprecated ProgressDialog with a custom dialog that serves…
Jun 4, 2018
f732f30
Merge remote-tracking branch 'upstream/develop' into develop
Jun 4, 2018
fe0f129
Increased version number to 1.2.
Jun 4, 2018
65a7ff3
client code
Jun 4, 2018
3e7ec58
Merge pull request #13 from Parseus/develop
noxytrux Jun 4, 2018
56fa227
resolve conflicts
Jun 4, 2018
fbf7fcc
Fix loading game saves.
Jun 12, 2018
b73f354
Server / Client test POC
Jun 12, 2018
7fdedd0
Merge pull request #14 from Parseus/develop
noxytrux Jun 13, 2018
fe03ee9
Added leave command
Jun 13, 2018
1c9321e
Server / client makefiles
Jun 13, 2018
a088bd3
New files
Jun 13, 2018
63de40c
Initial iOS Multiplayer
Jun 21, 2018
4db62b0
Complete iOS multiplayer
Jun 23, 2018
13d5843
Fixed logo
Jun 23, 2018
5601435
iPhone 5 fixes
Jun 23, 2018
4c9096c
Linux compilation fixes
noxytrux Jun 24, 2018
d715396
Update gitignore
Jun 24, 2018
82d9c80
Complete iOS multiplayer, fixes to game logic
Jun 24, 2018
9edb38a
macOS multiplayer
Jun 27, 2018
bbc7151
Linux multiplayer
noxytrux Jul 2, 2018
c09ca52
RPI multiplayer
noxytrux Jul 2, 2018
f90bc5e
HTML compilation fix
Jul 2, 2018
e549fbf
Windows multiplayer
noxytrux Jul 3, 2018
b16cdc9
Fixed android compilation
Jul 3, 2018
5c4d174
Updated readme
Jul 3, 2018
430ab84
mutliplayer layout
Jul 4, 2018
3317420
Android NDK update
Jul 5, 2018
7c91ddc
Android multiplayer
Jul 6, 2018
29c6cdd
RoomInfo change
Jul 7, 2018
c3c1126
compilation fix
Jul 7, 2018
700e9e6
Text label fix
Jul 7, 2018
0af0e51
Linux compilation fix
noxytrux Jul 7, 2018
4aed812
Merge pull request #15 from inFullMobile/feature/multiplayer
noxytrux Jul 7, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
#core
CORE/build.gradle

#SERVER
SERVER/DerivedData/
SERVER/PFServer/DerivedData/
SERVER/PFServer/bin/
SERVER/PFServer/obj/
SERVER/PFClient/bin/
SERVER/PFClient/obj/

#iOS
PLATFORM/iOS/DerivedData/
PLATFORM/iOS/PixFight.xcodeproj/xcuserdata/
Expand All @@ -16,6 +24,9 @@ PLATFORM/macOS/PixFight.xcodeproj/project.xcworkspace/xcuserdata/
#android
PLATFORM/Android/build
PLATFORM/Android/app/build
PLATFORM/Android/app/release/
PLATFORM/Android/.idea/caches/
PLATFORM/Android/.idea/assetWizardSettings.xml

#linux
PLATFORM/Linux/obj/
Expand All @@ -36,3 +47,8 @@ MAPEDITOR/nul

#html5
PLATFORM/HTML5/bin/

#raspberrypi

PLATFORM/RaspberryPi/bin/
PLATFORM/RaspberryPi/obj/
94 changes: 30 additions & 64 deletions CORE/AI/AIPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
GameUnit::unitspec s1 = a->getStats();
GameUnit::unitspec s2 = b->getStats();

float BonusA = s1.Expirence;
float BonusB = s2.Expirence;
//Bouns should come from Terrain type
float BonusA = 0;
float BonusB = 0;

float P = 0.0;

float TaA = 0.0;
Expand All @@ -36,20 +38,20 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
switch (TypeA) {
case M_INFANTRY:
switch (TypeB) {
case M_INFANTRY: {}
case M_INFANTRY:
break;
case M_BAZOOKA: {}
case M_BAZOOKA:
break;
case M_JEEP: {
TaA = -3.0;
TaA = -2.0;
}
break;
case M_LTANK: {
TaA = -3.0;
TaA = -2.0;
}
break;
case M_ARTILLERY: {
TaA = -3.0;
TaA = -2.0;
}
break;
default:
Expand All @@ -63,15 +65,15 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
case M_BAZOOKA: {}
break;
case M_JEEP: {
TaA = 2.0;
TaA = 3.0;
}
break;
case M_LTANK: {
TaA = 2.0;
TaA = 3.0;
}
break;
case M_ARTILLERY: {
TaA = 2.0;
TaA = 3.0;
}
break;
default:
Expand All @@ -81,26 +83,24 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
case M_JEEP :
switch (TypeB) {
case M_INFANTRY: {
TaB = -3.0;
TaB = -2.0;
TdB = -2.0;
}
break;
case M_BAZOOKA: {
TaB = 2.0;
TaB = 3.0;
TdB = -2.0;
}
break;
case M_JEEP: {
TaA = -6.0;
TaB = -6.0;
}
break;
case M_LTANK: {
TaA = -6.0;
TaB = -3.0;
TaA = -4.0;
}
break;
case M_ARTILLERY :{
TaA = -6.0;
TaB = -6.0;
TaA = -4.0;
}
break;
default:
Expand All @@ -110,27 +110,20 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
case M_LTANK :
switch (TypeB) {
case M_INFANTRY: {
TaB = -3.0;
TaB = -2.0;
}
break;
case M_BAZOOKA: {
TaB = 2.0;
TaB = 3.0;
}
break;
case M_JEEP: {
TaA = -3.0;
TaB = -6.0;
TaB = -4.0;
}
break;
case M_LTANK: {
TaA = -3.0;
TaB = -3.0;
}
case M_LTANK:
break;
case M_ARTILLERY: {
TaA = -3.0;
TaB = -6.0;
}
case M_ARTILLERY:
break;
default:
break;
Expand All @@ -139,27 +132,20 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
case M_ARTILLERY :
switch (TypeB) {
case M_INFANTRY: {
TaB = -3.0;
TaB = -2.0;
}
break;
case M_BAZOOKA: {
TaB = 2.0;
TaB = 3.0;
}
break;
case M_JEEP: {
TaA = -6.0;
TaB = -6.0;
TaB = -4.0;
}
break;
case M_LTANK: {
TaA = -6.0;
TaB = -3.0;
}
case M_LTANK:
break;
case M_ARTILLERY: {
TaA = -6.0;
TaB = -6.0;
}
case M_ARTILLERY:
break;
default:
break;
Expand Down Expand Up @@ -274,29 +260,9 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
auto TA = a;
auto TB = b;

if (unitsToDestroyForB > 0.0) { //Unit hit oppnent

TA->addExp(0.05);
}
else {

TB->addExp(0.05);
}

if (unitsToDestroyForA > 0.0) {

TB->addExp(0.05);
}//not hited enemy Guard Bonus
else {

TA->addExp(0.05);
}

//Units Removing
if (unitsToDestroyForB >= SizeB) {

TA->addExp(0.1);

if (TB->getRequestID() != -1) {

for (auto fBase : bases) {
Expand All @@ -313,6 +279,7 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
}

unitToDestroy = DESTROY_SECOND;
TB->setSize(0);
TB = nullptr;
}
else {
Expand All @@ -326,8 +293,6 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit

if (TB != nullptr) {

TB->addExp(0.1);

if (TA->getRequestID() != -1) {

for (auto fBase : bases) {
Expand All @@ -351,6 +316,7 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
unitToDestroy = DESTROY_FIRST;
}

TA->setSize(0);
TA = nullptr;
}
else {
Expand Down
8 changes: 7 additions & 1 deletion CORE/Audio/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "fmod_errors.h"

Audio::Audio() {

_muted = false;

_result = FMOD::System_Create(&_system);
Expand All @@ -40,6 +39,13 @@ Audio::Audio() {

#endif

#ifdef _RPI_

//this could be different depending on PI double check this in future
_system->setDriver(1);

#endif // _RPI_

_paths.clear();

_result = _system->init(32, FMOD_INIT_NORMAL, nullptr);
Expand Down
12 changes: 6 additions & 6 deletions CORE/Core-pch.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Core-pch.hpp"

#ifdef __ANDROID__
#if defined(__ANDROID__) || defined(_RPI_)

PFNGLBINDVERTEXARRAYOESPROC glBindVertexArrayOES = nullptr;
PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOES = nullptr;
Expand All @@ -19,11 +19,11 @@ int PLAYERTEAMSELECTED = 1;
int GAME_IDCOUNTER = 0;

int UNITS_RATINGS[5][3] = {
{6,6,5}, //M_INFANTRY
{6,6,5}, //M_BAZOOKA
{10,8,5}, //M_JEEP
{10,10,5}, //M_LTANK
{10,3,4} //M_ARTILLERY
{ 4, 6, 4}, //M_INFANTRY
{ 6, 6, 4}, //M_BAZOOKA
{ 8, 8, 5}, //M_JEEP
{10,10, 4}, //M_LTANK
{10, 3, 3} //M_ARTILLERY
};

bool AlmostEqual(const xVec2 & a, const xVec2 & b) {
Expand Down
44 changes: 35 additions & 9 deletions CORE/Core-pch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@
#define GLFW_INCLUDE_ES2
#include <GLFW/glfw3.h>
#include <emscripten/emscripten.h>

#define glBindVertexArray glBindVertexArrayOES
#define glGenVertexArrays glGenVertexArraysOES
#define glDeleteVertexArrays glDeleteVertexArraysOES

#else

#ifdef _WIN32

#define NOMINMAX
#include <windows.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GLFW/glfw3.h>
#define GL_RED_EXT GL_RED

#endif

#ifdef __APPLE__
Expand Down Expand Up @@ -94,12 +93,39 @@

#elif defined(__linux__)

#include <GL/glew.h>
#include <GL/gl.h>
#include <GLFW/glfw3.h>
#define GL_RED_EXT GL_RED
#ifdef _RPI_

#endif
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>

#include <EGL/egl.h>

extern PFNGLBINDVERTEXARRAYOESPROC glBindVertexArrayOES;
extern PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOES;
extern PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArraysOES;

extern void eglBuildVertexArray();

#define glBindVertexArray glBindVertexArrayOES
#define glGenVertexArrays glGenVertexArraysOES
#define glDeleteVertexArrays glDeleteVertexArraysOES

#define GLFW_INCLUDE_ES2

#else

#include <GL/glew.h>
#include <GL/gl.h>

#endif

#include <GLFW/glfw3.h>

#ifndef _RPI_
#define GL_RED_EXT GL_RED
#endif

#endif

#endif

Expand Down
2 changes: 1 addition & 1 deletion CORE/GameLogic/Drawable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "DrawingContext.hpp"

class Drawable {
class DrawableObject {

public:

Expand Down
Loading