homepage Welcome to WebmasterWorld Guest from 54.198.42.105
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Local / Foo
Forum Library, Charter, Moderators: incrediBILL & lawman

Foo Forum

    
is there life outside html?
lucy24




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

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?

 

tangor




msg:4645672
 6:24 am on Feb 16, 2014 (gmt 0)

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... :)

graeme_p




msg:4645673
 7:24 am on Feb 16, 2014 (gmt 0)

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.

RhinoFish




msg:4645841
 7:55 pm on Feb 16, 2014 (gmt 0)

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

There is now.

lucy24




msg:4645910
 1:20 am on Feb 17, 2014 (gmt 0)

<html>
<head>
<title>Brian</title>
</head>
<body>Body</body>
</html>
Now it validates.

RhinoFish




msg:4646101
 4:55 pm on Feb 17, 2014 (gmt 0)

Haha!

lucy24




msg:4654896
 10:47 pm on Mar 17, 2014 (gmt 0)

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Local / Foo
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved