• Stars
    star
    1,519
  • Rank 30,839 (Top 0.7 %)
  • Language
    JavaScript
  • License
    GNU Affero Genera...
  • Created about 7 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

FOSSASIA Labyrinth

Join the chat at https://gitter.im/fossasia/labyrinth Build Status Average time to resolve an issue Percentage of issues still open license GitHub repo size in bytes Website

Play Now | Learn How to Play | Documentation

Content Outline

This is a labyrinth software which can be edited by you. This is an example in which direction we go: Vision

Our goal is to have contributors like you draw parts of the labyrinth (Inkscape or hand drawn or other techniques), embed them into a huge labyrinth. Possibly, we can have multiple levels all stuck together.

Motivation

In the past two years, we created Flappy SVG. We had problems coordinating because this is all one SVG file. This time, we can allow contributors to work independently on a level and coordination comes with embedding. This allows remixing of each other's work and thus collaboration in new ways such as:

  • Adding your tile to an existing labyrinth
  • Creating your own labyrinth from other tiles.

It is possible to extend the level in various ways: Keys, asking characters in the game, animation, moving through the game, multiple levels. Also, we can create apps, credit pages and various other things with it.

Implementation

This will be an HTML/JS only site.

Contributions, Bug Reports, Feature Requests

This is an Open Source project. We would be happy to see contributors who report bugs, file feature requests and submit pull requests as well. Please have a look at the Contributing file for ways to contribute.

Issue and Branch Policy

  • Before making a pull request, please file an issue. So, other developers have the chance to give feedback or discuss details.
  • After writing your first commit, please open a pull request.

Match every pull request with an issue please and add the issue number in description e.g. like "Fixes #123".

We have the following branch

  • master
    This contains shipped code. After significant features/bugfixes are accumulated on development, we make a version update, and make a release.

Also read CONTRIBUTING.md

If you like to join developing,

  • you can chat on gitter, mentioning the maintainers.
  • you can find/create issues and solve them.
    • When you solve an issue, you do not own it. Share your progress via a Pull-Requst as soon as possible.
    • Discuss with others who work on the issue about the best solution. It is your responsibility, not the maintainer's to choose the best solution.

How to add new tiles

Labyrinth allows you to add your tiles by customizing the required javascript and svg files. There are various types of svg files which are available such as doors, floors etc.

Currently the tiles are svg images which are embedded into a div via javascript. Floor tiles have a dimension of about 429.544 x 256.314 px (wxh) Tiles are present in the tiles folder within subdirectories corresponding to particular tiles such as door, floor etc.

To create a tile you may use an svg editor such as inkscape. However other photo editors and formats do work if they are imported into the editor and saved as a svg file with the specified dimensions.

Note: if you are copying the template of a tile(floor) from an existing tile, then do not edit it as a png but directly as a svg. This is so that errors in alignment do not exist and the tile(floor) is perfectly aligned.

After creating tiles add them to the specific sub folder inside tiles.

Now, we will move on to the javascript part. Each tile's attributes and specifications along with it's declaration is done in the js/tiles.js file. You may edit this file defining attributes such as how you could enter and exit out of the tile and so on. You can also specify the door it takes, it's closed exit paths etc. A sample implementation should go into the already defined door class like:

tile_name: Object.assign({}, OpenDoors, {
    canEnterFromTheRight() {return false;}, /* Set these to false to block movements on the right */
    canLeaveToTheRight() {return false;},
    /* Simillarly you can have canLeaveToTheTop(), canEnterFromTheTop() etc. */
    createImages: function() {
      this.wallTop = this.createImage("tiles/rooms/wall/top.svg"); /* Alter these attributes to specify a custom wall tile for the floor tile.  Do not forget to implement the movements with canEnter/LeaveFromTheRight, ... */
      this.wallRight = this.createImage("tiles/rooms/door/right.svg");
      this.ground = this.createImage("tiles/rooms/floor/svg_name.svg"); /*  svg_name is the name of your svg */
    },
  }),

If you want to display an alert box when the character reaches your tile, your implementation must be something like this :

    visit: function() {
        alertNormal("title", "text");
        this.wallTop.show();
        this.wallRight.show();
        this.ground.show();
     },

Replace alertNormal with either alertNormal, alertInfo, alertQuestion, alertSuccess, alertError or alertWarning. For more info, read this.

And replace title and text with whatever title or text you want to display. If you want to only have a title and not any text, keep text empty. Like this : "".


After doing so now let's call the tile from the level so that they are reachable. You may modify `/js/levels.js` (which is currently the only level to include your tile. Something like `door.tile_name` since we have added it (our object) to the door (which is a class). You may use css to animate the svg if you wish.

How to add a new character

Labyrinth allows you to add your characters by customizing the required javascript and svg files.

Currently the characters are svg images which are embedded into a div via javascript. Characters have a dimension of about 55 x 60 px (wxh) Characters are present in the characters folder.

To create a character you may use an svg editor such as inkscape. However other photo editors and formats do work if they are imported into the editor and saved as a svg file with the specified dimensions.

After creating characters add them to the characters folder.

Now, we will move on to the javascript part. Each character has only difference in it's appearance and hence can be injected via putting its name and location to the svg file in gui.js. Follow the format while adding to gui.js (To be precise add it to the swal box input values collection i.e, into the inputOptionsPromise variable under the resolve sub class.)

"character_src": "character_name",

How to add new theme

Adding new theme is basically adding new tiles in a constant object:

const yourThemeName = {
  your tiles go here
},

While adding new theme you have to keep in mind theme structure. You can take a look at already existing themes.

After adding your theme to tiles.js file, you have to declare it in levels.js. Exactly its function, so it's going to create new tiles:

function createXLevel() {
  return new Level("X", [
    [X.none, X.right, X.right, X.right, X.right, X.none],
    [X.none, X.top, X.both, X.both, X.both, X.both],
    [X.none, X.top, PlayerStartsAt(X.start), X.both, X.both, X.top],
    [X.none, X.top, X.both, X.both, X.both, X.top],
    [X.none, X.top, X.top, X.both, X.top, X.top],
    [X.none, X.top, X.both, X.both, X.both, X.top],
    [NullTile, X.none, X.none, X.none, X.none, X.none],
  ]);
}

That's just an example of this function. Note that all these functions in levels.js file are looking very similar. Instead of X sign insert your theme name.

To make the level available to the player, best if you also add a tile which you place in an existing level which you want the player to explore before. This tile then calls player.addReachableLevel(createXLevel()) to make the level available to the player.

visit: function(player) {
    player.addReachableLevel(createXLevel());
    // ...
  },

How to add a new translation

Labyrinth needs your translations for make the game famous world-wide.

  • Go to the js\translate.js and find English text(like following) that you have to translate.
  • Check your language where there is or isn't. If not you can go to your language translation and find new strings not tranlated but in English translation
  'language': 'Select your language',
  'how': 'How to play',
  'credit': 'Credits',
  'game': 'Game',
  'contribute': 'Contributors',
  'statistics': 'Statistics',
  'moved': 'Player Moved :',
  'times': ' Times',
  'audio': 'Audio',
  'now': 'Now Playing : ',
  'by': ' by ',
  'share': ' Share Game ',
  'follow': 'Follow us on',
  'invent': 'Inventory',
  \\like these
  • Copy all the strings in English translate. And paste it after to last translation.
  • Change en to two or three letters related for your language. Those two or three letters must be not used earlier for any translate. Ex:- For Sinhala use si, for Polski use pl
  • Translate all the strings to your language and save it.
  • Add flag that realated to the language in icons(You can find flag from this place https://en.wikipedia.org/wiki/Gallery_of_sovereign_state_flags). The flag must be 255 X 128 pixels and it must be png file.
  • Go to HTML files(index.html, howtoplay.html, credits.html, contributors.html) from your code editor.
  • Then find following code from all the HTML files given and copy and past it after last language.
<div class="hover-black">
  <a class="translate translate-language-choice waves-effect waves-light btn blue-grey darken-2" id="en">
    <img src="icons/UnitedKingdom.png" alt="" class="translation-flag" />
     English
  </a>
</div>
  • Change img src="icons/UnitedKingdom.png" to your flag and change " English" to your language name. (There must be a space before language name.)
  • Now check all the pages from your internet browser and see it works.
  • Done, Push your changes and create a pull-request and have it merged.

How to Animate a Tile

  1. Open the SVG file in Inkscape.
  2. Click on the element you like to animate.
  3. Go to Object > Object Properties or press Control+Shift+o.
  4. Choose an Id for the object e.g. asdf. Please be aware that if you choose to animate a group, you may need to set the id again after you ungroup it.

Now, you described what to animate. Here is what you can do to add an animation:

  1. Close Inkscape
  2. Edit the SVG-File with a Text-Editor
  3. Add the tag <style> to it and close it with </style>.
  4. In between, you can add animations, see this tutorial using your Id, e.g. #asdf {}
  5. When you animated something, you can view it in your browser.

UI identity guideline

Click here to read the full UI guideline

Videos by students

Maintainers

 Nicco Kunzmann

 Mario Behling

 Harsh Lathwal

 Tarun Kumar

 Yash Kumar Verma

 Abishek V Ashok

 Saarthak Chaturvedi

Responsibilities:

  • merge pull requests
  • follow CCCC
  • tag issues and pull requests to close after 3 days and close them after three to 7 days
    • if no updates are there
    • if there are no clear closig criteria
  • merge patches

More Repositories

1

visdom

A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.
Python
10,012
star
2

open-event-server

The Open Event Organizer Server to Manage Events https://test-api.eventyay.com
Python
2,906
star
3

phimpme-android

Phimp.me Photo Imaging and Picture Editor https://play.google.com/store/apps/details?id=org.fossasia.phimpme
Java
2,576
star
4

susi_server

SUSI.AI server backend - the Artificial Intelligence server for personal assistants https://susi.ai
Java
2,503
star
5

susi_android

SUSI.AI Android App https://play.google.com/apps/testing/ai.susi
Kotlin
2,419
star
6

open-event-frontend

The frontend for the Open Event API Server https://test.eventyay.com
JavaScript
2,335
star
7

open-event-droidgen

Open Event Android App Generator https://github.com/fossasia/open-event-android/raw/apk/sample-apk-fossasia17-development.apk
Java
2,048
star
8

pslab-android

PSLab Android App https://play.google.com/store/apps/details?id=io.pslab
Java
2,046
star
9

susi.ai

SUSI.AI Web Client https://susi.ai
JavaScript
2,033
star
10

open-event-wsgen

Open Event Website App Generator https://sched.eventyay.com
JavaScript
2,013
star
11

open-event-attendee-android

Open Event Attendee Android General App https://github.com/fossasia/open-event-android/blob/apk/open-event-dev-app-playStore-debug.apk
Kotlin
1,947
star
12

star-me

Star FOSSASIA Repositories on Github and Support the Community
JavaScript
1,905
star
13

fossasia.org

FOSSASIA Website https://fossasia.org
Less
1,883
star
14

susi_iOS

SUSI AI iOS app http://susi.ai
Swift
1,869
star
15

loklak_search

Frontend Search for loklak server https://loklak.org
TypeScript
1,831
star
16

badgemagic-android

Badge Magic with LEDs - Android App https://play.google.com/apps/testing/org.fossasia.badgemagic
Dart
1,828
star
17

badgeyay

Attendee Badge Generator for Conferences
JavaScript
1,787
star
18

open-event-organizer-android

Open Event Mobile App for Organizers and Entry Managers https://play.google.com/store/apps/details?id=com.eventyay.organizer
Java
1,784
star
19

meilix

Beautiful Linux System https://meilix.org | APT Repo: http://meilix.fossasia.org
Python
1,772
star
20

pslab-desktop

PSLab Desktop Application https://pslab.io
JavaScript
1,763
star
21

susper.com

Susper Decentralised Search Engine https://susper.com
TypeScript
1,734
star
22

open-event

Open Event Project, Samples, Documentation and Artwork http://open-event-dev.herokuapp.com
Python
1,701
star
23

neurolab-android

NeuroLab Android https://github.com/fossasia/neurolab-android/raw/apk/neurolab-dev-debug.apk
Java
1,700
star
24

labs.fossasia.org

Projects Website for FOSSASIA http://labs.fossasia.org
CSS
1,669
star
25

query-server

Query Server Search Engines
Python
1,659
star
26

gci16.fossasia.org

FOSSASIA Google Code-In Website 2016/17 http://gci16.fossasia.org
HTML
1,652
star
27

pslab-hardware

PSLab Hardware Design and Schematics https://pslab.io
Prolog
1,642
star
28

codeheat.org

Codeheat Coding Contest Website https://codeheat.org
Less
1,628
star
29

pslab-python

Python Library for PSLab Desktop: https://pslab.io
Python
1,624
star
30

pslab-scripts

Pocket Science Lab - Scripts for Sensor Experiments
Python
1,604
star
31

susi_linux

Hardware for SUSI AI https://susi.ai
Python
1,604
star
32

flappy-svg

Flappy Bird in SVG. Play it at http://fossasia.github.io/flappy-svg/
JavaScript
1,604
star
33

gci17.fossasia.org

FOSSASIA Google Code-In Website 2017/18 https://gci17.fossasia.org
CSS
1,598
star
34

gci15.fossasia.org

FOSSASIA Google Code-In Website 2015/16 http://gci15.fossasia.org
HTML
1,596
star
35

2017.fossasia.org

FOSSASIA Summit 2017 https://2017.fossasia.org
HTML
1,580
star
36

2018.fossasia.org

FOSSASIA Summit 2018 https://2018.fossasia.org
HTML
1,577
star
37

fossasia-communities

FOSSASIA API Files of Communities in Asia
1,576
star
38

susi_skill_cms

A web application framework to edit susi skills http://skills.susi.ai
JavaScript
1,572
star
39

open-event-attendee-ios

iOS app for open event
Swift
1,570
star
40

gci14.fossasia.org

FOSSASIA Google Code-In Website 2014/15 http://gci14.fossasia.org
JavaScript
1,569
star
41

2016.fossasia.org

FOSSASIA Summit 2016 https://2016.fossasia.org
CSS
1,564
star
42

2012.fossasia.org

FOSSASIA Summit 2012 Event Site https://2012.fossasia.org
CSS
1,563
star
43

knittingpattern

A Python Library for Knitting Patterns
Python
1,562
star
44

loklak_webclient

loklak web application
JavaScript
1,553
star
45

pslab-firmware

Firmware for PSLab Open Hardware Platform https://pslab.io
C
1,550
star
46

loklak_wok_android

"loklak wok" is a harvesting peer for the loklak_server https://github.com/fossasia/loklak_wok_android/raw/apk/loklak_wok_1.2_20160201.apk
Java
1,549
star
47

directory.api.fossasia.net

Python
1,547
star
48

neurolab-hardware

Neurolab Hardware
1,541
star
49

yaydoc

Docs! Yay! http://yaydoc.org
JavaScript
1,540
star
50

2015.fossasia.org

FOSSASIA Summit 2015 Event Site https://2015.fossasia.org
CSS
1,539
star
51

susi_chromebot

SUSI.AI Chrome Extension
JavaScript
1,538
star
52

meilix-systemlock

Meilix system lock
Python
1,537
star
53

2014.fossasia.org

FOSSASIA Summit 2014 Event Site http://2014.fossasia.org
HTML
1,537
star
54

x-mario

x-mario, the gaming distro
Shell
1,534
star
55

phimpme-drupal

Phimp.me - Photo App on Drupal
PHP
1,534
star
56

knitlib

Knitting backend library for knitting machines
Python
1,532
star
57

yaydoc-artwork

Open Source Books
1,532
star
58

phimpme-wordpress

Phimp.me - Photo App on Wordpress
PHP
1,532
star
59

sg18.sciencehack.asia

UNESCO Hackathon Website at the FOSSASIA Summit Singapore https://sg18.sciencehack.asia
CSS
1,532
star
60

searss

Search to RSS tool
Python
1,531
star
61

CommonsNet

Sharing and Transparency for WiFi Networks
JavaScript
1,531
star
62

knitweb

knitting web app frontend and backend
JavaScript
1,530
star
63

meilix-generator

WebApp for generating a custom ISO image based on Meilix http://meilix.org
HTML
1,530
star
64

pslab-case

PSLab Case https://pslab.io
1,530
star
65

fossasia.net

FOSSASIA.net Website https://fossasia.net
HTML
1,530
star
66

2011.fossasia.org

FOSSASIA Summit 2011 Event Site http://2011.fossasia.org
HTML
1,530
star
67

unesco.sciencehack.asia

UNESCO Hackathon Website https://unesco.sciencehack.asia
CSS
1,530
star
68

pslab-expeyes

PSLab for ExpEYES - Science Experiments and Data Acquisition for Physics Education https://pslab.io
Python
1,529
star
69

api.fossasia.net

FOSSASIA API
JavaScript
1,529
star
70

xmario_buildscript

x-mario build script
Shell
1,529
star
71

fossasia-nodemailer

JavaScript
1,529
star
72

2023.fossasia.org

HTML
1,528
star
73

hotelxoai.com

The Open Source Hotel in the Mekong Delta in Vietnam
HTML
1,527
star
74

2010.fossasia.org

FOSSASIA Summit 2010 Event Site http://2010.fossasia.org
HTML
1,527
star
75

fossasia11-drupal

FOSSASIA 2011 Drupal Site
PHP
1,526
star
76

blog.fossasia.org

Issue Tracker for https://blog.fossasia.org
1,526
star
77

susi_smart_box

SUSI.AI Smart Box https://susi.ai
1,526
star
78

fossasia10-drupal

FOSSASIA 2010 Drupal Site
PHP
1,525
star
79

perspektive89.com

Open Source Journal Perspektive89.com
1,525
star
80

cmap.api.fossasia.net

FOSSASIA Community Map
JavaScript
1,523
star
81

feed.api.fossasia.net

PHP
1,522
star
82

loklak-webtweets

FOSSASIA Tweets with loklak http://fossasia.github.io/loklak-webtweets/
Less
1,522
star
83

foss.vn

FOSS.vn Website http://foss.vn
HTML
1,522
star
84

pslab-test-jig

PSLab Test Jig - Boards to test PSLab hardware https://pslab.io
1,518
star
85

jugaadfest.com

Jugaadfest in India https://jugaadfest.com
HTML
1,518
star
86

knitpat

Knitting Pattern Format
Python
1,518
star
87

susi_tweetbot

Twitter Bot for Susi http://susi.ai
JavaScript
1,517
star
88

open-event-scraper

Google spreadsheet parsing for Open Event JSON
Python
1,516
star
89

fossasia.github.io

FOSSASIA.GitHub.io
HTML
1,516
star
90

knitserver

JavaScript
1,515
star
91

open-event-next

Open Event Frontend "Next Version" with Vue.js
TypeScript
1,515
star
92

susi_skill_data

A storage place for SUSI.AI skills https://susi.ai
1,514
star
93

loklak_tweetheatmap

Heat map with tweets by search query using Loklak API and OpenLayers 3
JavaScript
1,513
star
94

sciencehack.asia

Science Hack Website http://sciencehack.asia
CSS
1,512
star
95

fossasia-artwork

Artwork related to FOSSASIA
1,512
star
96

susi_telegrambot

Susi Telegram Bot http://susi.ai
JavaScript
1,511
star
97

timeline.api.fossasia.net

JavaScript
1,511
star
98

susi_fbbot

Susi Facebook Bot http://susi.ai
JavaScript
1,510
star
99

susi_slackbot

Ask Susi Messengers http://susi.ai
JavaScript
1,510
star
100

kniteditor

Kniteditor
Inno Setup
1,509
star