[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Low-level vs. High-level programming (was My First Computer)
- Subject: Re: Low-level vs. High-level programming (was My First Computer)
- From: pausch@saaf.se (Paul Schlyter)
- Date: Fri, 20 Jun 2003 21:28:00 +0000 (UTC)
- Newsgroups: comp.sys.cbm, comp.sys.apple2, rec.games.video.classic, comp.os.cpm
- Organization: Svensk Amat|rAstronomisk F|rening
- References: <pan.2003.06.18.19.07.35.727341@tjonk.now> <Xns939F77BBA463Dwildstar128hotmailco@216.168.3.44> <bcuhk7$1elo$1@merope.saaf.se> <Xns93A0769B19F95wildstar128hotmailco@216.168.3.44>
- Xref: archiver1.google.com comp.sys.cbm:58908 comp.sys.apple2:31598 rec.games.video.classic:59128 comp.os.cpm:13375
In article <Xns93A0769B19F95wildstar128hotmailco@216.168.3.44>,
wildstar <wildstar128@hotmail.com> wrote:
> pausch@saaf.se (Paul Schlyter) wrote in
> news:bcuhk7$1elo$1@merope.saaf.se:
>
>
>> That would be quite possible! Not on one single HTML page of course;
>> you'd need a sequence of pages, and probably a very large sequence as
>> well. But here's how to do it: each page is assigned a timeout,
>> after which the next page is loaded. This is accomplished by putting
>> this in the HTML header:
>>
>> <meta http-equiv="refresh" content="1;URL=nextpage.html">
>>
>> This next page will be displayed automatically, that is unless the
>> viewer clocks at some link first.
>>
>> So now you'll just have to create a very large number of HTML pages,
>> displaying each and every possible combination of ball and paddle
>> positions...... :-) ....admittedly not very practical, but still
>> possible. And with the very large disks of today's computers, disk
>> space shouldn't be the limiting factor.....
>>
>> You could even do it without that "refresh" HTML line: the user would
>> then have to click on one of three links: move the paddle up one
>> step, down one step, or don't move the paddle..... of course such
>> a HTML Pong game would lose all real-time aspects of the game, but it
>> would still be a version of Pong.
>
> Aren't you missing a key element. The balls X,Y coordiniation control.
> When a ball is hits the right paddle the balls X-direction will change
> from incrementing to decrementing. If it hit the left paddle then it
> flips to incrementing. Understand.
Of course! And that's built into the links between the HTML pages:
a HTML page with the ball hitting the paddle will of course link
to a HTML page with the ball just bouncing back. Likewise, a HTML
page with the ball passing the paddle without hitting it will
link to a HTML page with the ball beyond the paddle, i.e. lost.
And, in addition, each HTML page will link to one of three different
HTML pages, depending on which of three links the user presses:
paddle-up, paddle-down, or paddle-doesnt-move.
> If you hit the top or bottom walls, the balls Y direction flips.
That too is easy to implement by linking to appropriate HTML pages.
> The key to Pong was that flip variable controls in its programming.
Quite naturally, a flip variable is much easier than keeping track
of thousands of HTML pages.... :-)
> The ball either goes left or right and may go also up or down or
> level (rather rare). HTML doesn't have the required controls for
> this does it.
It doesn't need to -- it handles this by linking to the appropriate
next page.
> This require data handling. Well handling and processing the data
> in the variable. That is something not reasonably possible with
> pure HTML.
That processing is not done within the HTML of course -- it's done,
before the game is played, when designing the structure of all those
thousands of HTML pages and how they all link to one another.
Yep, if the user input is given, pong is a quite predictable game.
And this "prediction" can be done while designing the game just
as well as while the user plays the game. In the former case, ALL
possible outcomes will have to be handled of course; in the latter
case, only those outcomes which actually happen need to be handled.
Nevertheless, it is possible to implement the Game of Pong in HTML,
just like any other kind of state machine. Admittedly though, a Pong
implemented in pure HTML would not be particularly enjoyable to
play...
--
----------------------------------------------------------------
Paul Schlyter, Grev Turegatan 40, SE-114 38 Stockholm, SWEDEN
e-mail: pausch at stockholm dot bostream dot se
WWW: http://www.stjarnhimlen.se/
http://home.tiscali.se/pausch/