Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d26d26d
adding submodule
chrisfoster121 Mar 4, 2022
8a3eafc
adding submodule
chrisfoster121 Mar 7, 2022
83c3959
removing sdl
chrisfoster121 Mar 7, 2022
a68eda0
adding allegro5 sumodule
chrisfoster121 Mar 7, 2022
86994db
making stuff show up on the screen
chrisfoster121 Mar 8, 2022
42fec18
cleaning up code with game class
chrisfoster121 Mar 8, 2022
4b8b533
removing commented code
chrisfoster121 Mar 8, 2022
1db4ff7
adding logic to host or join a game
chrisfoster121 Mar 9, 2022
be3ed6c
starting networking, code broken because socket library breaks with a…
chrisfoster121 Mar 10, 2022
8a8781f
fixing code, runs but host/join logic bugged
chrisfoster121 Mar 10, 2022
6004dc1
adding paddle state replication
chrisfoster121 Mar 12, 2022
fe23c6e
Working on project, got the ball working
iXiphos Mar 28, 2022
ae63a4c
Updating to have text
iXiphos Mar 29, 2022
31dca7d
Adding point system, updating collision
iXiphos Mar 29, 2022
2b571d1
fixed paddle & ball collisions
chrisfoster121 Mar 29, 2022
20d4a01
Adding a clean shutdown that shows which player won
chrisfoster121 Apr 1, 2022
01e8e42
adding 25% chance to drop a packet
chrisfoster121 Apr 8, 2022
bfc92ec
Started using UDP as unreliable, this means it has a chance to not send
iXiphos Apr 12, 2022
8d03777
Merge remote-tracking branch 'upstream/assignment3' into assignment3
iXiphos Apr 12, 2022
d66690b
adding comments and fixing compiler errors
chrisfoster121 Apr 15, 2022
e88fbb2
comments
iXiphos Apr 16, 2022
1065c09
Adding functions
iXiphos Apr 16, 2022
2fe5fce
Adding manager
iXiphos Apr 16, 2022
88b03da
working on sending sequence numbers and acks
chrisfoster121 Apr 16, 2022
49415ae
adding vcxproj
chrisfoster121 Apr 16, 2022
ea2aad3
New errors, however fixed precompliled headers
iXiphos Apr 17, 2022
4520c67
Fixed the compile issues
iXiphos Apr 17, 2022
0ea2b80
fixing error in Game::Send
chrisfoster121 Apr 17, 2022
43292cb
Added new class
iXiphos Apr 18, 2022
4ae1268
Fixing Build error(im dumb)
iXiphos Apr 18, 2022
cd37cf1
fixing function overriding, still more bugs
chrisfoster121 Apr 19, 2022
71b93aa
Fixing Includes
iXiphos Apr 19, 2022
588c422
Updating Override
iXiphos Apr 19, 2022
f5a1d5c
making output streams pointers
chrisfoster121 Apr 20, 2022
203e964
Game now lasts a bit longer, then fails
iXiphos Apr 21, 2022
0e55be9
Fixing packet sending
iXiphos Apr 21, 2022
f7978d9
more progress
iXiphos Apr 21, 2022
4e254cc
adding changes from office hours 4/21
chrisfoster121 Apr 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "allegro_wrapper_functions"]
path = allegro_wrapper_functions
url = https://github.com/adel-talhouk/allegro_wrapper_functions.git
[submodule "allegro5"]
path = allegro5
url = https://github.com/liballeg/allegro5.git
46 changes: 46 additions & 0 deletions RoboCat/Ball.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include "Ball.h"
#include <allegro5/allegro.h>
#include <allegro5/allegro_image.h>
#include <allegro5/allegro_acodec.h>
#include <allegro5/allegro_primitives.h>

ball::ball()
{

}

ball::ball(float movX, float movY, int r, ALLEGRO_COLOR c) :
mRadius(r),
mColor(c),
mDirX(movX),
mDirY(movY)
{

}

ball::~ball()
{

}

void ball::Render()
{
al_draw_filled_circle(pos->x, pos->y, mRadius, mColor);
}


void ball::SetMovementVector(float x, float y)
{
mDirX = x;
mDirY = y;
}

void ball::SetRadius(int r)
{
mRadius = r;
}

void ball::SetColor(ALLEGRO_COLOR c)
{
mColor = c;
}
38 changes: 38 additions & 0 deletions RoboCat/Ball.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#pragma once

#include <allegro5/color.h>

struct position {
float x, y;
};

class ball
{
private:
float mDirX, mDirY;
int mRadius;
ALLEGRO_COLOR mColor;

public:
ball();
ball(float movX, float movY, int r, ALLEGRO_COLOR c);
~ball();

position* pos;
int id;

void Render();

void SetMovementVector(float x, float y);
void SetRadius(int r);
void SetColor(ALLEGRO_COLOR c);

float GetPosX() { return pos->x; };
float GetPosY() { return pos->y; };

float GetDirX() { return mDirX; };
float GetDirY() { return mDirY; };

int GetRadius() { return mRadius; };

};
30 changes: 28 additions & 2 deletions RoboCat/Chapter3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@
<LinkIncremental>true</LinkIncremental>
<GenerateManifest>true</GenerateManifest>
<OutDir>Bin\$(Configuration)\</OutDir>
<Allegro_AddonImage>true</Allegro_AddonImage>
<Allegro_AddonTTF>true</Allegro_AddonTTF>
<Allegro_AddonFont>true</Allegro_AddonFont>
<Allegro_AddonPrimitives>true</Allegro_AddonPrimitives>
<Allegro_LibraryType>StaticMonolithRelease</Allegro_LibraryType>
<Allegro_AddonAudio>true</Allegro_AddonAudio>
<Allegro_AddonAcodec>true</Allegro_AddonAcodec>
<Allegro_AddonPhysfs>true</Allegro_AddonPhysfs>
<Allegro_AddonDialog>true</Allegro_AddonDialog>
<Allegro_AddonMemfile>true</Allegro_AddonMemfile>
<Allegro_AddonColor>true</Allegro_AddonColor>
<Allegro_AddonVideo>true</Allegro_AddonVideo>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|X64'">
<LinkIncremental>true</LinkIncremental>
Expand Down Expand Up @@ -127,8 +139,8 @@
<PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<AdditionalIncludeDirectories>..\SDL\include;Inc;..\</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
<AdditionalIncludeDirectories>..\allegro5\include\;Inc;..\</AdditionalIncludeDirectories>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>RoboCatPCH.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
Expand All @@ -141,6 +153,7 @@
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
<DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>./allegro5/include/</AdditionalLibraryDirectories>
</Link>
<Manifest>
<EnableDPIAwareness>true</EnableDPIAwareness>
Expand Down Expand Up @@ -370,6 +383,8 @@
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="Ball.h" />
<ClInclude Include="Game.h" />
<ClInclude Include="Inc\AckRange.h" />
<ClInclude Include="Inc\ByteSwap.h" />
<ClInclude Include="Inc\DeliveryNotificationManager.h" />
Expand All @@ -388,9 +403,14 @@
<ClInclude Include="Inc\Timing.h" />
<ClInclude Include="Inc\TransmissionData.h" />
<ClInclude Include="Inc\UDPSocket.h" />
<ClCompile Include="MyTData.cpp" />
<ClCompile Include="Src\AckRange.cpp" />
<ClCompile Include="Src\DeliveryNotificationManager.cpp" />
<ClCompile Include="Src\InFlightPacket.cpp" />
<ClCompile Include="Ball.cpp" />
<ClCompile Include="Game.cpp" />
<ClCompile Include="Paddle.cpp" />
<ClCompile Include="Score.cpp" />
<ClCompile Include="Src\Main.cpp" />
<ClCompile Include="Src\MemoryBitStream.cpp" />
<ClCompile Include="Src\OutputWindow.cpp" />
Expand All @@ -399,6 +419,9 @@
<ClCompile Include="Src\SocketUtil.cpp" />
<ClCompile Include="Src\StringUtils.cpp" />
<ClCompile Include="Src\TCPSocket.cpp" />
<ClInclude Include="MyTData.h" />
<ClInclude Include="Paddle.h" />
<ClInclude Include="Score.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Src\RoboCatPCH.cpp">
Expand All @@ -411,6 +434,9 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Font Include="OpenSans-SemiboldItalic.ttf" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\AllegroDeps.1.12.1\build\native\AllegroDeps.targets" Condition="Exists('..\packages\AllegroDeps.1.12.1\build\native\AllegroDeps.targets')" />
Expand Down
Loading