6
votes
2answers
113 views

Better way to implement screen wraparound?

I'm implementing game with classical screen wraparound effect. It works very simple: if player goes out of screen, it reappears on the opposite side (Asteroids is a good example). This is my Java ...
15
votes
1answer
604 views

Blackjack Strategy

I am creating a Blackjack simulator in Java in order to better understand the language. I have written the basic strategy section for a player and it is terribly long. Is there a better way to do ...
10
votes
1answer
110 views

Good performance when predicting future game states

This question is about my answer to this king-of-the-hill challenge on Code Golf. In short, the purpose of the challenge is to code a slime that, trough various possible moves gains control over an ...
6
votes
3answers
717 views

Rock, Paper, Scissors Game in Java

I made a Rock, Paper, Scissors game and would like the code to be reviewed. Main class: ...
12
votes
4answers
154 views

Tic Tac Toe game in Java OOP

I have written a simple GUI Tic Tac Toe Application and since this is my first shot, I think it can be improved a lot. Please tell me what you think about it and what you see I made wrong so I can ...
11
votes
2answers
113 views

Dog owner simulator

I've just started programming and read a book called Head First Java. I thought it would be fun to make a training project that I can put all the stuff I learn into. Is the code I've written here ...
15
votes
3answers
574 views

Tool to calculate profitability of certain items in a game

I have created a tool that lets me calculate the profitability of doing certain actions in an MMORPG game which I play, it's more edging towards a quick-and-dirty solution than towards a neat solution ...
10
votes
5answers
569 views

Yahtzee game (using arrays and object classes)

As part of an assignment for my intro Java class (please bear with my beginner skill set), I'm working on a program for which a Die object class is used to play a Yahtzee game. An overview of the ...
11
votes
2answers
413 views

Inventory - how to handle items?

I've been designing a game server, where a player has inventory, bank, and other features with items. There are some definitions of what item can be in my game: Item is either stackable or not ...
4
votes
2answers
137 views

Generating possible Chess moves

Here is the solution to generating possible moves and keeping the king safe. If someone is willing to look it over and come with some suggestion to perhaps improve it, I would appreciate it. Full ...
6
votes
1answer
42 views

FuseMonsterAction implementation and unit tests

I'd like to get a general review on the following code, and I'll highlight an extra point below: ...
4
votes
1answer
417 views

MouseListener Lag in Piano Tiles game

I was attempting to write my own simple version of the Piano Tiles game app in Java just as a fun exercise. GameLogic.java ...
9
votes
1answer
159 views

Organizing code in small Mario game

I have a little Mario game I started working on realize that it's format is very messy, can anyone critique my code on how to make it better, faster, neater, easier to access. frame.java ...
7
votes
3answers
285 views

2048 game clone in Java

I made a 2048 game clone in Java for training, and I am trying to make it more efficient. The problem I found is the paintComponent() method always resets all the ...
10
votes
3answers
208 views

Solve the game “Flux”

The Program I wrote this program as an answer to a question I thought of for Programming Puzzles and Code Golf. To avoid cross-posting, I will only summarize the requirements: Solve a game in a 3x4 ...
5
votes
3answers
110 views

Orginizing/Optimising my collision detection setup

I'm creating a 2D tile based platformer with AABB (Axis aligned bounding boxes), and it works, I just want to organize and optimize my setup. Here are methods in my player class and entity class that ...
7
votes
2answers
77 views

SpellParser for a text-based RPG

Fellow students are supposed to review and tell what my code is doing for a grade, this is why I'm asking on here first. I want to see if its clear enough. ...
1
vote
1answer
93 views

MVC Layout - Which way to add listeners is better?

So I'm doing a basic MVC layout for a pretty basic game that I am making. The game requires the user to move up/down/left/right via buttons on the GUI. Since I'm using an MVC layout and my buttons are ...
4
votes
1answer
112 views

Winning Loop Connect 4

I am writing a fully functional single player Connect 4 game. I am working on the second player and the while loop that tells the player who won. GUI ...
5
votes
1answer
89 views

Improving speed of Animation class

This is a class to hold an animation and be able to refer to different animations by titles, but it seems like calling draw(Graphics2D g) and ...
7
votes
1answer
89 views

Interacting with GUI class and Main class

Usually when I make mock-up programs (like this one), I look for things I can improve on in case the situation happens again. Today I thought I'd brush up on basic OOP (I understand the concept of ...
6
votes
4answers
536 views

“Guess my number” game in Java Swing

Also posted at rgcsm.info/blog ...
20
votes
2answers
2k views

Pacman game implementation in Java

I assume you've all played Pacman, I mean, most people have. I am a 10th grader, and I am working on building Pacman for my intro to Java class in school. However, the project I'm working on ...
0
votes
1answer
64 views

Meteor-evasion game [closed]

I made a simple game which is pretty hard. I have a few problems though that I don't know how to solve: The high score mechanic doesn't work well and in general I don't really know how should I ...
10
votes
1answer
79 views

Trading Card Game's Hand and HandView implementation and unit tests

This question continues on my previous implementations of the Hand class of a Trading Card Game, earlier questions can be found here: Earlier model: Trading Card ...
8
votes
1answer
82 views

Trading Card Game's Hand and HandView implementation using composition and decoration

Building on the older building block, Trading Card Game's Hand class and tests, I decided it was time to implement a HandView, which can be implemented by a GUI ...
5
votes
1answer
76 views

Field class used by my trading card game

As many may know, I am developing a Trading Card Game for the Coding Challenge. I have just completed the Field class and have not used it in practice yet, so all ...
20
votes
9answers
2k views

Countdown Code: 'League of Legends'

I have written some code to track buffs as a side addition to the popular game League of Legends. My code is incredibly repetitive and I also have the issue of not being able to track multiple buffs, ...
10
votes
2answers
269 views

“Hangman” game follow-on

Last week I asked to review my "Guess a number" game in Java here I learned so much that I decided to try a little harder game and put into practice all the amazing feedback I received there. Would ...
2
votes
1answer
68 views

Kings Cup drinking game

I'm working on a card game in Java that simulates the drinking game Kings Cup for a school project. I'm having trouble putting the pieces together, and was wondering if someone could tell me what I ...
12
votes
3answers
228 views

Trading Card Game's Hand class and tests

As part of a Trading Card Game, I have created a Hand that will need to hold all cards that a player currently has in his hand. The code is built using Java 8. The ...
2
votes
1answer
58 views

Reading keyboard input

This is how I read the keyboard in my game: ...
10
votes
2answers
420 views

“Guess a number” game in Java

Would you please review and give me some feedback? I've been learning Java and I want to avoid bad practices. Is it good to make a helper class to define the methods my main program is using? Is ...
14
votes
4answers
1k views

First attempt at a Blackjack game

I am not happy with this code as I am sure there are better ways to do what I'm trying to achieve. I'm a beginner and I've used what I know to date to complete this. ...
7
votes
2answers
202 views

Cleaning up and commenting on my code for Pong game

This post is a follow-up to When should I consider the number of my method arguments too big? I took the some advice from previous post and I'm almost done with cleaning up the code. I didn't make ...
10
votes
1answer
323 views

When should I consider the number of my method arguments too big?

I'm writing a simple Pong game, I have a method bounce() that makes everything run: the ball, the paddles, score etc. and it uses 12 arguments: 3 counters, 2 ...
6
votes
2answers
77 views

Blocktastic optimisation

I have written the following code as the level rendering part of a game engine I am writing. I am very happy how it works but as it is the background / level graphics made up of individual blocks it ...
9
votes
3answers
167 views

Thinking outLoud conditional if statement vs. for statement

I have been working with java for a little more than a year. I recently have built a tic tac tow game as an assignment for my java class. After instructor graded it, he wrote a comment around my ...
10
votes
2answers
103 views

A Scoring approach to Computer Opponents

This code is starting to be used within several of my projects, and therefore I thought it's time to get it reviewed. Description The most common application for this code is that there is a ...
12
votes
1answer
167 views

Recursive and flexible approach to Tic-Tac-Toe

Description This is my code for the Weekend Challenge Reboot - Tic Tac Toe Ultimate. The game can be played here: http://www.zomis.net/ttt (along with some other variations that are also use the ...
9
votes
2answers
191 views

Basic Rock-Paper-Scissors implementation

So I decided to try to make a simple RPS implementation in Java 8, the following notes should be said first: At a later point it should support RPSLS aswell, as any other Gesture-game variant. At a ...
12
votes
3answers
521 views

Making additional subclasses at any time should be as painless as possible

I'm writing a small text-based game in Java to learn the language. I'm concerned that I may be making some poor design decisions. I'll introduce 2 elements: A character and monsters. A singleton ...
2
votes
1answer
527 views

Turning 1D array to 2D array in TicTacToe

To check a win in my TicTacToe game, I have created a 2D array that contains all the combination that a game can be won in, like so: ...
16
votes
5answers
2k views

Tic Tac Toe computer AI

I am creating a TicTacToe game for my college project, and when I finished the code for computer AI, I ended up with a big chunk of code. It allows the computer to make the winning move, stopping the ...
2
votes
1answer
60 views

Optimise my 2D game background block code

I have this code and wondered if anyone has any suggestion on how to optimise it to increase the speed. It draw blocks on the screen from a grid to make a background for my game. ...
6
votes
1answer
92 views

Finite Automaton for a Typing Game

I'm creating a game that implements a finite automaton and I don't know if I'm doing it right. Any advice? Game class ...
5
votes
1answer
126 views

Game Loop and FPS

Some time ago I made my simple game loop, so here's the code: ...
5
votes
2answers
121 views

API for Dungeon Generator

I am writing a ASCII dungeon creator inspired from games such as Angband, Moria etc. The main goal of the project is to allow a user to come along and implement their own "DungeonLevelGenerator" so ...
9
votes
2answers
376 views

AI bot Java dungeon game

I have written a script that allows a user to walk around a dungeon pick up gold and once they have picked it all up they can exit the game through an exit. What I am doing now is writing a bot to do ...
11
votes
3answers
1k views

Find longest sequence horizontally, vertically or diagonally in Connect Four game

I'm new to programming and also to Java and working on problems in Intro to Java by Robert Sedgewick. Here is my question: Connect Four: Given an N-by-N grid with each cell either occupied by ...