Skip to content

Commit 9f04c69

Browse files
author
Ashley Xue
authored
Merge pull request #10 from Naereen/patch-1
Update README.md: add links, and fix list of depencies of js_of_ocaml
2 parents d235926 + 4c07c97 commit 9f04c69

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

README.md

+22-17
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,48 @@
11
[MariOCaml](https://mahsu.github.io/mariocaml/)
22
=============
3-
MariOCaml is an HTML 5 canvas web-browser implementation of the Super Mario Bros platformer written exclusively in Ocaml.
3+
MariOCaml is an HTML 5 canvas web-browser implementation of the [Super Mario Bros](https://en.wikipedia.org/wiki/Super_Mario_Bros.) platformer written exclusively in [Ocaml](https://www.ocaml.org/).
44

55
![Gameplay preview](https://github.com/mahsu/MariOCaml/raw/master/screenshots/preview.gif)
66

7-
[Try it out!](https://mahsu.github.io/mariocaml/)
7+
[Try it out online!](https://mahsu.github.io/mariocaml/)
88

99
## Key Features
1010
* 2D Mario platformer that emulates the platformer mechanics of Super Mario Bros.
11-
* Web-based playable implementation with graphics (Ocaml transpiled to javascript).
11+
* Web-based playable implementation with graphics (Ocaml transpiled to Javascript).
1212
* Procedural level generator that randomly generates levels.
1313

1414
## Description
1515
MariOcaml is an OCaml implementation of Super Mario Bros. The game includes several basic enemies, blocks, and items, with particle support. The underlying system follows a director model, with the director maintaining state based on game objects and tiles, including Mario, items, and obstacles. The implementation of enemies and items is designed to be easily extensible. Furthermore, MariOcaml supports a game-over and game-win states, as well as score and coin counts, emulating several of the core mechanics of Mario.
1616

17-
The design follows a clean, modular, and extensible system to ensure that more features can easily be added. Levels are procedurally generated (pseudo-randomly), algorithmically creating an environment of textures and objects that are interactable. The procedural generation generally generates a playable map, but due to the nature of random generation, maps may not be the most aesthetically appealing. Additionally, the game is interactive and graphical using js\_of\_ocaml, which enables cross-compiliation of Ocaml to javascript, allowing MariOcaml to be run in any modern web browser.
17+
The design follows a clean, modular, and extensible system to ensure that more features can easily be added. Levels are procedurally generated (pseudo-randomly), algorithmically creating an environment of textures and objects that are interactable. The procedural generation generally generates a playable map, but due to the nature of random generation, maps may not be the most aesthetically appealing. Additionally, the game is interactive and graphical using `js_of_ocaml`, which enables cross-compiliation of Ocaml to javascript, allowing MariOcaml to be run in any modern web browser.
1818

1919
The underlying procedural generation utilizes a grid system to generate objects, taking account parameters such as proximity and location. During game-play, the director maintains the game state, including the location and status of both items, enemies, and the character.
2020

2121
## Modules
22-
* **Director** - The heart of the game, executes the main game loop and performs updates on the map, canvas, and objects. Also executes the side effectual collision detection.
23-
* **Viewport** - Represents a slice of the game map which is currently in view and rendered on the canvas.
24-
* **Procedural Generator** - Generates the game level in a game map to be played.
25-
* **Actors** - Represents the characters, items, and obstacles in the Mario game world.
26-
* **Sprite** - The visual representation of an object to be drawn on the canvas. Contains the ability to create sprites from a template configuration based on the type of actor.
27-
* **Object** - The abstract representation of a specific actor on the game map. Contains the ability to create objects from a template configuration based on the type of actor.
28-
* **Particle** - Represents a non-collidable visually oriented object on the map. This includes destruction and creation effects.
29-
* **Draw** - Contains methods which update the canvas.
22+
* **Director** - The heart of the game, executes the main game loop and performs updates on the map, canvas, and objects. Also executes the side effectual collision detection (files [director.ml](director.ml) and [director.mli](director.mli)).
23+
* **Viewport** - Represents a slice of the game map which is currently in view and rendered on the canvas (files [viewport.ml](viewport.ml) and [viewport.mli](viewport.mli)).
24+
* **Procedural Generator** - Generates the game level in a game map to be played (files [procedural.ml](procedural.ml) and [procedural.mli](procedural.mli)).
25+
* **Actors** - Represents the characters, items, and obstacles in the Mario game world (files [actors.ml](actors.ml) and [actors.mli](actors.mli)).
26+
* **Sprite** - The visual representation of an object to be drawn on the canvas. Contains the ability to create sprites from a template configuration based on the type of actor (files [sprite.ml](sprite.ml) and [sprite.mli](sprite.mli)).
27+
* **Object** - The abstract representation of a specific actor on the game map. Contains the ability to create objects from a template configuration based on the type of actor (files [object.ml](object.ml) and [object.mli](object.mli)).
28+
* **Particle** - Represents a non-collidable visually oriented object on the map. This includes destruction and creation effects (files [particle.ml](particle.ml) and [particle.mli](particle.mli)).
29+
* **Draw** - Contains methods which update the canvas (files [draw.ml](draw.ml) and [draw.mli](draw.mli)).
3030

3131
## Building the Project
32-
1. First, ensure that js\_of\_ocaml (>= 2.6) and its dependencies are installed by running:
3332

34-
opam install js_of_ocaml
35-
2. With ocamlbuild installed, run:
33+
1. First, ensure that [`ocamlbuild`](https://github.com/ocaml/ocamlbuild) and [`js_of_ocaml`](https://github.com/ocsigen/js_of_ocaml) (>= 2.6) and its dependencies are installed by running:
34+
35+
opam install ocamlbuild js_of_ocaml js_of_ocaml-ocamlbuild js_of_ocaml-camlp4
36+
37+
2. (If you don't have `opam` installed, [see the official instructions](https://opam.ocaml.org/doc/Install.html))
38+
39+
3. With `ocamlbuild` installed, run:
3640

3741
make all
38-
to compile the binaries to the `_build` folder and run the jsoo cross-compiler.
3942

40-
3. Open `index.html` to run!
43+
to compile the binaries to the `_build` folder and run the `js_of_ocaml` cross-compiler.
44+
45+
4. Open `index.html` in a web-browser to run the game!
4146

4247
## Contributing
4348
Pull requests fixing bugs, adding functionality, or improving organization are welcome!

0 commit comments

Comments
 (0)