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.
Notes
- This game is optimized for 16:9 aspect ratios. While it should work on most aspect ratios, UI elements may overlap or be cut off by the windows with extreme ratios, especially on small screens.
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
- More Audio options (eg. Multiple bgm tracks, volume)
- Adjustable resolution for HTML
- Adjustable resolution without restart (Basic resizable windows are easy but not ideal)
- Improve Menu interface (perhaps a start menu or proper pause menu)
- Improved visuals
- Fix bug where ball occasionally flies offscreen at high speed
- Add singleplayer mode against AI player
- Add more gamemodes (Ie. AI, rotating paddles, multi-ball, timed, score-limit etc.)
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
- Fixed audio import settings, meaning it works in WebGL now
- WebGL player resolution optimized for this site
- UI elements now resize based on window size
- Audio migrated to new script
0.2
- Paddles reset when button pressed
- Added toggle menu with: Pause/Play, Reset, Mute/Unmute and Quit Options
- Added countdown timer on serve
- Tidied up code with some extra comments
- Ball now starts at center (after slight delay)
0.1
- Initial Release
Share this page



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.