Forkheads
http://www.forkheads.net/

HTML5 game development
http://www.forkheads.net/viewtopic.php?f=49&t=18468
Page 1 of 1

Author:  Phracker [ Sun Dec 02, 2018 8:27 pm ]
Post subject:  HTML5 game development

Anyone here gotten into game development with HTML5? I've written partial implementations of Pong and Battleship in HTML5 using the Canvas feature.

Here's my Pong program on Pastebin: https://pastebin.com/GtzAFG4j

And here's a screenshot of it running:
Image

I've got the animation part mostly working, but I haven't written any of the actual controls to move the paddles.

I kinda like the idea of HTML5 game programming. It seems cleaner and more elegant than Flash for some reason. Probably has to do with the fact that its' all in textual format, so it's less bloated that way.

I haven't worked on this in a few weeks though. I did some serious HTML5 game programming for a couple nights and then abandoned it for other things. I'd like to go back, because I feel like this language has a lot of potential and game development in HTML5 could be incredibly fun and enjoyable. I wanna hear what people have to say about HTML5 games (from the development perspective). Help motivate me to start back up again. :meow

Author:  Pantsman [ Mon Dec 03, 2018 12:34 am ]
Post subject:  Re: HTML5 game development

Does the speed slowly increase or does the player have to enter a factor? Also, that looks pretty old school - aka awesome.

Author:  Phracker [ Mon Dec 03, 2018 8:17 am ]
Post subject:  Re: HTML5 game development

It's a control field that the user enters a number into to control the speed. IIRC, the number entered is the multiplicative inverse (multiplied by a constant so it can be an integer) of the new value passed to the window.setTimeout() function that controls the animation of the square. I actually had a problem where entering new values would cause the game to speed up continuously until it was completely out of control; I realized that it was because I was starting a new sequence of setTimeout calls without removing the old one, so the calls were just accumulating. I fixed it, though had to ask for a solution on /g/ IIRC (that's the tech board on 4Chan which I now use for coding discussion/questions since CodeCall is basically dead and Stack Overflow is an overall shit board overrun by Python-coding normies).

Page 1 of 1 Time zone: Pacific/Galapagos
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/