A simple mapping application for the Anarch game engine.

pixelbath 8dfa35d82d change coords to be more opengl-like 3 years ago
.gitignore 3bbf4edfcf add .gitignore 3 years ago
README.md 98c70d16c7 clarification since a "any code" is a little broad 3 years ago
anarchmap.py d167c82414 removing debug print 3 years ago
example-printc.py a10003b0a8 example print script 3 years ago
level0.gif 2c7e5137d7 adding level0 as a test 3 years ago
main.py 8dfa35d82d change coords to be more opengl-like 3 years ago
testlvl1.gif 710b3566d4 +debug level, fixing camera, first ceiling stuff 3 years ago

README.md

All code and content in this repository is released into the public domain. Any code in this repository not written explicitly by me is already in the public domain. For more information, see https://gitlab.com/drummyfish/anarch/-/blob/master/README.md.

Note that this is not as "suckless" as drummyfish's code since it has external dependencies (specifically, Pyglet for OpenGL rendering).

Usage

This code uses a lot of drummyfish's img2map.py code as-is; I simply wrapped it in a class to access its sweet, creamy internals.

The plan is to get this app to a point where you point it at an assets folder and either create a new map or edit an existing map image. From that point, it can export classes or images, whichever is preferred.

Requirements

  • Pyglet: pip install pyglet

Editor

In main.py, the line: assets_folder = '../anarch/assets/' should be edited to point at a local clone of the Anarch repository. If you see white textures instead of the actual textures, then the assets were not located locally.

To clone drummyfish's archive (by default I'm storing both projects in the same folder):

git clone https://gitlab.com/drummyfish/anarch

To run the editor: python main.py

Controls

  • Horizontal movement: WASD
  • Camera aim: Mouse (mouse lock with E)
  • Up: Spacebar
  • Down: Shift
  • Esc: Exit

Other Usage

To use the C generator by itself, you can use the following code:

from anarchmap import AnarchMap

map = AnarchMap('./level0.gif')
map.printC()

The above code is included as example-printc.py, and can be used like so: python3 example-printc.py > level0.c.

License

I release everything in this repository under CC0 1.0 (public domain, https://creativecommons.org/publicdomain/zero/1.0/) + a waiver of all other IP rights (including patents), which is as follows:

Each contributor to this work agrees that they waive any exclusive rights, including but not limited to copyright, patents, trademark, trade dress, industrial design, plant varieties and trade secrets, to any and all ideas, concepts, processes, discoveries, improvements and inventions conceived, discovered, made, designed, researched or developed by the contributor either solely or jointly with others, which relate to this work or result from this work. Should any waiver of such right be judged legally invalid or ineffective under applicable law, the contributor hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to this right.

I would like to ask you, without any obligation, to please support free software and free culture by sharing some of your own work in a similar manner as this project.