Pong (Web Audio Fix)

Version: 0.25


Controls

Left Player Right Player
Up W Up Arrow
Down S Down Arrow
Pause Esc
Reset R

Menus are entirely mouse controlled. Be aware there is no ‘Are you sure?’ warnings for Reset or Quit just yet. Quit also does nothing in WebGl build, I will fix these issues.


Summary

This is “Totally Original game not to too dissimilar to the 1972 classic, ‘Pong’”. Or TOGNTTDTT1972CP for short…let’s just call it Pong.

It is a multi-player game so grab a friend, enemy or that confused stranger in the street. You could also play with two hands like I do, I’m lonely.

If you’ve lived under a rock for the last 45 years, Pong is a greatly simplified version of tennis. Your only objective is to get the ball past your opponent and off the opposite side of the screen, and to do it more often than your opponent.


Downloads

To run the the game, simply extract the .zips below and double click on the executable file. (Pong.exe, Pong.x86, Pong.x86_64 or Index.HTML). No install wizards needed just yet.

Windows
Linux
HTML/WebGL

Notes


Update Summary

Version: 0.25

For the user this is a minor update that adds audio to WebGl and the options of mute BGM and SFX independently, the behind-the-scenes however, is much bigger. I discovered the problem with WebGL audio was not about me needing to add extra code for the non-FMOD platform but about me correcting my import settings. I’m not sure why (my guess would be with poor Linux porting), but Unity requires FFmpeg (or similar) for making asset libraries properly and it wasn’t installed so installing it and reimporting the audio files fixed it.

The other big thing involving audio was that having audio being played, manipulated and muted from different scripts and objects was tedious and confusing, especially when isolating specific clips to mute. This was with only three audio files spread over four objects, so I decided to fix it before it became much worse. I moved all the audio handling to a new script (AudioManager.js) and called on them from other scripts. This did mean that all objects with audio needed the AudioManager script and, because of the array I used for differentiating clips attached to the same script/object, it meant I had to have three Audiosources attached to each audio object. This is not ideal and I will see about improving it in the next update, but now I’m tired and I want to get this up.

Another unforeseen consequence is the pitch of the audio clip when the ball hits a paddle is not manipulated in the same way. The code is the same but being in separate scripts seems to make the audio just sound a little different. It’s not a problem, more a curiosity I would like to understand.

Planned updates


Permissions

If you’re mad enough to want to use this product on your own site, you are welcome to. Just be nice enough to let me know and give credit.


Credits

All assets used in this product are under Creative Commons, Public Domain or of my own creation.

“Voice Over Under”
Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0 http://creativecommons.org/licenses/by/3.0/

All visuals were made by me, that’s why they’re rubbish.


Changelog

0.25

0.2

0.1

Share this page
Twitter Facebook Google+

Comments

Don't be too mean...please?
You don't need to sign in to use the comments, simply click the 'Name' input and you will see an option 'I'd rather post as a guest'. You can use a phony email if it really bothers you.