Skip to content

Commit

Permalink
физика, загрузка платформ
Browse files Browse the repository at this point in the history
  • Loading branch information
spidamoo committed Sep 26, 2013
1 parent a4251b6 commit 5f2f330
Show file tree
Hide file tree
Showing 38 changed files with 540 additions and 133 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.o
*.exe
*.log
*.layout
16 changes: 10 additions & 6 deletions SoDlib/SoDLib.depend
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
1378195931 d:\git\sod\sodlib\include\animation.h
<SoDlib.h>

1378305217 d:\git\sod\sodlib\include\sodlib.h
1380205572 d:\git\sod\sodlib\include\sodlib.h
<hge.h>
<hgeanim.h>
<hgegui.h>
Expand All @@ -84,6 +84,7 @@
<NonPlayerCharacter.h>
<PlayerCharacter.h>
<GroundLine.h>
<Platform.h>
<MapAnimation.h>
<DebugDraw.h>
<GUIWindow.h>
Expand Down Expand Up @@ -268,7 +269,7 @@
<stdio.h>
<string.h>

1378383264 d:\git\sod\sodlib\include\game.h
1380205000 d:\git\sod\sodlib\include\game.h
<SoDlib.h>

1378195931 d:\git\sod\sodlib\include\construction.h
Expand All @@ -295,7 +296,7 @@
1378195931 d:\git\sod\sodlib\include\playercharacter.h
<SoDlib.h>

1379673826 d:\git\sod\sodlib\include\groundline.h
1380185565 d:\git\sod\sodlib\include\groundline.h
<SoDlib.h>

1378306187 d:\git\sod\sodlib\include\mapanimation.h
Expand Down Expand Up @@ -332,10 +333,10 @@
1378195931 source:d:\git\sod\sodlib\src\exception.cpp
"Exception.h"

1380120262 source:d:\git\sod\sodlib\src\game.cpp
1380205490 source:d:\git\sod\sodlib\src\game.cpp
"Game.h"

1379673918 source:d:\git\sod\sodlib\src\groundline.cpp
1380189463 source:d:\git\sod\sodlib\src\groundline.cpp
"GroundLine.h"

1378195931 source:d:\git\sod\sodlib\src\guiwindow.cpp
Expand Down Expand Up @@ -371,7 +372,7 @@
"tinyxml.h"
<windows.h>

1380119661 source:d:\git\sod\sodlib\src\character.cpp
1380203057 source:d:\git\sod\sodlib\src\character.cpp
"Character.h"

1342709300 source:d:\work\git\sod\sodlib\hgeanim.cpp
Expand Down Expand Up @@ -749,3 +750,6 @@
1380139809 source:d:\work\git\sod\sodlib\src\groundline.cpp
"GroundLine.h"

1380205663 d:\git\sod\sodlib\include\platform.h
<SoDlib.h>

2 changes: 2 additions & 0 deletions SoDlib/SoDlib.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<Unit filename="include/GroundLine.h" />
<Unit filename="include/MapAnimation.h" />
<Unit filename="include/NonPlayerCharacter.h" />
<Unit filename="include/Platform.h" />
<Unit filename="include/PlayerCharacter.h" />
<Unit filename="include/SoDlib.h" />
<Unit filename="include/hgeGUIMenuItem.h" />
Expand All @@ -81,6 +82,7 @@
<Unit filename="src/GroundLine.cpp" />
<Unit filename="src/MapAnimation.cpp" />
<Unit filename="src/NonPlayerCharacter.cpp" />
<Unit filename="src/Platform.cpp" />
<Unit filename="src/PlayerCharacter.cpp" />
<Unit filename="src/hgeGUIMenuItem.cpp" />
<Unit filename="tinystr.cpp" />
Expand Down
133 changes: 69 additions & 64 deletions SoDlib/SoDlib.layout
Original file line number Diff line number Diff line change
@@ -1,94 +1,85 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug" />
<File name="include\hgeGUIMenuItem.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\tinystr.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="3495" topLine="99" />
</Cursor>
</File>
<File name="include\tinystr.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\GUIWindow.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3495" topLine="99" />
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\tinyxml.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="15429" topLine="455" />
</Cursor>
</File>
<File name="src\Animation.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\Game.h" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="1768" topLine="27" />
</Cursor>
</File>
<File name="src\Character.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\Animation.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="14858" topLine="191" />
<Cursor1 position="0" topLine="0" />
</Cursor>
<Folding>
<Collapse line="31" />
</Folding>
</File>
<File name="hgeanim.cpp" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\Platform.cpp" open="1" top="1" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="361" topLine="9" />
</Cursor>
</File>
<File name="src\CharacterAction.cpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\GroundLine.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="484" topLine="0" />
</Cursor>
</File>
<File name="hgecolor.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\Character.cpp" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="11799" topLine="140" />
</Cursor>
<Folding>
<Collapse line="31" />
</Folding>
</File>
<File name="src\NonPlayerCharacter.cpp" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\CharacterAction.cpp" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\CharacterActionCause.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\NonPlayerCharacter.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="hgefont.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\CharacterActionCause.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\PlayerCharacter.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\PlayerCharacter.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="325" topLine="0" />
<Cursor1 position="210" topLine="0" />
</Cursor>
<Folding>
<Collapse line="18" />
<Collapse line="41" />
</Folding>
</File>
<File name="src\CharacterActionEffect.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="hgegui.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\SoDlib.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\hgeGUIMenuItem.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="288" topLine="0" />
</Cursor>
</File>
<File name="src\CharacterHotSpot.cpp" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="hgeguictrls.cpp" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\hgeGUIMenuItem.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
Expand All @@ -98,12 +89,12 @@
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="tinyxml.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\DebugDraw.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1368" topLine="32" />
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\DebugDraw.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="hgeanim.cpp" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
Expand All @@ -113,7 +104,7 @@
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\Animation.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="hgecolor.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
Expand All @@ -123,84 +114,98 @@
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\Character.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\Game.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="365" topLine="0" />
<Cursor1 position="21325" topLine="729" />
</Cursor>
</File>
<File name="src\Game.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\GroundLine.cpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6356" topLine="246" />
<Cursor1 position="2226" topLine="0" />
</Cursor>
</File>
<File name="include\CharacterAction.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="hgefont.cpp" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src\GroundLine.cpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\NonPlayerCharacter.cpp" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2517" topLine="77" />
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\CharacterActionCause.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="hgegui.cpp" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="370" topLine="0" />
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\CharacterActionEffect.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\PlayerCharacter.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="325" topLine="0" />
</Cursor>
<Folding>
<Collapse line="18" />
<Collapse line="41" />
</Folding>
</File>
<File name="hgeguictrls.cpp" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\CharacterHotSpot.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src\hgeGUIMenuItem.cpp" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\Construction.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="tinyxml.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="73" topLine="0" />
<Cursor1 position="1368" topLine="32" />
</Cursor>
</File>
<File name="include\DebugDraw.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\Animation.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\Exception.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\Character.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
<Cursor1 position="365" topLine="0" />
</Cursor>
</File>
<File name="include\GUIWindow.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\CharacterAction.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\Game.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\CharacterActionCause.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3470" topLine="78" />
<Cursor1 position="370" topLine="0" />
</Cursor>
</File>
<File name="include\GroundLine.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\CharacterActionEffect.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="484" topLine="0" />
<Cursor1 position="371" topLine="0" />
</Cursor>
</File>
<File name="include\NonPlayerCharacter.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\CharacterHotSpot.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\PlayerCharacter.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\Construction.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="210" topLine="0" />
<Cursor1 position="50" topLine="0" />
</Cursor>
</File>
<File name="include\SoDlib.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="include\DebugDraw.h" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="907" topLine="0" />
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="include\Exception.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>
5 changes: 3 additions & 2 deletions SoDlib/include/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Game
Character* loadPlayerCharacter(char * fn, b2Vec2 origin);
Character* loadNonPlayerCharacter(char * fn, b2Vec2 origin);
b2Fixture* loadFixture(b2Body* body, TiXmlElement* elem);
void addGroundLine(GroundLine* newGL); void addMapAnimation(MapAnimation* newMA);
void addGroundLine(GroundLine* newGL); void addMapAnimation(MapAnimation* newMA); void addPlatform(Platform* newPlatform);
void loadMap(char* fn);

int getCharactersCount();
Expand Down Expand Up @@ -93,7 +93,8 @@ class Game
hgeTriple whiteTriple;

GroundLine** groundLines; int groundLinesCount;
MapAnimation** mapAnimations; int mapAnimationsCount;
MapAnimation** mapAnimations; int mapAnimationsCount;
Platform** platforms; int platformsCount;
char** animationNames;
int animationsCount;
Character** characters;
Expand Down
20 changes: 20 additions & 0 deletions SoDlib/include/Platform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef PLATFORM_H
#define PLATFORM_H

#include <SoDlib.h>

class Platform
{
public:
Platform(Game* game, TiXmlElement* elem);
virtual ~Platform();
protected:
Game* game;
int groundLinesCount, animationsCount;
int* groundLines; int *animations;
int spotsCount;
float* spotX; float* spotY; float*spotAngle; float*spotTime;
private:
};

#endif // PLATFORM_H
Loading

0 comments on commit 5f2f330

Please sign in to comment.