Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bf7de8f28 | ||
|
|
d4cf18dfcd | ||
|
|
41845f8b1d | ||
|
|
0f42ef18d0 | ||
|
|
2fd3ee5870 | ||
|
|
59f4d6b3af |
+21
@@ -1 +1,22 @@
|
||||
# ===== Build =====
|
||||
cmake-build-*/
|
||||
build/
|
||||
out/
|
||||
|
||||
# ===== IDE =====
|
||||
.idea/
|
||||
*.iml
|
||||
|
||||
# ===== OS =====
|
||||
.DS_Store
|
||||
|
||||
# ===== Compiled =====
|
||||
*.o
|
||||
*.obj
|
||||
*.a
|
||||
*.so
|
||||
*.dylib
|
||||
*.exe
|
||||
|
||||
# ===== Logs =====
|
||||
*.log
|
||||
|
||||
Generated
-8
@@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
Generated
-4
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings" defaultProject="true" />
|
||||
</project>
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
+4
-3
@@ -27,12 +27,13 @@ target_include_directories(Prog3B PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/includes
|
||||
${CMAKE_CURRENT_LIST_DIR}/raylib
|
||||
)
|
||||
target_link_libraries(${EXECUTABLE_NAME} PRIVATE
|
||||
#${CMAKE_CURRENT_LIST_DIR}/windows/libgamematrix.a
|
||||
${CMAKE_CURRENT_LIST_DIR}/mac_arm/libraylib.a
|
||||
|
||||
target_link_libraries(${EXECUTABLE_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/mac_x86/libgamematrix.a
|
||||
raylib
|
||||
)
|
||||
|
||||
|
||||
# Checks if OSX and links appropriate frameworks (Only required on MacOS)
|
||||
if (APPLE)
|
||||
target_link_libraries(Prog3B PRIVATE "-framework IOKit"
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
<<<<<<< HEAD
|
||||
#include "gamecube.h"
|
||||
=======
|
||||
#include "raylib.h"
|
||||
#include "gamecube.h"
|
||||
#pragma once
|
||||
|
||||
|
||||
>>>>>>> 5fc4346 (funktioniert, 3 oder 6 + Timer komplett)
|
||||
|
||||
gamecube::gamecube(const Vec3 &pos, Color col)
|
||||
: position(pos), color(col) {}
|
||||
@@ -63,4 +71,9 @@ void gamecube::Draw() const
|
||||
}
|
||||
|
||||
Vec3 gamecube::GetPosition() const { return position; }
|
||||
<<<<<<< HEAD
|
||||
float gamecube::GetRotationY() const { return rotation; }
|
||||
=======
|
||||
float gamecube::GetRotationY() const { return rotation; }
|
||||
|
||||
>>>>>>> 5fc4346 (funktioniert, 3 oder 6 + Timer komplett)
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
<<<<<<< HEAD
|
||||
//
|
||||
=======
|
||||
|
||||
//
|
||||
>>>>>>> 5fc4346 (funktioniert, 3 oder 6 + Timer komplett)
|
||||
// Created by bakee on 03.11.2025.
|
||||
//
|
||||
#include "gamematrix.h"
|
||||
@@ -94,4 +99,8 @@ namespace Matrix3D
|
||||
return {res_hom[0], res_hom[1], res_hom[2]};
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
=======
|
||||
}
|
||||
>>>>>>> 5fc4346 (funktioniert, 3 oder 6 + Timer komplett)
|
||||
|
||||
@@ -258,6 +258,7 @@ int main()
|
||||
}
|
||||
|
||||
// Klick-Erkennung
|
||||
<<<<<<< HEAD
|
||||
if (!gameWon && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
|
||||
{
|
||||
Vector2 mouse = GetMousePosition();
|
||||
@@ -268,6 +269,50 @@ int main()
|
||||
Vector2 screenPos = GetWorldToScreen({c.GetPosition().x, c.GetPosition().y, c.GetPosition().z}, camera);
|
||||
if (fabs(mouse.x - screenPos.x) < 40 && fabs(mouse.y - screenPos.y) < 40)
|
||||
c.FlipForward();
|
||||
=======
|
||||
// Klick-Erkennung (nur wenn noch nicht 2 ausgewählt sind)
|
||||
if (!gameWon && IsMouseButtonPressed(MOUSE_LEFT_BUTTON) && (second == nullptr))
|
||||
{
|
||||
Vector2 mouse = GetMousePosition();
|
||||
Ray ray = GetMouseRay(mouse, camera);
|
||||
|
||||
gamecube* hitCube = nullptr;
|
||||
float bestDist = 1e9f;
|
||||
|
||||
for (auto &c : cubes)
|
||||
{
|
||||
if (c.IsMatched() || c.IsFlipped()) continue;
|
||||
|
||||
|
||||
|
||||
|
||||
auto p = c.GetPosition();
|
||||
|
||||
|
||||
BoundingBox box;
|
||||
box.min = { p.x - 0.75f, p.y - 0.75f, p.z - 0.75f };
|
||||
box.max = { p.x + 0.75f, p.y + 0.75f, p.z + 0.75f };
|
||||
|
||||
RayCollision col = GetRayCollisionBox(ray, box);
|
||||
if (col.hit && col.distance < bestDist)
|
||||
{
|
||||
bestDist = col.distance;
|
||||
hitCube = &c;
|
||||
}
|
||||
}
|
||||
|
||||
if (hitCube)
|
||||
{
|
||||
if (!first)
|
||||
{
|
||||
first = hitCube;
|
||||
first->FlipForward();
|
||||
}
|
||||
else if (hitCube != first)
|
||||
{
|
||||
second = hitCube;
|
||||
second->FlipForward();
|
||||
>>>>>>> 5fc4346 (funktioniert, 3 oder 6 + Timer komplett)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -276,6 +321,7 @@ int main()
|
||||
for (auto &c : cubes)
|
||||
{
|
||||
c.Update(flipSpeed);
|
||||
<<<<<<< HEAD
|
||||
if (c.IsFlipped() && !c.IsMatched())
|
||||
{
|
||||
if (!first) first = &c;
|
||||
@@ -285,6 +331,13 @@ int main()
|
||||
|
||||
// Matching-Logik
|
||||
if (first && second)
|
||||
=======
|
||||
}
|
||||
|
||||
// Matching-Logik
|
||||
// Matching-Logik: erst wenn beide vollständig umgedreht sind
|
||||
if (first && second && first->IsFlipped() && second->IsFlipped())
|
||||
>>>>>>> 5fc4346 (funktioniert, 3 oder 6 + Timer komplett)
|
||||
{
|
||||
Color col1 = first->GetColor();
|
||||
Color col2 = second->GetColor();
|
||||
@@ -299,7 +352,13 @@ int main()
|
||||
first->FlipBackward();
|
||||
second->FlipBackward();
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
first = second = nullptr;
|
||||
=======
|
||||
|
||||
first = nullptr;
|
||||
second = nullptr;
|
||||
>>>>>>> 5fc4346 (funktioniert, 3 oder 6 + Timer komplett)
|
||||
}
|
||||
|
||||
// Gewinnprüfung
|
||||
|
||||
Reference in New Issue
Block a user