Browse Source

Version 23.11 (Grafics update)

master
David Moeckel 4 weeks ago
parent
commit
bd78af3b48
4 changed files with 76 additions and 17 deletions
  1. 28
    16
      .idea/workspace.xml
  2. BIN
      TrailBlue.png
  3. BIN
      TrailRed.png
  4. 48
    1
      src/main/java/GraphicsProgram.java

+ 28
- 16
.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="Version 20.11">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/GraphicsProgram.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/GraphicsProgram.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 name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="ProjectColorInfo"><![CDATA[{
"associatedIndex": 8
}]]></component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 8
}</component>
<component name="ProjectId" id="2p7Eq8ZJM8BEjLybOnAdhzZ82uv" /> <component name="ProjectId" id="2p7Eq8ZJM8BEjLybOnAdhzZ82uv" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" /> <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState"> <component name="ProjectViewState">
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent"><![CDATA[{
"keyToString": { "keyToString": {
"Application.GraphicsProgram.executor": "Run",
"Downloaded.Files.Path.Enabled": "false",
"Repository.Attach.Annotations": "false",
"Repository.Attach.JavaDocs": "false",
"Repository.Attach.Sources": "false",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true", "RunOnceActivity.ShowReadmeOnStart": "true",
"com.codeium.enabled": "true", "com.codeium.enabled": "true",
"git-widget-placeholder": "master", "git-widget-placeholder": "master",
"kotlin-language-version-configured": "true", "kotlin-language-version-configured": "true",
"last_opened_file_path": "C:/Users/david/Documents/Uni/GTCar/processing-4.3/core/library/core.jar",
"node.js.detected.package.eslint": "true", "node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true", "node.js.detected.package.tslint": "true",
"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.24022989",
"vue.rearranger.settings.migration": "true" "vue.rearranger.settings.migration": "true"
} }
}]]></component> }]]></component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-jdk-9823dce3aa75-28b599e66164-intellij.indexing.shared.core-IU-242.23726.103" />
<option value="bundled-js-predefined-d6986cc7102b-5c90d61e3bab-JavaScript-IU-242.23726.103" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
<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="758000" />
<workItem from="1732113837570" duration="5187000" />
</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="Version 20.11">
<option name="closed" value="true" />
<created>1732118799936</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1732118799936</updated>
</task>
<option name="localTasksCounter" value="3" />
<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="Version 20.11" />
<option name="LAST_COMMIT_MESSAGE" value="Version 20.11" />
</component> </component>
</project> </project>

BIN
TrailBlue.png View File


BIN
TrailRed.png View File


+ 48
- 1
src/main/java/GraphicsProgram.java View File

public class GraphicsProgram {
import processing.core.PApplet;
import processing.core.PImage;

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

public class GraphicsProgram extends PApplet {

PImage imgBlue;
PImage imgRed;

public static void main(String[] args) {
PApplet.main("Grafics");
}

public void settings() {
size(800, 600);
imgBlue = loadImage("TrailBlue");
imgRed = loadImage("TrailRed");
}

public void drawTrail(Queue<int[]> trail, int playerID){

int particleSize = 5;


background(255);

for (int[] koordinates : new LinkedList<>(trail)) {
int x = koordinates[0];
int y = koordinates[1];

if(playerID == 1){
image(imgBlue, x, y, particleSize, particleSize);
} else if (playerID == 2) {
image(imgRed, x, y, particleSize, particleSize);
}else{
fill(0, 255, 0);
rect(x, y, particleSize, particleSize);
}
particleSize ++;
}

}

public void drawEvent(){

}
} }

Loading…
Cancel
Save