So I wonder if someone has any idea why my City game runs so much slower than my BlackJack game. The Blackjack game is a much bigger program, but runs smoothly. The City Game is much smaller, but I've had to increase the heap size to 4GB. (I've changed the file directories for confidentiality purposes, but kept the file types.)
Also, for the Black Jack Game, can someone tell me how to delay get the dealer hit cards to delay their display?
I've tried:
Timer timer = new Timer();
timer.schedule(new TimerTask() {
//first loop keeps any card from being dealt
public void run() {
hitSound();
}
}, 500);
methodology, which I got to work with the initial dealing of the cards.
I've also tried the TimeUnit.SECONDS.sleep(1); method and the Thread.sleep(1000); method, but I can't seem to get these to work.
I think I'm multi-threading now, and I couldn't quite figure that out in school.
The dealer card it starts in the while loop in the stand() method at line 772, then calls the dealerHit method at line 811.
Fast Program (City Game):https://pastebin.com/GCk2y8bx
Slow Program (Blackjack): https://pastebin.com/4sQ2TSe3