0
votes
0answers
26 views

Android game high score implementation

I did a tutorial for game development for android. I was wondering how i would implement a high score for local use or even just make it view and save after? Heres the Gamescreen.java code for a basic ...
3
votes
0answers
84 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
39 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
247 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
144 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
253 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
203 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
106 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 ...
6
votes
2answers
72 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
87 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
107 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
88 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
87 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
499 views

“Guess my number” game in Java Swing

Also posted at rgcsm.info/blog ...
20
votes
2answers
1k 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
56 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
71 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
72 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, ...
9
votes
2answers
264 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 ...
1
vote
1answer
55 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
203 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
382 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
198 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
320 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
161 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
102 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
145 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
185 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
513 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
408 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
58 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
84 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
115 views

Game Loop and FPS

Some time ago I made my simple game loop, so here's the code: ...
5
votes
2answers
117 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
356 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 ...
6
votes
1answer
377 views

Tower of Hanoi solver

Requesting code review, best practices, optimizations for this solution to the Tower of Hanoi problem. ...
15
votes
5answers
3k views

Tic-tac-toe 'get winner' algorithm

As a first step to attempting the Weekend Challenger Reboot, I decided to first implement a regular 'tic-tac-toe' game and then expand it later to be 'ultimate tic-tac-toe'. Below is the code for the ...
10
votes
3answers
737 views

Basic bingo game in Java

I've recently wrote a simple bingo game in Java to refresh myself in oop principals I have not touched in quite a while. I feel like I have accomplished this, but I would like to learn as much as ...
19
votes
6answers
5k views

Guessing a unique 4 random digits number

I've created a simple game, in which the user needs to guess 4 digits number between 0-9, generated randomly using Random() Each of the 4 digits are different from ...
4
votes
3answers
160 views

Turn-based game setting properties for playcards

I am programming with Java (server side) and JavaScript a card game and I do not know how to give properties (on server side) to every card that I create. For a match I need 20 different cards from a ...
22
votes
6answers
6k views

“Guess a number” game

I began the journey to be a self-taught programmer about a month ago and my biggest fear about teaching myself is developing bad habits and not realizing it. I'm looking for criticism on this "Guess ...
-2
votes
2answers
700 views

Trivia game in Java [closed]

I have been given this piece of code to refactor. I have refactored it, but I am not sure whether I missed something on refactoring. Maybe someone has a better idea. Here is the given un-refactored ...
3
votes
1answer
171 views

Complete Hangman game

I would like to improve code readability and reduce the complexity of my code to improve the maintainability of the source code. If you have any tips, please say so. I was also wondering if it would ...