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

I discovered the site Shutterstock that will be invaluable in providing images, sounds for my Javascript phone game.

I can't see an article on how the images will be served. ( I don't want to get served myself through legal misunderstandings) before I sign up.
Will they provide only URL's to the images (without watermarks) once I have an account subscription, or the clean MP3 / GIF files themselves?
Is this a go-to site for development? widely used?

OWASP: Avoiding Hacker Tricks
LVL 13
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

I found a very promising looking javascript youtube for beginning a javascript game done in the window.requestAnimtionFrame method system , which appears to be best.

My transcribing it from video to Atom IDE loads the mutalisk I substituted for their GIF in the animation,
but it doesn't move after the requestAnimation x,y individual incrementation in my helper method movement statements.
I'm confident it will be obvious to a JS master on sight where my code is lacking

The Youtube that moves a GIF is here

I was pleased my code appeared to be promising, but the moving of said mutalisk doesn't happen


<!DOCTYPE html>

  <title> Title something something</title>
  <style type = "text/css">
    body {
      background-color: #FFF;
      margin: 30px;
      margin-top: 10px;


    #contentContainer {

      width: 550px;
      height: 350px;
      border: 5px black solid;
      overflow: hidden;
      background-color: FFFF00

    #thing {
      position: relative;
      left: :25px
      top: 50px

    <div id = "contentContainer">
      <img id = "mutalisk" src = ""
      height="75" width="75">

      var theMutalisk = document.querySelector("#mutalisk");
      var currentPosition = 0;

      var requestAnimationFrame = window.requestAnimationFrame 

Open in new window

In order to prevent another $thousands mess with Godaddy, I thought I'd get some advice on my new circumstance.

A Godaddy tech is calling me tomorrow to discuss my unused policies and perhaps a refund on my giant mistake.

If you'd like a remembrance of the  previous blunder question, briefly, it is here

Anyway, the tech suggested I might be refunded this $3,000, he said -
$1,000 dedicated server purchase (and some other stuff) and we'll discuss it tomorrow. I'll let you know how it goes here, and on my other question.

Discussion with Godaddy tech -
I'll say - Experts advised me to stop using godaddy. - for hobbyists, which I have already done a hobby type blog.
Sadly, I have a bad case of loyalty more...
I mentioned on the setup call today that experts had advised me that Godaddy was inadequate for top-shelf .io game delivery.
How pitiful.
I don't even know why I fell for the $3,000 thing. She convinced me it would be optimal for game delivery and speed. My blog's performance seemed acceptable, but it wasn't NYT. I saw no reason to be contemptuous.
Is there any chance the tech could offer something decent tomorrow? Don't I want to keep my godaddy for the parked domains and my many files and backups in my public folder, ability to do new websites quickly? The refund will only be into my Godaddy account, which might …
As it is, I think I am nearly ready to start fleshing out my .io game in javascript.

Do .io game coders get the width and height of the game screen and do % locations in the code for objects, text and pics? - so rotation layout and size adjustment is covered? How is rotation best managed? does a listener call for a redraw after a rotation is complete? and new %'s are aligned? how?

How might a layout look that shows any linked pic at an appealing size in landscape and then adjust to another config on portrait?

Hi, in the Xcode IDE for javascript,

How do I setup this example code correctly?
This example will get me going full speed ahead..
ie, what do I name the html section and the javascript section? (labeled "the code used is:")
and do I copy the entire code section into its own file? Separate would be better.
Also, there is no <script...> code to link the code into the HTML
Should I add that anywhere before?
where it says, "the HTML markup is:"

Also..What else must be done to get this working? What are some exploitable mistakes I can make? How do coders make it simple to code swipe games w/o using a phone for test?
Link the mouse in to the swiping? How?
Can you see the PNG's for the arrow pics?
The code first example page is here

Maybe this page is better? here


For my phone game, I have received a lot of Expert advice, - no 'pay to win' - 'not too many ads' - 'focus on gameplay.'
I haven't bought anything on a game yet. On 'wordscapes,' I have watched ads to gain coins. That seems to be a winner for them.
Compared to a blog, what are Adsense for games - CPM's and CPC's like for publicity and generating revenue?

I was glad to find this phone-game javascript code on GitHub below. It has answered many of my recent E-E Q's.- confirmed expert help!
I played it on my MacBook from my webspace directory and the keys work, as expected w its clean code,
but I also found that finger-pinch-resizing works on my iPhone, which I was v.glad to see.

I can't see where the finger-screen-touching pinch code is in the javascript. There are no touch keywords in the folder. , only onkey events
What am I missing on this tiny platform game, on GitHub    here

so on E.E. , I have been able to finish an RTS server in Java, blog w income, I'm ready to commit to a JS phone game..
I'm using ATOM as my Interactive development environment. Will it be suboptimal for my various publication needs?
If I do my game on a web page, it is simply placing the .htm file and the .js file in the folder. What about app compilation? Do the google and Mac stores have their way to package the javascript somehow? What should I be aware of?

I just make the game and worry later? :)

I have been working towards creating a multiplayer three.js fps game and am planning to only do client-side prediction in the browser. On the other hand, I am using Node.js Express.js and for the authoritative server-side implementation of the multiplayer game and would like to check collision server-side.

Using three.js or external libraries, what are the possible options to create a headless version of the game state like the babylon.js-nullengine and calculate raycasting collision on the server-side?

Similarly, how do three.js multiplayer io-based games keep track of game states server-side and do bullet and movement collision?
I'm curious as to the best javascript way to include a simple GPS map location portrait of the current device location into a .io app.
Starting with Angular 5
LVL 13
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

I have been directed to a javascript example housed in the Tryit editor, where example javascript code was pasted in for me to run. I modified it. But, I like the editor.

Is this a sterile and indifferent editor? Need I be concerned about what I run in it? Lame question, but it was a minuscule concern that undesirables could be gifted my code in the future.


In javascript, how does the interpreter register methods?
In my example code below, a scene is drawn from an example I found and modified slightly
I'd like to structure my code into methods, of course, (functions in JS)
but where is the best/expected place to write my method code. I have seen some people do it at the end, but is that best?
How would the interpreter know about them? I'm going to do encapsulation of all my work in class files? Compared to Java, Class files look complicated in JS? Understanding import and export?

var canvas =  document.getElementById("game-layer");
var context = canvas.getContext("2d");

context.fillStyle = "green";
context.fillRect(0, 0, canvas.width, canvas.height);

context.fillStyle = "red";
context.fillRect(5, 5, 10, 15);
context.fillStyle = "white";
context.fillRect(25, 25, 20, 20);
context.fillStyle = "green";
context.fillRect(50, 50, 20, 40);

var connection = new WebSocket(

connection.onopen = function () {
  connection.send('Ping'); // Send the message 'Ping' to the server

Open in new window

I think I mucked up a decision a few weeks back.
A sparkly girl from Godad called me one morning during a remorseless coding buzz of mine.
She said they had reviewed my godaddy account and were uncertain about my server decisions.
Apparently, they had a new package deal for a "non-VPS" server of my own to handle my games' (plural) needs.
I didn't sense any red flags, so listened on.
I told her I needed a server to handle my games'  traffic and deliver appropriate responses and content to the user.
She didn't object. and told me it would be my own dedicated machine.  - And could do what I needed.
I was admittedly skeptical, bec if this was a special deal for a personal server, they'd need quite a big farm for all the potential global individual clients?
I should have asked her where the location was and how many clients had servers.
Anyway, she said it was a short time offer, and I thought it was a good deal for my needs and I bought the damn thing at $1,000
Can I salvage this blunder? Was it a blunder?
Can I work with the thing the sold me to make phone games?
I have since discovered Amazon web services which would be far better suited to my needs.- only pay for traffic you use.

Does Godaddy have a similar system to AWS? Is it in development?
I can demand a refund for the blunder, and use that money for Godaddy Web Services? Godaddy refunds have to stay within the account.

On this finger moving "touch events" tutorial page, below,

The page is all done in HTML.

It looks like it is javascript at the end doing the work..

Could those example methods, going down the page eventually just be alone in a .js file?
I am wary of bad coding practices, doing work that should really be in its own javascript file inside HTML.
In Atom IDE, do I just have the HTM file with the .js linked in?

Since I'm making a board game engine..

For a phone game, wouldn't dragging and dropping chess pieces, for example, be infuriatingly uncertain / complicated for players on a smaller phone screen?
If only legal moves are considered playable, what is best for a game like this? what is the current expected / standard?

not to sound like I'm drowning u out with game coding Q's (I am)
-I am focusing all my attention on my best idea. My second idea needs a trailblazer game to work, first. Thanks Doug for the original concept orders. Based on my successful Java RTS collaboration here, I am confident this first phone game can get me in the right trajectory.
Contemplating a chess type problem game, drag move might not be best with fingers? or am I wrong, - tap *from* and *to* squares? Maybe people expect drag? - even if fingers obscure the piece? Have a thick pink line from start square to finish-finger-spot?

I see there are Javascript TouchStart and TouchEnd type functions.
There seem to be some method collision/overlapping event complications on some outline pages.
Is there a definitive, javascript - correct graphics setup and touch outline page?
Wordscapes has drag-move when choosing letters.

If I am making a WORDSCAPES type .io game, my own thing

is there any point?
How difficult is publicity?
Will the big boys drown me out?
This is it's own question, not something I want to confuse with my other questions.

The options for professional housing of game servers (multiplayer and single player online games, esp io games, in my case)
are  here

and amazon gameLift here

They are both definitely adequate and worthy of my usage in my games.

I'd like some opinions for my situations. Some of my games are both multiplayer or single player, but need my own server to run them.
The closest game requirement comparisons I can think of are: i) large forum/community chess type game. ii) single player platform, ii) MM platform. iii) single player turn based v AI

Amazon pays only for usage, playerio is fixed rate. Amazon seems better suited. Servers on Amazon's cloud can be deployed anywhere. I'm not certain if playerIO does that also?

I'm happy with either.
Can I build my gameLift server in Java?

I don't want to muddy my other question, as this one is its own issue.
I saw this paragraph on

PlayerIO is the fast, easy, scalable & reliable way to build online games. Features such as BigDB, GameFS, Sitebox and Multiplayer makes it possible to build large complex online games without hosting a single server yourself.

And with client libraries for Unity3D, Objective-C, Java, Javascript, C# and ActionScript, your game will run on any platform.

Open in new window

Would the Java aspect of the SDK be as good as the Javascript aspect, - will they be virtually interchangeable? I read that Javascript < Java

OWASP: Forgery and Phishing
LVL 13
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

I have a few questions up now  concerning the setting up of my io game project correctly. I was advised to seek pro help. I agree.
I was also advised and have read it up that Godaddy is feeble for serious endeavors.

I've been w Godad for a long time, but loyalty is sometimes a detriment.

I have several IO games in mind. I'm ready to make them now, so I got to get the start spot on..
I have been considering HostGator
and specifically for gaming.. .


Is there an obvious choice?

I need to write a notice
I don't want to leave anything out that I might not anticipate.
How does this read?

I'm seeking experienced javascript assistance with my .io game.
I'd like the start to be the usual options screen to kick in to game code / loop, like
I have a (playerio / hostgator ? ) web-space ready to host it, and will create a Java game server.
I live in North Carolina.

Open in new window

I am no longer concerned with the difficulties in making my io phone game. I have it all in my mind. Thanks Experts. Awesome help.

I'd like to start if off correctly now. - Front page, menu, options, add-ons. an adsense-for-gamers plan. Even game object purchases considerations..

I've bought a Godaddy thing that will be able to house my Java game server. ( so it's not my computer in the corner, like my first RTS)

I suppose I need to do a main page like agario has?
It should first connect to my TCP Java server to launch a server Thread, once two players join, for the client and then post an intro and game creation page.

Should I do it all beneath a window.requestAnimationFrame() type loop with click detection  of self-made buttons over my background needs, which could even be animated.
Once the game is started, the menu would be axed, and my game class would be instantiated..

Any thoughts for the server and clients?
I notice that all the .io game development YouTube's have similar looking IDE's for development.

I have tried Atom..
But, I think one of them might be especially suitable for .io games. (quick/easy upload, publish)

Which one should I be using for io games?
I'm having trouble  finding a truly awesome royalty free celebrity photos site. Google only gives me photos of the bloody royal family.
Megan, Diana, the queen, Charles, Harry and Wills aren't  the only celebrities.

For an io phone game, I'd like royalty free pics of Natalie Portman - Sarah Michelle Gellar, even Bill O'Reilly and Geraldo, Trevor Noah, Terry Bradshaw, Hillary and Obama  and Bill Nye. etc

AOC ! ! !

If I use them in a trivia type game, is that fair use?

I am having trouble getting the chess window to happen on my Javascript networking client.
My chess server is in Java, and my client is ready to fire up a .js chessboard after the handshaking is done.

I have become aware of anonymous scope.
I am fairly certain that it is why I cant instantiate this window, in the Git-Hub code below.
How might I change it to work?

// chessboard.js v1.0.0
// Copyright (c) 2019, Chris Oakman
// Released under the MIT license

// start anonymous scope
;(function () {
  'use strict'

  var $ = window['jQuery']

  // ---------------------------------------------------------------------------
  // Constants
  // ---------------------------------------------------------------------------

  var COLUMNS = 'abcdefgh'.split('')
  var ELLIPSIS = '…'
  var RUN_ASSERTS = false
  var START_FEN = 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR'

  // default animation speeds

  // use unique class names to prevent clashing with anything else on the page
  // and simplify selectors
  // NOTE: these should never change
  var CSS = {}
  CSS['alpha'] = 

Open in new window

I'm trying to solve my Javascript chess board issue, once & 4 all
I found this open-source chessboard way down below (chessboard1.0.0.  thanks other question)
It appears to have all the functionality I'll need for the GUI, but I can't connect it to my javascript client code..My server is in Java, but right now, I'm working on getting the JS chess GUI opening on the client

The javascript chessboard and tentative javascript client are below...
My client can connect with my tentative Java server, below, but how does / where can the JS client fire up the JS window after network connection?
The Object Oriented Nature of its Javascript / instantiation isn't obvious. I can see methods/functions, etc, but how is it fired up?

I'm not concerned with the server's game-play / move generation. I've done that before, Turbo Pascal 7th grade.
Only the connecting of the window 'class' / code to my client networking.

The files have EE in the name, coz they're intended for analysis here. . .

Java chess server

import java.util.Random;

public class EEChessServer extends Thread {
	public static int PORT = 1234;
	public static byte MSG_HELO_AND_MOVES=0;
	EEChessBoard board;

	public EEChessServer() {
	public void run() {
		board = new EEChessBoard();
		DataInputStream dis=null;
		DataOutputStream dos = null;
		Random R = new Random();

		try {

Open in new window


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).