Browse Source

Grundstrukur

master
Paul-1108 1 month ago
parent
commit
93e39b11e3
6 changed files with 128 additions and 17 deletions
  1. 35
    6
      .idea/workspace.xml
  2. 0
    9
      pom.xml
  3. 40
    2
      src/main/java/GameLogic.java
  4. 4
    0
      src/main/java/GameLoop.java
  5. 35
    0
      src/main/java/Player.java
  6. 14
    0
      src/main/java/Tracker.java

+ 35
- 6
.idea/workspace.xml View File

<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="4d75e996-cee4-4ec6-b802-5b56d0c0eac4" name="Changes" comment="First Commit Test" />
<list default="true" id="4d75e996-cee4-4ec6-b802-5b56d0c0eac4" name="Changes" comment="Grundstrukur">
<change afterPath="$PROJECT_DIR$/src/main/java/GameLoop.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/GameLogic.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/GameLogic.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Player.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Player.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Tracker.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Tracker.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent"><![CDATA[{
"keyToString": { "keyToString": {
"Downloaded.Files.Path.Enabled": "false",
"Repository.Attach.Annotations": "false",
"Repository.Attach.JavaDocs": "false",
"Repository.Attach.Sources": "false",
"RunOnceActivity.ShowReadmeOnStart": "true", "RunOnceActivity.ShowReadmeOnStart": "true",
"com.codeium.enabled": "true", "com.codeium.enabled": "true",
"git-widget-placeholder": "master", "git-widget-placeholder": "master",
"node.js.selected.package.eslint": "(autodetect)", "node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)", "node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm", "nodejs_package_manager_path": "npm",
"project.structure.last.edited": "Project",
"project.structure.last.edited": "Libraries",
"project.structure.proportion": "0.15", "project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.0",
"project.structure.side.proportion": "0.41724136",
"vue.rearranger.settings.migration": "true" "vue.rearranger.settings.migration": "true"
} }
}]]></component> }]]></component>
<option name="number" value="Default" /> <option name="number" value="Default" />
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1732108904989</updated> <updated>1732108904989</updated>
<workItem from="1732108906083" duration="758000" />
<workItem from="1732108906083" duration="3420000" />
</task> </task>
<task id="LOCAL-00001" summary="First Commit Test"> <task id="LOCAL-00001" summary="First Commit Test">
<option name="closed" value="true" /> <option name="closed" value="true" />
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1732109548353</updated> <updated>1732109548353</updated>
</task> </task>
<option name="localTasksCounter" value="2" />
<task id="LOCAL-00002" summary="Second Commit Test">
<option name="closed" value="true" />
<created>1732109721570</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1732109721570</updated>
</task>
<task id="LOCAL-00003" summary="Grundstrukur">
<option name="closed" value="true" />
<created>1732109899753</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1732109899753</updated>
</task>
<option name="localTasksCounter" value="4" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="First Commit Test" /> <MESSAGE value="First Commit Test" />
<option name="LAST_COMMIT_MESSAGE" value="First Commit Test" />
<MESSAGE value="Second Commit Test" />
<MESSAGE value="Grundstrukur" />
<option name="LAST_COMMIT_MESSAGE" value="Grundstrukur" />
</component> </component>
</project> </project>

+ 0
- 9
pom.xml View File

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>


<dependencies>
<dependency>
<groupId>nu.pattern</groupId>
<artifactId>opencv</artifactId>
<version>2.4.9-4</version>
</dependency>
</dependencies>


</project> </project>

+ 40
- 2
src/main/java/GameLogic.java View File

public class GameLogic {
}
pu
Player
objekte
private Player player1 = new Player(0, 0);
private Player player2 = new Player(0, 0);

setUp()
// Playerobjekte
private Player player1 = new Player(0, 0);
private Player player2 = new Player(0, 0);

d set
{}()pU
iov etavirpleLogic gl = newmaG tatic void main(String[
{}sgra ])ic class GameLogic g
publ.run;
{
private void run(){
}
private void trackPlayer1(){
}
private void drawGrafics(){

}

private void trackPlayer2(){

}
private void checkPlayerCollission(){
}

}

+ 4
- 0
src/main/java/GameLoop.java View File

public class GameLoop {


}

+ 35
- 0
src/main/java/Player.java View File

import java.util.LinkedList;
import java.util.Queue;

public class Player { public class Player {
// Attribute für die x- und y-Koordinaten
private int id;
private int trailLength = 30;
Queue<int[]> trail = new LinkedList<>();

// Konstruktor zur Initialisierung der Koordinaten
public Player(int id) {
this.id = id;
}


//fügt 2 Koordinaten zum Trail hinzu und verhindert, dass dieser zulang wird
public void addToTrail(int x, int y){
this.trail.add(new int[]{x, y});

if(trail.size() > trailLength){
trail.poll();
}

}
public Queue<int[]> getTrail(){
return trail;
}


//gibt aktuelle Position aus
public void printPosition() {
System.out.println("Player Position: (" + x + ", " + y + ")");
}
} }



+ 14
- 0
src/main/java/Tracker.java View File

import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.Point;
import org.opencv.core.Size;
import org.opencv.videoio.VideoCapture;
import org.opencv.highgui.HighGui;
import org.opencv.imgproc.Imgproc;
import org.opencv.imgproc.Moments;
import org.opencv.videoio.Videoio;
import processing.core.PApplet;

import java.util.LinkedList;
import java.util.Queue;

public class Tracker { public class Tracker {
} }

Loading…
Cancel
Save