Welcome to WebmasterWorld Guest from 54.159.250.110

Forum Moderators: incrediBILL & lawman

Message Too Old, No Replies

is there life outside html?

   
5:59 am on Feb 16, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Back in the late '90's I made a clutch of text adventure games using {programming language} in what is now known as the Classic OS. And then various things happened, including OS X, and I never got back into it although I kept meaning to. To this day I've got a page saying that {name-of-game} will be released in some year with a "2" in it.

Finally last year I started trying sporadically. The programming language had changed. The operating system had changed. The behaviors that used to be known as toolbox calls had not just gotten new names, there was no translation reference to be found. Files were in outdated formats at best, inaccessible at worst. Monitors are vastly bigger, while physical pixels have grown somewhat smaller. I spent much time beating my head against the wall with XCode and Interface Builder with their weeny little windows and menus, and more time going around in circles in various technical-support areas.

:: insert predictable wisecrack involving circles of hell ::

A few days ago I threw in the towel and said: ### it. I'll use what I already know.

HTML 5 <canvas> element: check. Never used it before in my life, but seems straightforward.
HTML 5 <audio> element: check. Ditto.
Massive regular expressions to replace old control structures in {name-of-language} with equivalents in javascript: check. I may not know a lot, but I am solid on regular expressions in a text editor.

Repeated visits to {site that annoys me though I keep going back} to refresh memory of js syntax.
Repeated visits to That Other Forum to pore over answers to elementary questions.

To quote Apache: It Works!

So far I am only in room 3 of the 10-room mini-game that I originally made for this identical purpose, mutatis mutandis, back in 1997. It's extremely hiccupy, but... Sounds play. Pictures display. Animations happen. Pseudo-menus yield working input. Mouse clicks are acted on.

Et cetera. Tra la la.

Did I ever mention that I also use HTML as a word processor?
6:24 am on Feb 16, 2014 (gmt 0)

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



I feel your pain... but some things just work better with a programming language... so I kept my chops up for one... unfortunately it was not THE one... (sigh)

Still can code like bat out of heck... :)
7:24 am on Feb 16, 2014 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



That is inevitably going to be painful because OS X is an entirely different OS from Classic MacOS. It was not even originally developed by Apple or based on MacOS!

Why are you being so coy about what language you used?

There are MUCH nicer languages around than JS, but if its what you know, and it does the job, use it. It also has the advantage of being cross platform.

JS is being overused. I dislike the idea of server side JS (like Node.js), the argument for which goes:

1) Event driven is better than threaded.
2) JS cannot do threads to you have to write event driven servers.
3) Therefore JS is a better server platform than languages that can do threading.

This ignores:

1) lots of languages have weak threading (CPython for example)
2) green threads have the advantages of event driven servers but are easier to develop for
3) you can write an event driven server in any language.
7:55 pm on Feb 16, 2014 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



<html>
<head>Head</head>
<body>Body</body>
</html>
Life

There is now.
1:20 am on Feb 17, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



<html>
<head>
<title>Brian</title>
</head>
<body>Body</body>
</html>
Now it validates.
4:55 pm on Feb 17, 2014 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Haha!
10:47 pm on Mar 17, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Follow-up:

It's been educational. Things I have learned:

#1 Today's computers are faster than the ones 15 years ago. (Chorus: "Well, duhhh.") Back then, you had to draw graphics to an offscreen graphics world, do all your stuff, and dump the finished product back to screen; otherwise you'd get jumps and flickers. Now you can draw direct to screen and nobody notices a thing.

#2 Sounds are a pain.
#2a Don't waste your time with any of the 87 suggested javascript methods for telling when a sound has finished playing. Instead, proceed directly to the <audio> element and give it an "onended" tag. This works handsomely.
#2b You'd think, wouldn't you, that there would be dozens of rudimentary sound-wrangling programs lying around. Back in the day, I'm sure I had at least five or six. Today, everything is insanely complicated, including the ones that say all the other programs are too complicated. (There is some kind of mathematical or logical problem with this statement. I have observed the same thing in cookbooks w/r/t brown rice.) All I want is to reduce the sampling rate and/or physically chop up longer files. I think there was a third thing which I've forgotten. This does not require fifty megabytes, rows of icons, and triple nests of menus.

#3 javascript does not have a "pause" or "delay" function. This means you have to resort to heroic-- and not always successful-- measures in order to block user input while a sound or animation is running. (Sorry, user, you can't leave now: Jake is in the middle of standing up and he's not allowed in the next room where the code will put him if I let you move.)

#4 canvas is fun. It will be even more fun a few years down the line when you can create and store "region" objects. For now, I can fake it by storing the data points and rebuilding the region as needed. See above about faster computers.

#5 Was there really a life before Regular Expressions? Multi-line functions from 1998 become a single command today. Wheee! Add a few global replaces, and FutureBasic syntax magically changes into javascript.