5
\$\begingroup\$

Are JavaScript games exclusive to modern smartphones, or are older phone models also able to play games written in JavaScript?

\$\endgroup\$
6
  • 3
    \$\begingroup\$ "Regular cellphone" is kind of ambiguous. There are smart phones that run on java, but it would depend on the phone if they were able to run javascript. I think you can expect it to be unlikely that a javascript game would work. Non-smartphones are not typically known for their ability to load additional apps. \$\endgroup\$
    – House
    Commented Mar 24, 2013 at 18:44
  • \$\begingroup\$ Have you tried it? \$\endgroup\$ Commented Mar 24, 2013 at 19:24
  • \$\begingroup\$ @Byte56, Thanks, ok. Yes, I meant regular mobile phones (not smartphones). \$\endgroup\$ Commented Mar 24, 2013 at 19:33
  • \$\begingroup\$ I edited the question to make the distinction a little clearer. It's still a fuzzy boundary though. How old of a phone are we talking? Also, Japanese gara-kei "Galapagos phones" are another boundary altogether! :) \$\endgroup\$
    – Anko
    Commented Mar 24, 2013 at 22:06
  • 2
    \$\begingroup\$ Nokia Series 40 would be a typical edge case. It's positioned below Nokia's Windows 8 smartphones, but does have Webkit and thus javascript. \$\endgroup\$
    – MSalters
    Commented Mar 25, 2013 at 12:36

3 Answers 3

4
\$\begingroup\$

If the cellphone has a JavaScript interpreter or web browser built in, it is possible but not likely. Most non-smartphones don't come with necessary software especially not the phones of yesteryear.

It's more common for older models to come with Java, which will allow you to run applications based on that platform.

All in all, you can definitely find "dumbphones" that will run JavaScript today so I wouldn't say they're exclusive to smartphones.

\$\endgroup\$
8
  • \$\begingroup\$ -1 for confusing Java and JavaScript. It makes your answer pointless. \$\endgroup\$ Commented Mar 24, 2013 at 21:00
  • \$\begingroup\$ I confused something? Your statement seems a bit more pointless. I clearly answered the question and provided some additional knowledge on what is a more common case. But since it seems to have confused you, I'll modify it a bit to appeal your perception. \$\endgroup\$ Commented Mar 24, 2013 at 21:16
  • \$\begingroup\$ @eBusiness, thanks for your input! There's no need to be rude about this though. Ha ha. \$\endgroup\$ Commented Mar 25, 2013 at 0:23
  • 3
    \$\begingroup\$ C++ interpreters? No, C++ is compiled, certainly in the smartphone world. as far as they have webbrowsers, they're typically limited in functionality and have no JS engine. \$\endgroup\$
    – MSalters
    Commented Mar 25, 2013 at 12:31
  • 2
    \$\begingroup\$ Actually xerosigma didn't confuse anything he was just saying that usually the phones platform is java as if to suggest using java to get what you need done is more probable than being able to use JavaScript. Let's all get along guys no need to fling insults. \$\endgroup\$
    – user6484
    Commented Mar 25, 2013 at 14:34
2
\$\begingroup\$

Definitely it just depends on what version of html your game is written in and what your phones browser/interpreter will support

\$\endgroup\$
1
\$\begingroup\$

I have only tested on my own Samsung B2700, which is a relatively new dumb-phone, other phones may provide different results.

The issue:

Basically almost any reasonably new phone, even a cheap one, is a pretty decent computer, it can run a browser, it can draw 2D graphics in real time, and do a lot of other stuff. Thus there is no doubt that the hardware is capable of running games, if such phones are incapable of running JavaScript games it must be because the phone has a poor or lacking JavaScript implementation. There are two issues that seem likely to arise:

  1. The browser doesn't run JavaScript at all.
  2. The JavaScript implementation lack a proper routing of keyboard input.

Testing my own phone:

My phone seems capable of basic dom manipulation (and thus it does run JavaScript), and it generates standard events when the 12 keys on the numeric keypad are pressed. It also seems reasonably responsive on my simple test page, but I don't know how good the performance is. In any case the graphics quality is heavily limited by small low-res screen.

While it is hard to judge the viability from my simple test I have no doubt that a simple Tetris clone or similar is at least possible, and it would probably play reasonably well.

I made the following page to test keyboard input, it is blank when loaded, but should fill basic information about keyboard events on the screen as the keys are pressed: http://ebusiness.hopto.org/phonetest.htm

\$\endgroup\$
2
  • \$\begingroup\$ I tried it, eBusiness, but I'm still a Newbie. I feel shamed asking this, but ...how did you make this page (if it's not too complicated to explain). The page works; I tried it. How does this page relate to the topic? \$\endgroup\$ Commented Mar 26, 2013 at 0:11
  • \$\begingroup\$ @LanaTisdel As for how I did, look at the source, it is a pretty normal keyboard event capturing scheme. It is interesting for mobile phones as input is the one area where they are truly different from PCs, you have got no mouse and a completely different keyboard. You need the input from this keyboard in order to make a proper game, thus determining how to get that input is vital to a game project, and that is what my page tries to determine. You'd of course have to load it in a mobile phone to test that phone. \$\endgroup\$ Commented Mar 26, 2013 at 15:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .