From d6c35e24c517ce86b682d65777133675d3a3f7c3 Mon Sep 17 00:00:00 2001 From: no Date: Thu, 27 May 2021 13:03:29 +0200 Subject: [PATCH] slight adjustmentson the inputbuffer --- GamePlay/input/InputBuffer.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/GamePlay/input/InputBuffer.java b/GamePlay/input/InputBuffer.java index 5225f9c..32e51fe 100644 --- a/GamePlay/input/InputBuffer.java +++ b/GamePlay/input/InputBuffer.java @@ -2,6 +2,7 @@ package input; public class InputBuffer { + private static final int numberOfInputs = 8; private static final Boolean[] baseInputs = {false,false,false,false,false,false,false,false}; /** @@ -31,16 +32,19 @@ public class InputBuffer { public InputBuffer() { this.size = 1; this.pos = 0; - this.inputList = new Boolean[1][8]; + this.inputList = new Boolean[1][numberOfInputs]; setLatestInputs(baseInputs); } public InputBuffer(int size) { this.size = size; this.pos = 0; - this.inputList = new Boolean[this.size][8]; + this.inputList = new Boolean[this.size][numberOfInputs]; - for(int i = 0; i < this.size; i++) {this.inputList[i] = baseInputs;} + for(int i = 0; i < this.size; i++) { + for(int j = 0; j < numberOfInputs; j++) { + this.inputList[i][j] = baseInputs[j];} + } }