Difference between revisions of "JavaScript"
Jump to navigation
Jump to search
Codejunkie (talk | contribs) |
|||
Line 57: | Line 57: | ||
* [[RailRL]] | * [[RailRL]] | ||
* [[PonyRL]] | * [[PonyRL]] | ||
* [[SanitasRL]] {{7DRL}} | |||
[[Category:Programming languages]] | [[Category:Programming languages]] |
Revision as of 15:42, 3 August 2013
JavaScript | |
---|---|
Programming Language | |
Company | Mozilla (and others) |
Influences | C, Java, Python |
Updated | March 22, 2011 (1.8.5) |
Status | Stable |
Licensing | |
Platforms | Browser |
Official site of JavaScript |
JavaScript is a scripting language used by most web-browsers. Roguelikes can also use it as a scripting language (e.g. for scripted events or quests). This allows changing game behavior without recompiling. Some browser-based roguelikes are written in Javascript or its Microsoft relative JScript (and JScript.NET).
Development Hints
- Use jsLint[1] to avoid many mistakes that are normally caught by a compiler
- Javascript frameworks abstract many of the browser inconsistencies. (MooTools[2], JQuery[3])
- Take advantage of Firebug for Firefox, the Web Inspector for Chrome and Safari and the Developer Tools in Internet Explorer (version 8 and above)
- Full IDEs are available including Microsoft Visual Studio Web Developer Express, Aptana and NetBeans.
- Rot.js is a JavaScript roguelike library with many useful features.
Advantages
- Scripting languages usually have a faster feedback loop between development and viewing the changes
- Closures are a powerful language construct that can simplify application structure and enhance readability
- Any user with a modern browser (on any platform) can run your game
- A whole new world of easy-to-access graphical possibilities with the DOM or <canvas>
- Working in a dynamic and garbage collected language takes a lot of the pain out of strong typing and memory management
- Well supported serialization of data structures using JSON
- Emerging HTML5 standards provide support for local storage of data
- Emerging web application stores, such as the Google Chrome Store, provide a distribution platform
Disadvantages
- Many errors that are caught at compile-time in a strongly typed language will be caught at run-time
- Existing source for most roguelikes is in C or C++, and not all idioms translate into javascript
- There are browser differences in javascript implementations and javascript speed, so true portability still takes work
- Javascript is much slower than C and C++ (however, not all roguelikes require blazing speed)
- Full file system access requires additional plugins
HTML and CSS
The standard method for user interaction is via HTML, CSS and its Document Object Model (DOM). Thanks to this, JavaScript supplies perhaps one of the most portable APIs for development.
- This page is a stub. Please help RogueBasin by expanding it. Click here to edit this page.
Roguelikes in Javascript
- gTile
- Neon (uses JavaScript for scripting)
- The Seven Day Quest 7DRL
- Advent (HTML5 and Canvas)
- jsMoria (javascript port of the roguelike classic Moria, uses MooTools[4])
- Cardinal Quest (original concept was JavaScript)
- Shambletown
- js-like
- roguezombies
- Wayward βeta
- Cave of Epokothar (HTML5 and Canvas)
- Ruins of Kal Raman (HTML5 and Canvas) 7DRL
- Saege (not yet released)
- RailRL
- PonyRL
- SanitasRL 7DRL