We help IT Professionals succeed at work.

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

For my javascript mobile game, I'll need to have hundreds of various pro-looking icons for in-game-choice buttons on my Phaser pages.

iconfinder.com has exactly the sort of pics I need. -- Polished.

Are there any subtleties to this choice? Will I regret it, legally, to be specific?
If I buy one of their membership packages, is it that simple? Credit them on the site?

Look around!
This page has an example of elephant icons. Ignore the childish ones! I'll prefer black and white.  here

I've been doing work in Javascript this week, and I don't want to end up using inferior packages.

I'm using CSS and HTML to put up a chess board now. Are the javascript primitives for drawing not quite as solid as Phaser?
I've also been watching the Udemy javascript lectures. I'd like to use its apparent effectiveness (made by gamers for gamers?)

I like the preload, create, update .. interface for the various components of the project.
It does sound, in addition.

Any insights or experience concerning this assessment? Do all devices support Phaser?

in the chessboard Javascript available at https://chessboardjs.com

They use a 'FEN' string to keep track of the board state / piece locations, which looks like this: lower case is black, integers are blank square counts, upper case is white.


For my game, I need to store additional data about each piece in its lifespan.
The String board state would not hold extra info for each piece effectively.

Each piece needs at least a color, type character and an x and y location, and maybe a moveCount, history ..

something like:

struct piece {
 char pieceType;
char color;
int x;
int y;
int moveCount;
Move[] moves;
piece[] capturedPieces;

How should I approach this in Javascript for an entire board state? append 32 pieces to a {} structure?
What should this board / piece constructing best look like?

I've found a great chess javascript mod to help me make my own original game - a JS mod called chessboardjs

I can't seem to find any game loop in the code that moves the pieces back when they are dropped off outside the board.

At this page below, it shows the movement, not correct chess.

Is there a gameLoop somewhere that increments the locations to move along a straight line? The chess engine is all fine elsewhere

see it  Here


In Phaser, what is the expected way to start off a solid phaser game?..

What I mean is if Phaser games study the dimensions of the device or the input capabilities? ( as they vary amongst devices.. and might even alter the game, - desktop/tablet/phone)
When do games deduce if they are desktop/mobile? Some, like Slither probably don't care.
I'd like to put up a script that prepares my game which involves pics and nearby text selection.
How do I put up such a script that loads images onto the screen, draws text, lines. - and includes mouse selection and touch? The image object!
Is Taylor Swift a ruthless legal vulture with Indiana Jones - Temple of Doom fiery-ruby eyes?

just kidding :)

In my phone game, I'd like to have pics/icons of everyday objects (sketches) in scenes for a points collection aspect. (and for level advancements)

If I do my own black and white sketches from images I find of Taylor Swift, or Metallica or Jimi Hendrix, or even an elephant, television, car, or an outline of Bolivia, cobweb..

What legal nightmares might I be heading into? Are original outlines of copyrighted images, or close interpretations (my own outlines) of them a path to the guillotine?
Is there a good way in photoshop to generate an amazingly creative approximation of a picture?

For an elephant, I might want icons something like this :

elephant icon
or of Jimi

Jimi Hendrix icon
or Taylor

I'm making my Javascript phone game,
but doing home-made sprite sheets isn't fitting right!

There must be a flawless way to put them together. - - Consider my current game needing an array of dozens of cards, (game related pics)
I have all my cards ready to pack together, example like this image:
truck icon
If I standardize their dimensions, is software like this, below, most appropriate for my needs?  i.e. Does it work? Is it a trojan horse? Is freeware like this ever hostile, btw? Is there a well-used, reliable alternative? It seems ideal.

sprite sheet maker

I think I am ready to roll on my final proper game coding.

I can get html/javascript code running from my local OS X XAMPP  7.2 local server, of course, w MacBook IP address..but is isn't always-up, and I need it always on.

But, for an intended final product, I've been looking at the options for a real-world type dev system.

It looks like Amazon Web Services has very reasonable options for eventual monthly billing. here

I'll use the free tier.
For now, I need only the ability to put a simple page up that can load a device .io game in html and serve the game code to the player browser / device correctly.
Is that what gameLift is suited for? If I put my working .io game directory in my Godaddy space, it doesn't work. I apologize for bringing up Godaddy again. It'll be the last time, I hope. So, gamelift can serve an .htm that pulls up its .io code?
Is gamelift mainly for MMO games / games w player accounts?
I'd say that - My first game - .io game - is most similar to games like word-scapes and Drag-'n-Merge, not yet fortnite or Slither.io

Probably an obvious question, but considering the differences between phones and tablets for javascript games..

... Is the proper way to do browser + device games' object locations in fractions of device height and width? And size game objects as ratios also? What must I do concerning strategies for phone/tablet+browser? AND device rotation accommodations?
How does Javascript detect phone / tablet/ browser?

I don't have a tablet. Which is the best to get for game dev? many ... iPad, Surface . . . not necessary, any?
Let's consider a word game like Wordscapes. The main interface is the circular  object to select letters for a word-answer. Is that just 1/4 of width distance from border and x% width for the circle diameter?
How different is it, really, on phone/tablet? What is the proper solution for all this?

In a Udemy video lecture on 'building games with phaser', the instructor is working w the following 'ColorZap' project code zip below..
He is using brackets for an IDE, so so am I:

My XAMPP serves the files correctly, no problem, in Safari.

So, he has a main.js that tries to start the game object.

main.js :
var game;
//var score;
//var soundOn = true;

window.onload = function () {
    if (screen.width > 1500) {
        //desktop laptop
        game = new Phaser.Game(480, 640, Phaser.AUTO, "ph_game");

    } else {
        //mobile device
        game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, "ph_game");
    //add a state or screen to the game
    game.state.add("StateMain", StateMain);
    game.state.add("StateTitle", StateTitle);


Open in new window

But, the Problems console claims:

"Missing 'use strict' statement    if (screen.width > 1500) {

but most notably: Phaser was used before it was defined. . game = new Phaser.Game(480, 640, Phaser.AUTO, "ph_game");

which puzzles me, because where are the lines of code in his example or way this can work? I wrote the code from the Udemy vid. I can't imagine I left something off.

These project files are attached also. What could I not have done? Where do I define Phaser for it? Is there a  #include equivalent?
A black rectangle appears in the browser to test the code, so I know the size of the program area is being registered properly.

I put MAMP server up on my new dev machine OS X 10.15.2

It works, but it only serves it as pure text, not as correctly formatted / rendered HTML, the < > tags don't work.

if I call 'localhost' in the address bar, it lists the files in the localhost  'htmldocs' directory, but 'localhost/index.htm' and it dumps the html text, tags and all.

My HTML is:

This is a title

Open in new window

Did I miss a field / checkbox? in setup?

I'm not sure I'm approaching it correctly to run Javascript in MacBook Visual Studio Code.
One page suggests a Code Runner install from marketplace.visualstudio.com
but I'd like confirmation that that is exactly what I'd want.
Will it run my javascript in a browser, or equivalent environment? how? Is there a special setup needed?

does everyone have this issue?

I found an "atom-live-server" Atom plug-in to allow for simple set-up of a live server with the project's files instantly accessible from a browser / runtime
It was recommended by a Javascript web-game coding page.
Does the plugin look suspicious/ not as good as apache? It means I can easily do local / LAN testing.

I'm curious, if I follow the code format of this Github platformer.js example below, anonymous class,

Will it be uncomplicated to pop it into HTML and devices (maybe a converter like Cordova needed for platform specifics) ? (I'm adding to my previous question.)
I think the code is an excellent layout of everything I need. It is obvious where the touch listening will happen, like the other (click) events, tho I've never seen it work. Do touch and key events simply attach to the document, like the clicks? The document? - Not a screen?
Everything else looks very straightforward, to me. The game loop occurs at the end of all the methods' code

(function() { // module pattern

  if (!window.requestAnimationFrame) { // http://paulirish.com/2011/requestanimationframe-for-smart-animating/
    window.requestAnimationFrame = window.webkitRequestAnimationFrame || 
                                   window.mozRequestAnimationFrame    || 
                                   window.oRequestAnimationFrame      || 
                                   window.msRequestAnimationFrame     || 
                                   function(callback, element) {
                                     window.setTimeout(callback, 1000 / 60);


Open in new window

I recently acquired a MacBook w 10.15.1 Catalina, bec when I took my old 10.14.6 Mojave, the techs at GeekSquad said / comp friends said it was too old to service.
So, in making my phone game, I'd like to do the game dev on the new MacBook, so it can be repaired/ looked at, if necessary, and put my XAMPP on my old comp, bec it seems stable and I'm not using it for much else. This also means I can carry both MacBooks anywhere else, to do more dev, as I'm not always at home. - and I don't need another new comp.

Any comments?
I'm ready to install git for my MacBook 10.14.6 and command line, for my Javascript game project's source code needs.
I downloaded an install from source forge and my OS claimed it was from an unidentified dev, thus invalid, or something like that.
What is the correct way to acquire the correct version of git? will my OS recognize it as legitimate?

If I were to program a Steam game as an example, what would be good tools for programming, animating, designing a game?

I'd like to be able to use C#, .NET, technologies that I already know if possible.

We were looking at Unity Pro and it seems pricey. Is there something similar that doesn't cost so much?


I'm hoping for confirmation about this local server installation strategy for my Javascript game dev server being a good choice.

I have my newest MacBook, that is basically empty, ready to install this MAMP local server on from here

It says one-click installation. Any gotchas?
It has lots of sections for wordpress, elsewhere, but will this be good for serving files and data needed by my game?

Must I do a default install of Atom IDE? ( on the same machine?)


My many questions concerning game dev are nearing their end, as with expert help, I've decided on using phaser.io
as w its dev framework for games. It looks ideal.
I do have an issue from my mutalisk flight testing  htm page.
It flies perfectly in steps to a clicked destination, but it isn't in a smooth flight travel, but stop-start.
This is unexpected because the rendering function calls itself again at the end of the loop.

Open in new window

What in the Javascript code below might be causing the loop to stutter?

Also, does it matter if the javascript is embedded in HTML, or is that inconsequential ? What do coders expect?


  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="robots" content="noindex, nofollow">

  <style id="compiled-css" type="text/css">

#contentContainer {

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

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


    <title> Mutalisk flap party</title>

<div id="contentContainer">
    <img id="mutalisk" src="http://jamescomp.com/pics/mutalisk.gif" style="left: 3px; top: 3px;">
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

  <!-- TODO: Missing CoffeeScript 2 -->


Open in new window

Part 1:
My new MacBook (which I acquired to do my Javascript phone games dev or test, with my other MacBook and fixed dead iPhone, needs to have an optimal Javascript game dev environment set up on os X.

I've used Atom IDE already, and think it's fine. Is that the best way to go? Must I do a standard Atom MacBook install, like before?

I have an iCloud drive account, and one expert suggested I utilize a cloud system. I am open to that. If that facilitates seamless posting of my game online, and good project structure, it's a win win. Using an iCloud is basically indistinguishable from the file system?

Part 2:
I'd love to be able to see an example game that is just a one-screen with a 'start' button that enters a game loop of a circle/ animated GIF that can be finger-tapped, finger-dragged, mouse-clicked or mouse-dragged to a destination. That would set me going very well. The mouse, key and touch listeners look straight-forward. Keyboard shouldn't be a problem. Are most games mouse, keys and touch if appropriate?

I've found a Javascript page that has promising HTML and JS code to do game touch moves and drags.


I'll put it up on my web tomorrow and see how it does. Is this the right solution?
HTML with UI objects that get branded with functionality in JS code?

How do coders do it so that touches and mouse clicks do the same thing?
I'd expect it is with helper methods with both of the listener types added?
I'd be preventing default, of course..
What can go wrong?


I'm asking a more refined Question, as suggested, after my other JS / css Q strayed...

I'm trying to connect an html that loads javascript code that is wrapped in a css style sheet.

The code works as I want it for now in jsfiddle, a mutalisk flight exercise, point and click movement. Small movement point and click works.
But I cant load it in Xcode IDE, or a browser, the same way. (no big, black rectangle border appears, as in the css, and the mutalisk doesn't move)
I need to know how to explicitly connect a style sheet with javascript.
The jsfiddle working initial html, css and JS code is here

In xcode, the mutalisk flies, but can't be click-moved, like in jsfiddle.

No black rectangle - means that the CSS isn't connecting.
I found this page below on how to explicitly include a style sheet into javascript. Nowhere in the jsfiddle code does the stylesheet get loaded.
Is this, below, the best/correct way to go?

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?

Example of a Neural Network?

I am interested to know what I can do with Neural Networks and hope to see an example.

Got any?

I'll receive a sales call in 40 minutes from godaddy, concerning 'godaddy web services.'
It was unexpected, but I set it up, cause I knew I could ask EE if there's any chance it's worth getting?
I know Amazon web Services is recommendable, and Godaddy is for light-wight stuff.
I had a blog 8 years ago that seemed capable/ adequate - broke Adsense payment barrier.

Can Godaddy do what I'll need for an online phone game, EVEN an un-intense traffic eg like wordscapes.io or Drag 'n merge or words w friends or Candy Crush? are they un-intense? But, how about slither.io? Could I start off small? Is godaddy mainly for websites?


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