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

Hi
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

taylor.jpg
Thanks
0
Hi
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

Thanks
0
Hi
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

Thanks
0
Hi
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?

Thanks
1
Hi
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);
    game.state.start("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.

Thanks
colorZap-copy.zip
0
Hi
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:
<html>

<h1>
<i>
This is a title
</i>
</h1>
</html>

Open in new window


Did I miss a field / checkbox? in setup?

Thanks
0
Hi
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?

Thanks
0
Hi,
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.

Thanks
0
Hi
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

Thanks
(function() { // module pattern

  //-------------------------------------------------------------------------
  // POLYFILLS
  //-------------------------------------------------------------------------
  
  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

0
Hi
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?
Thanks
0
Hi
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?

Thanks
0
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?

Thanks!
0
Hi

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

Thanks
0
Hi

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.
requestAnimationFrame(animate);

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?

Thanks

<html><head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title></title>
  <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;
}
  </style>



</head>
<body>



    <title> Mutalisk flap party</title>


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


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

  

Open in new window

0
Hi
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?

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

here

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?

Thanks
0
Hi,

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?

here
?
Thanks
0
Hi
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?

Thanks.
0
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?

Thanks.
0
Hi
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.

Anyway,
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?

Thanks
0
Hi  (code below)
I have animated GIF's on my Javascript game canvas ready to be selectable, mouse and touch, and tapped/clicked to a destination.

I found a page for how to do it, but is there a best and only practical  place to load them in? must I use the once-loaded system? I don't want to interfere with browsers' expectations.
The example/instruction mouse/touch listener page is here
Also, must these games be tested with a mouse, thus assuming touch screen will be good - and share a do-er method?

My game code now, has a single mutalisk flyer ready to be selected. I bet I can set the border once it is selected/deselected? How are the listeners best added? To which object? The drop-down doesn't have .addlistener as an option.

My code is:

index.htm

<!DOCTYPE html>
<html>

<head>
  <title> Mutalisk flap party</title>

  </head>

  <body>

    <link href="mutaCSS.css" rel="stylesheet" />
    <div id = "contentContainer">
      <img id = "mutalisk" src = "http://jamescomp.com/pics/mutalisk.gif"
      height="75" width="75">
    </div>

  <script src = "mutaJS.js"></script>
</body>
<html>

Open in new window


mutaCSS.css

body {
  background-color: #FFF;
  margin: 30px;
  margin-top: 10px;

}

#contentContainer {

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

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

Open in new window


mutaJS.js:


Open in new window

0
Hi
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

MY CODE ATTEMPT IS HERE:

<!DOCTYPE html>
<html>

<head>
  <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
    }
    </style>
  </head>

  <body>
    <div id = "contentContainer">
      <img id = "mutalisk" src = "http://jamescomp.com/pics/mutalisk.gif"
      height="75" width="75">
    </div>

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

      var requestAnimationFrame = window.requestAnimationFrame 

Open in new window

0
Hi
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 tendency....no 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 …
0
Hi
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?


Thanks
0
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

Thanks
0

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