Game Programming

Game programming is the software development of video games. Game programming requires substantial skill in software engineering as well as specialization in simulation, computer graphics, artificial intelligence, physics, audio programming, and input. Like other software, game development programs are generated from source code to the actual program by a compiler. Source code can be developed with almost any text editor, but most professional game programmers use a full integrated development environment (IDE).

Share tech news, updates, or what's on your mind.

Sign up to Post

For my Python RTS / MOBA server,

I am at a decision where I should either make a class for reading UDP activity updates from the clients over TCP activity ( a failsafe)
Should I have a UDPlistener class and a TCPlistener class?
or should I have a packetListener class with a UDPlisten method and  also, a TCPlisten method? - that are each made into Threads?
I think an all-in-one approach would make linking into the game smoother?

both would work, but which would look best? Is Python better suited to one?

When my dad saw this claim, attached JPG, seemingly from my website trademark managers, he said he thought it looked like a scam.
I thought it was plausibly, possibly legit, but bec I'm not doing the website anymore, I was disinclined to care. Im not paying another $2,000 into this thing.
Did some Nigerians find my domain info and send me this bill? I already paid all the bills they said I'd need to pay. I was concerned about being fined.

Is this sheet some kind of phishing scam? It looks like a standard commercial building in Manhattan.  (244 Madison Realty Corporation (glotrade)

I don't remember the glotrade name. I'm a hawk on scam scents now after being taken before. I'm not paying it. I'll send Luca Brasi, or Joe Pesci up there to explain it to for me.
I am not certain if League of Legends is an RTS type network server, or an FPS? The player movements are well spaced out, so I'd think RTS

In Summoner's rift, is it only 5 people/champions playing? Is that the practical limit on players, in most network games?

If I port my working Java RTS server that I finished a little while ago to Python, could I expect any performance shift? It is TCP messaging, with UDP duplicates sent afterwards for speed.

In all my Java games, I have used code like :
public static int STAR_TYPE_RED_DWARF=1
public static int STAR_TYPE_WHITE_DWARF=2
public static int STAR_TYPE_BLUE_GIANT=3
public static int STAR_TYPE_SUPER_GIANT=4
and many more game object constants

What is the best way to replicate this in python, so these constants are automatically associated with its object when writing code?
I haven't seen anything like this yet

My Python RTS server reboot from my finished Java one needs some clarifications.

The example networking code at this Python page doesn't work, when it clearly should, code below


The line with bind() is where it raises exceptions and it's baffling me! - cut and paste!
My code that won't compile is...
import socket, sys

if __name__ == "__main__":



        # Create a TCP/IP socket
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

        # Bind the socket to the port
        server_address = ('localhost', port_num)
        print ('starting up on %s port %s', server_address)


Open in new window

Did I miss a step in pyCharm settings?

I am trying to create a 2D board game.  To move a game piece, you click on the game piece to select it, then move the mouse to the square you want the piece to move to.

I am wanting to draw a "path" as the mouse moves to the potential destination square, showing which squares the piece will move to, taking into account any obstacles the game piece will need to navigate around.

The part I am struggling with most is how to draw the path line.  For example, the line will look different based upon the game piece moving SOUTH (indicated in blue) vs moving EAST (indicated in red).

[NOTE:  I am not sure what this is called in gaming circles (the shape of the lines themselves).  Is it called aliasing?  Anti-aliasing is supposed to "smooth"-out the "jagged" stair-step look of the lines formed (lines drawn at an angle, or circles).  I know that the letters I am typing, when zoomed up to like 800% of normal size appear very jagged. ]

I am just wondering what the algorithm is called and where I might go for help on this (including here on EE, of course).

All the best modern games are pseudo 3D, like League of legends and Starcraft 2.

Is it pseudo 3d? - It is 2D images used smartly at correct locations?

How do Starcraft 2 and League of Legends achieve their 3D feel?

Would Python be able to do decent game-play FPS & updates in time with my client networking class?
MIT and everyone is teaching CS100 in Python, and I've seen some promising 2D demos.
Considering the RTS project many of you helped me complete,

Java had no problem being an abstract base class client engine,
and the JFrame was smooth.
Will a Python GUI do adequately with a client engine abc ? The abstract method can update a GUI's objects. Will I need to do double buffering on a GUI?
Could I make a Python effort approach  League of Legends quality? I'm keeping the server in Java, but the client abc will be ported to Python.

I've been playing League of Legends with no problems,
and all of a sudden it gets into this 'Attempting to reconnect' mode at the re-spawn altar after my champion gets served
and the game is essentially locked and I cant move my primary dude. I can move the camera, but not my champion.

Is that something I did wrong in my game-play?

Hi I am trying to get my games to output the current time in seconds that the game is running for as a score for the player in the canvas but I keep getting an undefined var instead of the number?

Does anyone have any idea whats wrong with my code??

Thanks, See code below.

HTML5 Canvas
var Game = {
    canvas : undefined,
    ctx : undefined,
    backgroundImage : undefined,
    backgroundMusic :undefined,
    soundImage: undefined,
    soundImagePosition : { x : 750, y : 10 },
    vy : 0,
    rocket : undefined,
    rocketPosition : { x : 350, y : 400 },
    dxSpeed: 7,
	dySpeed: 3,
	keyboard : { keyDown : -1 },
	keys : {
    A: 65,     B: 66,      C: 67,      D: 68,       E: 69,      F: 70,
    G: 71,     H: 72,      I: 73,      J: 74,       K: 75,      L: 76,
    M: 77,     N: 78,      O: 79,      P: 80,       Q: 81,      R: 82,
    S: 83,     T: 84,      U: 85,      V: 86,       W: 87,      X: 88,
    Y: 89,     Z: 90, 	   LA:37,      UA:38, 	    RA:39,      DA:40,

function handleKeyDown(evt) {
    Game.keyboard.keyDown = evt.keyCode;

function handleKeyUp(evt) {
    Game.keyboard.keyDown = -1;

Game.start = function () {
    document.onkeydown = handleKeyDown;
    document.onkeyup = handleKeyUp;

    Game.canvas = document.getElementById("myCanvas");
    Game.ctx = Game.canvas.getContext("2d");

    Game.backgroundMusic = new Audio();
    Game.backgroundMusic.src = "assets/audio/start.mp3";

Open in new window


If I put my keyboard listening in pygame in my drawing/game loop, it obviously won't be checked constantly.
I must obviously have a Thread listening for keyboard input, mouse movement to play my game and update internal game variables.

Is this just a new class I must make with two methods each to listen to pygame keyboard/mouse activity. Case closed?


If Python can be run in a browser,

Will my RTS client's game window be playable? - how? - browser window? - in its own window?
It looks like printf's are written to the browser window, but will Threading occur normally?
I'll keep my invulnerable RTS server in Java. And do a client in pure Python now. Will it be as good as in Java?

Someone has pics for me on photo bucket.
Do I have to pay? it seems so.

Is this a legit site? I am sick of scams

Python array/list instantiation, import and other declarations are confusing me!

In my code attached, I have a main class for holding the data structures for a platform game level, basically x,y, positions and length of the platform, for now,
I don't understand why the 'module' object is not callable - error? It seems it should be trivial. What does that mean? I intend to end up with a list of terrain objects
In, must I do 'import platform as platform' is that telling me how to call methods, get data from that class?


I finally got Python images to be plopped on the screen, just blitting, a lonely mutalisk, but not flapping.
To make my mutalisk flap its wings in python, or any of my many animated GIF's, for that matter, must I blit them frame by frame? I was surprised it wasn't automatic flapping, like in other situations.

Here is the blit code that finally worked. . .


If I'd like to make a platform game like Contra,

Are there any acceptably decent animated GIF's somewhere out there for me to choose from?
or some adequate transparent ones for me to do alpha coding with? Something close to a predator, an alien, Arnold, terminator, Robocop, scorpion, rancor! tauntaun, ewok gungan

What do most coders use for these place-holders?


I finished our colossal collaboration of a network game with a central server, a while ago. I will convert it to python now that I'm shifting to it as well. Is that unadvisable - python might not be optimal for a game server?

I know that MIT had an RTS AI coding contest, before.
There's also ORTS, open rts
There seem to be many similar links on Google.
The MIT contest was geared to a confusing, un-watchable mess of a game, in my opinion.

Do these types of contests have any traction? now? Any of them non-college?
I have many ideas, some non 3D war.

I have had my cards hacked enough times to get really annoyed.
I receive balance sheets with card purchases in Rhode Island, or California, and I live in NC !

I paid with Paypal today, which means, my card was never exposed to direct hackers, I think.
Is that correct? VISA always refunds these fraudulent charges ( >$5,000, total, one time, over a few months)
Do hackers steal my paypal login?
Must I always do (card) online payments with paypal? I'm sick of cancelling cards for safety's sake

I have my pygame ready and I'm going to start being a coding-personal-trainer teacher for nearby kids.
No doubt, there are many books for me to gain wisdom on how to proceed? Or, is there a good web-site done?
I asked some previous questions in this sphere, but some additional references/syllabus would be useful.
the requirements for the game is :

a single player playing against the computer.
The computer automatically generates its fleet locations
The single player enters via keyboard the location of her or his fleet.
Fleet components:
Battleship: 5 spaces (1 battleship)
Crusier: 4 spaces (1 cruiser)
Submarine: 3 spaces (1 submarine)
Destroyer: 2 spaces (1 destroyer)
Trawlers/spy ships: 1 space each (5 trawlers)
The board size: 10 spaces x 10 spaces
The human player starts by guessing a location. If a miss, the computer tells the user it was a miss. If a hit, the computer tells the user it was a hit. If a hit sinks a ship, that ship type is identified. The user's shot display is updated with the location of the hit and/or miss.
Both the user's screen and the user's guess screens are displayed for the user and updated during game play.
The game continues, alternating "shots" on the opposing fleet.
The game is over when either the user's or the computer's fleet is totally sunk.
User interface requirements:
two fleet screen matrixes
User's fleet positions
user's shot record (and hit/miss pattern)
a running count of number of shots, number of hits, and number of misses.
May be either text-based or GUI
Program requirements:
All course standards met, to include internal documentation
All variables validated and no out of range errors experienced during gameplay
method calls, parameter passing and returns to main(), properly prototyped and called.
computer …
I am nearly ready to begin my foray into games in Python. However, is it more advisable to incorporate a JFrame for the game Window? Is Python GUI up to speed?

All of a sudden, my is saying

Your connection will be run through a proxy server because of your network setup"

This is new.
Things seem to be hinky. I cant join or create games (that are seen by others).
I cant think of anything I've changed
What might be causing this?
We have an 11 year old that is very creative and loves doing things on the computer. At a book fair earlier in the year, he chose to get a book on building websites and really enjoyed it. I'm toying with the idea of getting him a coding program for Christmas and wondered if anyone had suggestions for that age. He likes video games as well so I really think he'd like one that allows him to build and play his own game, if that helps.

I need to be able to install Pygame in Pycharm (4.0.5), but it seems Pycharm has come out with newer versions.
Pygame is no longer in 2.9, but 3.3

One example on Youtube suggested I re- install Python? Will this all automatically link up in pyCharm?
Last time it tried, the console installation instructions didn't seem to affect the behavior in pycharm.

What is the best way to get it working in Pycharm?
A question about making puzzles for bridges (also known as Hashiwokakero or Hashi).

Is there an algorithm to generate a puzzle given the size of grid?  Please provide algorithm or link to one if it exists.

Game Programming

Game programming is the software development of video games. Game programming requires substantial skill in software engineering as well as specialization in simulation, computer graphics, artificial intelligence, physics, audio programming, and input. Like other software, game development programs are generated from source code to the actual program by a compiler. Source code can be developed with almost any text editor, but most professional game programmers use a full integrated development environment (IDE).

Top Experts In
Game Programming