Rot.js tutorial, part 1

From RogueBasin
Revision as of 14:21, 12 December 2012 by Ondras (Talk | contribs)

Jump to: navigation, search

This is the first part of a rot.js tutorial.

Setting up the development environment

Our game is played within a web page; a rudimentary HTML file should be sufficient.

<!doctype html>
        <title>Ananas aus Caracas: rot.js tutorial game</title>
        <script src=""></script>
        <script src="/path/to/the/game.js"></script>
        <h1>Ananas aus Caracas</h1>

We are going to put all the game code in one file, to maintain simplicity. When making larger games, it is far more useful to split the code across several files.

var Game = {
    init: function() {}

And that's all for part 1. The whole working code is available at [1].

Personal tools