Click here to Skip to main content
15,886,095 members
Everything / Game Development

Game Development

game

Great Reads

by Marcelo Ricardo de Oliveira
A shoot'n'up HTML5 game made with Phaser game framework
by Adam David Hill
All the juicy tricks and scandalous shortcuts which helped us ship our competition game on time
by CMalcheski
Thinking outside the box can result in critical performance gains
by Petar Brkusanin
An example of how Decorator, Dependency Injection, and Composition Root patterns can be used to extend the base game functionality.

Latest Articles

by honey the codewitch
Display automated (optionally controllable) Tetris on an LCD or Neopixel panel
by Member 10912276
How to control game elements based on predefined conditions
by Jo_vb.net
This article and the demo are about getting started using my Schafkopf_OOP VB.NET project.
by KrirkDev
Kaldoku - a Sudoku like puzzle game

All Articles

Sort by Updated

Game Development 

1 Apr 2024 by KarstenK
As somebody already wrote: best is to hold the complete map (your background) as drawable image the whole game, so your drawing code may look similar like:void drawScreen(int x, int y) { if( isSomeCarAt( x, y ) { drawCar( x, y ); } else {...
31 Mar 2024 by steveb
Generally in a computer graphics smooth rendering is achieved by using a back buffer to which an image is drawn with subsequent BLIT (Block Image Transfer) into the Video memory. Drawing into the video memory directly results in visual anomalies...
30 Mar 2024 by merano99
To restore the background position, the old background can be saved with its position before it is overwritten by cars or players. As soon as the field is free again, the saved position can be restored. An alternative would be to use a copy of...
30 Mar 2024 by k5054
If I were doing this, I might be tempted to track the grid, the player and the car(s) separately, something like: struct position { int row, col }; struct position player; struct vehicle { char direction; struct position pos; }; // and...
30 Mar 2024 by DosNecro
/* Rasal Amarasurya */ /* 21304178 */ #include #include #include /* For malloc, free */ #include "game.h" /* Include the game header */ void initializeGame(char **grid, int rows, int cols, FILE *file, int...
29 Mar 2024 by DosNecro
/* Rasal Amarasurya */ /* 21304178 */ #include #include #include /* For malloc, free */ #include "game.h" /* Include the game header */ void initializeGame(char **grid, int rows, int cols, FILE *file, int...
29 Mar 2024 by merano99
CPallini is right! The comment in the source code says that the initializeGame() function should determine the player position. int playerRow, playerCol; /* Removed the initialization here as it's set in initializeGame */ However, the prototype...
28 Mar 2024 by CPallini
You failed to properly initialize playerRow, playerRow variables. Put a breakpoint at movePlayer function in order to see that live.
4 Mar 2024 by honey the codewitch
Display automated (optionally controllable) Tetris on an LCD or Neopixel panel
1 Mar 2024 by Member 10912276
How to control game elements based on predefined conditions
21 Feb 2024 by Patrice T
Quote: How do I prevent roads from disappearing when the player moves through them in a grid-based game? - C programming Replace /* Clear the player's previous position */ grid[*prevPlayerRow][*prevPlayerCol] = ' '; with /* Clear...
21 Feb 2024 by merano99
Obviously, according to the source code in movePlayer(), the roads do not play a role in relation to the player, as the player should be able to move through them. It is therefore background. This means that the previous state should be saved and...
20 Feb 2024 by OriginalGriff
Create a global variable called lastSurfaceType and initialise it to "road". When you move a player, set the square it is on to lastSurfaceType before you do the move, then set the variable to the type the player is about to move to. That way,...
20 Feb 2024 by DosNecro
I'm currently working on a grid-based game in C where I have roads represented by dots ('.') and a player represented by 'P'. The goal is for the player to reach the destination ('G'). However, I'm facing a challenge in keeping the roads visible...
16 Feb 2024 by Jo_vb.net
This article and the demo are about getting started using my Schafkopf_OOP VB.NET project.
4 Feb 2024 by KrirkDev
Kaldoku - a Sudoku like puzzle game
1 Feb 2024 by Orphraie
Study of 3D graphics in video games with minimal prior knowledge of mathematics
2 Jan 2024 by Jacques Fournier
SrcChess is a chess program built in C#
25 Dec 2023 by Peter Huber SG
Do you need a 10 minute break or want to do some mental warmup before programming? This free game is for you.
23 Sep 2023 by Christ Kennedy
A game to waste your hours
18 Aug 2023 by EgorYusov
This article introduces Diligent Engine, a modern cross-platform graphics API abstraction library and rendering framework
12 Aug 2023 by Mus_ 90YT
Hello there! So I’m new into making games, I’ve just done a fev python projects but never in any other software than html. Now I’m interested in creating games, and what better than start making a 2D Android game? So I’m just half copying a...
12 Aug 2023 by OriginalGriff
Spelling: it matters!public Transform spawnPoint; Vector3 spawnPos = spwanPoint.position;
12 Jul 2023 by EgorYusov
This article describes Unity low-level plugin interface and the Unity graphics interface emulator that facilitates native plugin development.
2 Jul 2023 by Sandeep Mewara
As error shares, you are calling a non-static item as a static. You can solve this by: Option 1: Have OceanE as static class such that you can directly access it's properties. This depends on the design choice. Option 2: Initialize OceanE...
2 Jul 2023 by Eric Taylor 2023
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering.HighDefinition; public class Floating : MonoBehaviour { public Rigidbody rb; public float depthBefSub; public float...
2 Jul 2023 by Graeme_Grant
I don't do Unity, however, that error in C# usually means that you have not initialised the class before using it. Somewhere in your code you need to create a reference: private OceanE oceanE; and then initialise it: OceanE = new oceanE(); ...
24 May 2023 by Mirzakhmet Syzdykov
Engine for .NET cross-platform development
2 May 2023 by Paayas Vaidya
I am trying to code the google dino game replica. I want to make the blocks or codes to be random heights. How to i do that? Here is the code I am using: HTML:
2 May 2023 by OriginalGriff
See here: JavaScript Math random() Method[^]
7 Apr 2023 by HardCoreHam
I'm trying to make it so each button, will display a "*" when you click on it and switch between player 1 and 2. But each time it click it returns the last button in the game and puts a "*" there. # create buttons button_dict = {} for y_pos...
5 Apr 2023 by ToughDev
How to play the classic MS-DOS game - Alley Cat - from your browser
3 Apr 2023 by Mike Hankey
Project like "Simon Says"
29 Mar 2023 by gggustafson
This article is the third and final in the Bingo Game Suite series.
27 Feb 2023 by gggustafson
Print_Cards to produce PDF file containing specified number of unique Bingo cards
27 Feb 2023 by dylan bryant
not all code paths return a value visual studio c#. I have for each if else and try catch statements in a while loop. I have been looking for hours and cannot find what its talking about. public static Player Load(out bool newP) { ...
27 Feb 2023 by RedImpAway
What if all loops and conditions fall through, you're not returning anything at the end?
26 Feb 2023 by OriginalGriff
Are you sure about this code? if (int.TryParse(data[1], out int id)) { foreach (Player p in players) { if...
26 Feb 2023 by dylan bryant
if (data[0] == "e" || data[0] == "exit") { break; } else { Console.WriteLine("Invalid selection"); } this section was throwing off the whole load scene i deleted...
24 Feb 2023 by merano99
The definition of the grid does not match at first sight: int** map char board[][SIZE] Since both row and col are specified by the user at startup, the constant SIZE will not work well either. int row_map = atoi(argv[1]); int col_map =...
24 Feb 2023 by DosNecro
#include #include // Constants for the map characters const char MAP_BORDER = '*'; const char PLAYER_CHAR = 'P'; const char GOAL_CHAR = 'G'; const char COLLAPSED_CHAR = 'X'; const char EMPTY_CHAR = ' '; int main(int argc,...
24 Feb 2023 by OriginalGriff
Your error description isn't helpful: we have no idea where the error is. If I had to guess, I'd say that from the indentation you have ended the main method too early - immediately above the for loop freeing up the memory. You should expect to...
20 Feb 2023 by gggustafson
In this first part, we look at the random arrangement of numbers on a player's Bingo card.
16 Dec 2022 by Alexon 2
Unfortunately, the library does not have a specific function for calculating the odds for multiple player holdings in a pot. However, you can use a combination of the library's functions to calculate the odds. For example, you can use the...
10 Dec 2022 by Adérito Silva
Introduction to XInputium — a full-featured open-source library for XInput integration in .NET games or applications.
4 Dec 2022 by Mirzakhmet Syzdykov
Overview of the strategy in turn-based MollyMage game
19 Nov 2022 by KristianEkman
An online Angular, .NET 7 Web API, SQL Server on Azure backgammon game
17 Nov 2022 by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
Unity Engine support for Electronic 2D game development
17 Nov 2022 by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
This work proposes the development of a Raycast engine in JavaScript to facilitate the 3D game development.
12 Nov 2022 by Eddie Winch
I have the following C# Code :- using System; using System.Collections.Generic; using System.Text; using System.IO; namespace Unpac { class Program { //_____________________________________________________________________ static...
12 Nov 2022 by Eddie Winch
Would this work for these parts of code for example ? :- switch(input_byte) { case when (input_byte >= 0x00 && input_byte
7 Nov 2022 by Eddie Winch
Hi there, I do understand the logic, and how to do switch Statements, but with 256 possible Hex Values all the combinations, of individual input_byte == would take a very along time to write. Can anyone help me, with a quicker way to do this ?...
7 Nov 2022 by Terence Wallace
A VB.NET implementation of a city-building game with real-time strategy elements.
4 Nov 2022 by OriginalGriff
There are a couple of things here ... Firstly, as Dave has explained this site is not a "code to order" site - we are here to help those that are stuck, not provide complete solutions. And as he says, with Freelancer et al you get what you pay...
4 Nov 2022 by Dave Kreskowiak
CodeProject is not a "for hire" site. Try Freelancer.com and get out your credit card. But be warned, you get what you pay for.
1 Nov 2022 by George Swan
I am not sure why you are using hex notation in your code. A 2 letter hex figure is simply a byte expressed in base 16 format. It is useful when using bit operatives because it displays a byte as 2 four bit nibbles. There is a technique for...
31 Oct 2022 by Richard MacCutchan
Use a switch block: switch (input_byte) { case 0xFF: // code for FF break; case 0xFE: // code for FE break; case 0xFD: // code for FD break; default: // code for all other values break; } [edit] Added the break statements;...
31 Oct 2022 by OriginalGriff
To add to what Richard says, you will also need break statements at the end of each set of case code: switch (input_byte) { case 0xFF: ... code for FF... break; case 0xFE: ... code for FE ... break; ...
17 Jul 2022 by Akshat Parmar
print("Let's play Stone(1), Paper(2), Sissors(3)") import random no=random.randint(1,3) if no==1: computer="stone" elif no==2: computer="paper" elif no==3: computer="sissors" print(computer) pla=int(input("It's your chance|1 for...
17 Jul 2022 by 0x01AA
See also the comments to the question. The problem is, that you evaluate with the variables player and computer (which hold the strings'Paper', 'Stone', 'Sissor') instead of no and pla.
17 Jul 2022 by Richard MacCutchan
Try this, and look carefully at the differences between player and pla, and computer and comp. Also the first if statement should use the and operator, not or. print("Let's play Stone(1), Paper(2), Sissors(3)") import random...
28 Jun 2022 by Pete O'Hanlon
Epic Games recently released Unreal Engine 5 and I thought it was time that I wrote a series about using Blueprints to show the power of UE5.
23 Feb 2022 by Eddie Winch
Hi there, I have the following two Codes which make up a DOS Game Graphics Image Extracting Program, written in C :- using System; using System.Collections.Generic; using System.Text; using System.IO; namespace Unpac { class Program { ...
6 Feb 2022 by AGC Retrogaming
I wonder if Commando and/or Street Fighter 1 or other games from thoses boards can be port to CPS1, do you think is possible? What I have tried: those games has base 68K and Z80 code, understanding.
6 Feb 2022 by OriginalGriff
There are a lot of problems there, starting with copyright and license T&C infringements, and leading up to "it's not just the processors that are totally different". Then there is the fun that games of that vintage for those processors are...
28 Jan 2022 by JavaApprentice
I am making a video game in Java and want to play an MP4. I am making a scene where I show the video as a tutorial on how to play. Are there any specific media APIs which I can look into? What I have tried: I have tried looking for some APIs. I...
28 Jan 2022 by Richard MacCutchan
Don't waste time on YouTube, their so called tutorials are rarely worth the time. Java has a fully featured sound package that you can make use of. See Trail: Sound (The Java™ Tutorials)[^]. Also, here is a quick and dirty sample: Java sound...
19 Jan 2022 by CPallini
It should work this way: your main should call the mainMenu function, which, in turn should call the appropriate game function. Probably, you have to revise your design.
19 Jan 2022 by codelearner3543
Doing a space invaders 2d game in pygame using pycharm. Got to a part where the ship moves correctly part of the time and then doesn't. don't know if it's the code or my computer. Moves correctly on KEYDOWN part of the time or have to press it...
19 Jan 2022 by CPallini
The problem is your code assigns letters (char data) to integers (int data type) so that letters are promoted to integers and shown accordingly. A quick fix: #include #include using namespace std; int main() { const int...
19 Jan 2022 by Tiến Dũng Đỗ
Hello So I'm making a simple memory card game on C++,but when I pick a slot, the card(which is a letter)doesn't reveal but instead it stays the same. Can someone tell me what is wrong with my code? Thank you in advance. Down here is my code. ...
19 Jan 2022 by OriginalGriff
Compiling does not mean your code is right! :laugh: Think of the development process as writing an email: compiling successfully means that you wrote the email in the right language - English, rather than German for example - not that the email...
19 Jan 2022 by OriginalGriff
Quote: can u plz write me the full code While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your...
24 Dec 2021 by Diasalva5
I have this Tic Tac Toe Game, it works fine, however I am player 1 and player 2, I am playing with myself. I have been trying to make the computer to be player2, and to be smart enough to block if player 1 (me) has two Xs or two Os in a row, but...
24 Dec 2021 by OriginalGriff
Start here: C# Tutorial – Create a Tic Tac Toe game and play against AI Opponent | Moo ICT – Project Based Tutorials[^]
21 Dec 2021 by biull smith
If such a request has already been asked, please accept my apologies. I looked for samples, read up on the player and monster classes, and player and monster stats on other sites, and nothing appeared to fit with the game's code without...
21 Dec 2021 by Gerry Schmitz
You need a "standard" / baseline for inflicting damage; then you vary the damage as the strength varies. e.g. One company (64 men), lying down, open formation, firing, can inflict a loss of 5, in one minute, on the party fired on under similar...
15 Dec 2021 by Diogo Rocha 2021
Hi guys im working on a example of a 4conector game i saw on a quick search. I want to insert the depth of the search tree (SEARCH_DEPTH), but im having some dificulties.This is a part of the code: BOARD_SIZE_X = 7 BOARD_SIZE_Y = 6 ...
15 Dec 2021 by Richard MacCutchan
You need to tell the playGame function that SEARCH_DEPTH is a global variable. Otherwise when it gets to the line SEARCH_DEPTH = int(input("What is your deep? ")) it creates a new local variable with that name, and ignores the one that is...
23 Nov 2021 by Raphael Mun
In this article, we explore packaging then deploying a game to Azure PlayFab servers.
29 Oct 2021 by Lemons and Giggles
i have two guns and two different functions for it. i want that gun to shoot which I have picked. but even other guns is shooting that I haven't picked so someone please solve this issue. public class weapon : MonoBehaviour { public...
4 Oct 2021 by Richard MacCutchan
See Unity Real-Time Development Platform | 3D, 2D VR & AR Engine[^]
4 Oct 2021 by CHill60
This question is so vague it cannot be answered in a Quick Answers forum. Do some proper research e.g. Search[^] and start coding. Come back if you have a specific question or specific problem
27 Sep 2021 by OriginalGriff
Don't post this under Quick Answers - if you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to...
25 Sep 2021 by Senthil Kumeresh
An overview of how the coding is done to solve the Sudoku problem
25 Aug 2021 by strangerick
Hello! I'm implementing a vertical scrollbar for a small game project and i'm having some issues with calculating local positions of the scrollbar Thumb and Content when the Viewport rectangle moves. At the moment, when i move the viewport, the...
25 Aug 2021 by Richard MacCutchan
// When the parent is resized, the scrollbar should be resized // to fit the new size of the viewport (excluding borders etc). // It is then just a matter of calculating the ratio of visible // data to the size the relevant dimension of the...
24 Aug 2021 by RickZeeland
The problem is probably caused because control coordinates are recalculated internally and have different values than you expect (depending on Windows scale and Font settings). See: Control.PointToScreen(Point) Method[^] And: Automatic Scaling -...
16 Aug 2021 by strangerick
Hello! I'm making a simple UI system for a small game that is going to be made using Windows Forms and drawn on a PictureBox. At the moment, i'm having some difficulty to implement a Scrollbar and need some help to solve two major problems as...
16 Aug 2021 by RickZeeland
Take a look at this CodeProject article: Custom Drawn Scrollbar[^]
16 Aug 2021 by OriginalGriff
Why are you reinventing the wheel? .NET has loads of controls that add toolbars as needed, as well as providing the ScrollBar Class (System.Windows.Forms) | Microsoft Docs[^] as a stand alone scrollbar ...