For questions requesting reviews of game-themed code.

learn more… | top users | synonyms

4
votes
1answer
47 views

Tic-Tac-Toe game using the minimax algorithm

I have written a Tic-Tac-Toe game in Python that contains, among others, a player that uses the minimax algorithm. I am not exactly a beginner at Python, but I'm not very experienced with it - so I ...
12
votes
4answers
441 views

Voxel-based chunk manager

I'm creating a voxel-based game and have been working on it for quite a while. I've come to a point where I have to load and unload chunks on the fly. I've created a chunk manager class and it's ...
7
votes
3answers
108 views

Hangman game in Java

I'm hoping someone can look over my code and tell me if there is anything I can improve. I am not very experienced with Java so I am hoping for some feedback as to avoid developing any bad habits ...
5
votes
2answers
56 views

Determining vehicle jump landing quality

I am writing a game where a car drives and makes jumps. When a jump is landed, the player is rewarded if they land all four wheels either at the same time, or near to the same time. If they don't, ...
3
votes
1answer
40 views

Factory Class for Game World

The world in my strategy game is comprised of a number of towers. At the start of the game, only one tower is generated, and when the player discovers new towers they are created and added to the ...
-1
votes
0answers
29 views

Class to manage the states of the game [closed]

I'm developing a simple java game and i have written a class to manage the states of this game. Every level is a state, same for game over and the main menu. I get a strange behavior in this ...
6
votes
3answers
118 views

Memory text based game

Would anyone be so kind as to review my code for Memory? ...
15
votes
1answer
184 views

Javascript Minesweeper (with Stack Snippets!)

As Stack Snippets are live on Code Review now, I wanted to do something quick in it as part of rolfl's challenge on meta. And when you make things quick, they probably get dirty. And when things get ...
26
votes
3answers
945 views

Voxel World Optimization

This is not related to a Minecraft clone. I am currently writing a turn-based strategy game like Final Fantasy Tactics. The game is played on floating voxel-style islands, which are generated from ...
7
votes
4answers
161 views

Memory usage in Reversi board state

I'm coding a Reversi game, with an artificial intelligence using the MinMax as the search algorithm. My concern is that (most) search algorithms needs to store a lot of instances of "states", in my ...
3
votes
1answer
44 views

Complex Conditionals in a Strategy Game

I have been looking at this method for a long time and I have finally refactored it into something that I believe is much more readable. I am not totally happy with it though so I would like to get ...
3
votes
1answer
43 views

Madlibs Program

I just started to learn Python, and wrote this Madlib program that works the way I intended it to, so I do not need help debugging, just some advice on tips to improve the code or make it simpler. ...
11
votes
2answers
123 views

Trading Card Game Prototype GUI with JavaFX

Most of my programming experience is with Objective-C, but I have recently started learning Java and JavaFX to build the user interface for a Trading Card Game. This is the most Java I have ever ...
3
votes
2answers
79 views

Cleaner structure for Battleships code

The code provided is working fine, but I would like to see if there is room for improvement for the code provided: ...
2
votes
2answers
70 views

Rock-Paper-Scissors in procedural and object-oriented

I am comfortable with the procedural style, and learning the object oriented, so I have done a small Rock Paper Scissors game in both styles. This script is in procedural style and this one is in ...
9
votes
2answers
109 views

RPG game shop system

I'm interested in the organization, layout and style of how I program. How does organizing code using whitespace work? I've had a go in the code below. I mean like when you press tab and start the ...
12
votes
8answers
1k views

Increase difficulty based on score

What I'm trying to do is very straightforward and easy, but I am wondering whether there is a more elegant solution. Basically I have a game and I want the difficulty to increase the moment the ...
4
votes
0answers
39 views

Pong game built on a minimal entity component system

This simple game is built on the ECS described here: Minimal entity component system, take 2 ...
6
votes
2answers
68 views

Reorganize a maze game from one large class into smaller classes

I'm new to Java and I really don't understand how to make more classes work like one. So if anybody could explain and help me divide my large code into smaller classes (like Player.java, Main.java, ...
7
votes
1answer
131 views

Cheese-Burger-Waffles (aka Rock-Paper-Scissors)

FizzBuzz was fun, and I got great feedback and learned a few things (which I hope I put in practice here), but only scratched the surface. I wanted to explore the LOLCODE language a bit more, so I ...
6
votes
1answer
67 views

HTML5 Tic-Tac-Toe game

I created an HTML5/JS tic-tac-toe game as an exercise and wanted some advice on my js code. A couple of questions: How can I improve the reset method? (currently reloads the page/re-initializes ...
6
votes
1answer
73 views

Adding Abilities to Cards Dynamically in a Trading Card Game

I have figured out how to pass functions around in Lua, and I am using the technique of inserting functions into tables in order to dynamically assign functions to the cards in a trading card game. ...
10
votes
2answers
518 views

Does my Game class have too many responsibilities?

I've been working on a game so as to fill out something that I can put on a CV and I was writing the main Game class. This shouldn't be a god class, but it should ...
1
vote
0answers
40 views

Creating New Scripts Dynamically in Lua [migrated]

Right now this is just a crazy idea that I had, but I was able to implement the code and get it working properly. I am not entirely sure of what the use cases would be just yet. What this code does ...
10
votes
3answers
198 views

Scorekeeper for a game

The code is not for any project, I just want to know the best coding practices. The code is also on GitHub. ...
5
votes
1answer
39 views

Scripts loading Scripts Dynamically in Lua

I have been working with Lua lately and I have discovered that it is capable of doing some very interesting things. I have created a proof of concept that allows one Lua script to load another Lua ...
-1
votes
1answer
49 views

Game LevelManager Memory Leak? [closed]

I have a level manager for my game I'm working on, and it's supposed to unload the previous level, and then load the next level. However, when I test it (though I'm not sure I'm testing it right) the ...
10
votes
1answer
660 views

Battle a random enemy

I am trying to write a text adventure as my first Python project. For this segment, I wanted a random enemy (part of a class with its own attributes) to appear and then enter a turn based battle with ...
11
votes
3answers
521 views

2D tilemap collision method

Is this the optimal method to check for collisions in a 2d-based game? I put together a working demo of 2D collisions here (WSAD to move, orange blocks collide). I currently use the following code ...
8
votes
1answer
65 views

Basic Game Model in Scripting Language

I've been working with Lua for a little bit, and I have finally come up with some code that can be extended to create the core of a game model. I come from an object oriented background, so working ...
10
votes
3answers
527 views

Console Blackjack game

What do you think the weak points are and how can I improve? I thought I could really use a Hand class in the dealHand method. ...
4
votes
2answers
56 views

GameLoop with requestAnimationFrame

I am creating a HTML game where you fight monsters and stuff and this is part of the game loop for dealing damage: ...
4
votes
2answers
98 views

How is my Game Loop?

I wrote a game loop for a game I'm going to be making: Check the current FPS Try the keep the FPS to a hardcoded level Draw and Update the game. There are two classes, the abstract class and the ...
4
votes
1answer
55 views

Downloading and Loading Remote Game Assets

On advice from an answer to my previous question, I have written some code that will allow my game balance properties to be loaded from a remote server. Right now I am just hosting the raw property ...
4
votes
1answer
182 views

If-statement consolidation

I often face the problem of stacked if-statements that look repetitive, but usually can't find an easy way to simplify it. ...
3
votes
1answer
48 views

Game Balance and where to store Variables

I have been thinking about this aspect of my game for a little while, and I have come up with the following solution. I am sure that there are problems with the way I have implemented it so any kind ...
5
votes
3answers
246 views

Simple “arrow-throwing” console game

I'm trying to make a simple console application game. The code is a bit messy and I hope anyone can point out anything wrong. ...
4
votes
1answer
64 views

Game Achievements without Singleton

This is my first time implementing achievements in a game so I could definitely use some feedback on what I have done here. I have heard about singleton approaches to this problem, but I did not feel ...
6
votes
1answer
115 views

Full clone of the game Pengo

Use these links to understand the code I'm posting below since although it looks like PHP it is not: Function Reference Language Reference I have been making a programming language for some time ...
8
votes
1answer
91 views

Dungeon generation in Scala

I've recently begun learning Scala, and while I've run into its concepts before (immutability, tuples, first-class functions) I'm not sure whether I'm using the language how it's supposed to be used. ...
8
votes
2answers
150 views

Bowling game scorer

I was given a simple coding exercise as part of a job interview process, for which I received a negative review. This is the question: DiUS is starting a bowling club. To help with the club, we ...
2
votes
1answer
102 views

Isometric Chunk Game

I'm trying to create an Isometric Game in JavaScript. I think the code is pretty good, but I'd like to know if there is something to improve. ...
7
votes
3answers
165 views

Trading Card Game Prototype in OOP

So I am sure there are better ways to set this up, but I wanted to see how something like this would work in Objective-C, so I went ahead and built a prototype of a Tradeable Card Game. I've never ...
1
vote
1answer
86 views

Breaking memory game code into MVC form

I am currently coding a memory game whereby upon the game starts with 14 cards displayed faced down. The player will start by clicking on 2 cards. The cards will be revealed. If both of the card ...
6
votes
5answers
643 views

Petals Around the Rose

I have been working on a program that walks you through "Petals Around the Rose". I would like anyone to review it and point out any bad coding practices, as well as efficiency problems. ...
2
votes
3answers
103 views

Basic terrain generator

I've decided to try and start programming using Object-Oriented-Programming, so I built a small terrain generator that could be done using something as simple as this: ...
4
votes
1answer
82 views

Trying to grasp OOP Rock, Paper, Scissors program

I'm trying to wrap my head around OOP but so far I feel like I'm just moving functions into classes and calling them methods. I am trying to create a "Rock Paper Scissors" game using OOP best ...
4
votes
4answers
96 views

Index mechanics for Rock Paper Scissors

I just went through a very easy online example creating a Rock-Paper-Scissors game, but it seemed like it was not a great use of computing power. It seemed like I was writing out results for every ...
7
votes
2answers
83 views

Ability Cards that trigger Game logic

I want to ask this question because I have been thinking about it for a while and I haven't discovered a solution that I am very happy with. When coding games, I've frequently run into the situation ...
4
votes
2answers
151 views

Python Hangman Console

I'm quite new to Python and have been experimenting. So far I have made a simple hangman type game which creates a random word and the user than guesses it. I'd like to know if I've committed any bad ...