From 03018a8e1dc32f484feb45cbc42944e6217e5276 Mon Sep 17 00:00:00 2001 From: Kenneth van Ewijk Date: Thu, 9 Jul 2015 20:57:27 +0200 Subject: [PATCH] Added timing per difficulty --- src/SMParser/SMParser.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/SMParser/SMParser.java b/src/SMParser/SMParser.java index a61f8e2..2854a2a 100644 --- a/src/SMParser/SMParser.java +++ b/src/SMParser/SMParser.java @@ -68,7 +68,7 @@ public class SMParser { for(String note:notes){ int direction = noteToDirection(note.trim()); if(direction != -1){ - if(time - lastNoteTime > 250){ + if(time - lastNoteTime > difficultyToButtonsTiming(difficulty)){ JsonObjectBuilder object = Json.createObjectBuilder(); object.add("time", time); object.add("direction", direction); @@ -162,8 +162,18 @@ public class SMParser { } - - + private int difficultyToButtonsTiming(String d){ + if(d.toLowerCase().equals("beginner")){ + return 500; + }else if(d.equals("easy")){ + return 250; + }else if(d.equals("medium")){ + return 200; + }else if(d.equals("hard")){ + return 150; + } + return 150; + } private int difficultyToMaxButtons(String d){ if(d.toLowerCase().equals("beginner")){