Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have been looking around for clues on the subject but I'm not convinced to commit to javascript as my primary scripting language.

Currently I have started with lua. But I fear it will be a limiting choice for my future projects which include web clients for my games.

So basically I would like to know if you think it would be a viable solution for handheld devices and consoles.


Also, I would be glad to hear about:

  • anyone who had much success with javascript in cross platform games
  • failures with javascript scripting engines
  • restrictions within console SDKs that would prevent this type of solution
  • successes using lua in web games
share|improve this question
    
Is it "sound"? You shouldn't use colloquialisms like that. Not everybody will have English as a first language. Innit. –  Charles Goodwin Oct 9 '11 at 23:42
5  
That's not a colloquialism, with the adjective version the word means "having no defect" as in the common phrase "safe and sound." It's also a noun and verb, which is probably what you're thinking of. –  Patrick Hughes Oct 10 '11 at 1:29
    
Sorry I have been reading too many books. English is not my 1st language. You are free to reformulate the question. –  Coyote Oct 10 '11 at 7:31
add comment

2 Answers

up vote 2 down vote accepted

Javascript is absolutely getting more popular for the task and there are already games in apple's AppStore and the others that prove this. Besided the game libraries like crafty or impact, a lot of new technology around javascript has emerged over the last months and you might want to look at

  • CoffeeScript to write Javascript much quicker
  • Backbone.js to structure your game a lot more (I seriously use this in a game)
  • Jasmine (in case you are paranoid enough to write tests for you game)
  • localStorage in newer browsers to save the players data.

In can you create a server-client game then node.js is also something to look into.

When you start your game please be aware that there's not only canvas or webgl but for some games svg or even plain html with some awesome css transformations might be useful as well.

share|improve this answer
    
I'm off to quickly checking CoffeeScript, Backbone.js and node.js. –  Coyote Oct 10 '11 at 7:29
    
While crafty and impact offer good solutions for mostly web dev, I am not looking into full JS game engines. I might try to integrate V8 to my engine later on but for my current project I will restrain from using too much scenario data as to avoid having too much scripting to do if I can. Backbone.js and node js have elements I would reuse... Thanks. –  Coyote Oct 20 '11 at 11:42
    
Hi, apart from the UI I have now something approaching a working solution where I can share some game logics and model across the nodejs server and phone gap test project. Thanks for the pointers. –  Coyote Mar 4 '12 at 11:10
add comment

The JavaScript you would write for your desktop game's scripting would likely not be the same as what would be used as a web client (Assuming by this you mean running in the web browser). An exception would be if you are talking about using an existing engine that uses JavaScript, like Unity3D, which is already cross platform and can be run in a web browser.

The issue is that if you embed JavaScript in your engine so that you can script your game in JavaScript, that doesn't all of a sudden mean your engine can be run from the browser.

share|improve this answer
    
I totally agree with you; embedded JavaScript doesn't mean the engine can be run from the browser. That's why I am looking into this but I am still skeptical. The amount of code I can reuse will not bring loot women and instant glory to the table. But if at least a part of the game (let's call it game-core-script) can be shared by the different projects I will be happy to have only one place to go to add and change a few scripts and get all the changes applied in all the projects sharing game-core-script. –  Coyote Oct 10 '11 at 7:27
    
Yeah, that is certainly possible, but it does still depend on which engines you'll be using. One thing you could do, though, is write a sort of framework on top of the engines such that the client code of the framework (your core game script) will be able to use the framework on top of each engine in the same way without caring what engine it is on top of. –  DeM0nFiRe Oct 10 '11 at 13:07
    
That's the idea. –  Coyote Oct 10 '11 at 13:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.