Download the PHP package pew-pew/map without Composer

On this page you can find all versions of the php package pew-pew/map. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package map

PHP 8.3+ Latest Stable Version Latest Unstable Version License MIT

Map

This component provides basic DTOs for storing, analyzing and transmitting game maps data, as well as loaders for loading this data from arbitrary formats.

Installation

PewPew Map is available as Composer repository and can be installed using the following command in a root of your project:

More detailed installation instructions are here.

Usage

Below is a list of available component value objects, their parameters and methods.

Size

The size object is responsible for the physical two-dimensional dimensions of arbitrary objects.

Size Area

Get the total area of an object provided by size.

Position By ID

In particular, any 3x3 object can be represented in the following form, where each number denotes the corresponding identifier:

Any coordinates can be represented as a scalar ID. To obtain a position by this ID, you can use the following methods.

Position

A position is a primitive object that provides coordinates within an object.

The object does not provide any additional methods.

Layers

A layer is one of the map elements that can define a set of objects to draw, a set of collisions, a set of triggers, or anything else.

Each layer contains a position within the map and its own size.

Tiles Layer

For a layer containing tiles, you should create a corresponding PewPew\Map\Data\TilesLayer object. In addition to size and position, it also contains an array of tile IDs.

The size of the tiles array directly depends on the size of the layer and can be obtained using the Size::getArea() method.

[!NOTE] For the 3x3 layer, the number of used tile elements corresponds to 9. If there are extra tiles, they are not used.

[!NOTE] If any tile ID is missing, then it corresponds to 0, that means no tile.

TileSet

A tile set is an object containing information about an image containing a set of other images (tiles).

The tileIdStartsAt constructor parameter is responsible for the starting ID of the tile, so a 2x2 tile set with tileIdStartsAt: 42 will contains 42, 43, 44 and 45 tile IDs.

[!WARNING] The "tileIdStartsAt" cannot be less than 1.

Tile ID Availability

To check the availability of a tile ID, you can use the containsId() method.

Position Of A Tile

Updating Tile Pathname

Examples

Example map

Expected output:


All versions of map with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-dom Version *
ext-json Version *
phplrt/source Version ^3.6
phplrt/source-contracts Version ^3.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pew-pew/map contains the following files

Loading the files please wait ....