Skip to main content

No project description provided

Project description

py_raycast_engine

Example of use:

import raycast
from PIL import Image, ImageDraw

SIZE = 500

if __name__ == "__main__":
# 6.282 - 360
# 1.5705 - 90

    Map = [
        0b11111111111111111111111111111111,
        0b10000000000000000000000000000001,
        0b10100010010000000000000010000001,
        0b10000000000000000000000000000001,
        0b10000000001001000000000000000001,
        0b10001000000000000000000001000001,
        0b10000000000110100000000000000001,
        0b10010000000000000000000000000001,
        0b10000000000000000000000100000001,
        0b10010000010000000000000000000001,
        0b10000000000100000000100000000001,
        0b10000000000000000000000100000001,
        0b10000100000000010000000100000001,
        0b10000000100000000000000000000001,
        0b10000000000000000000000100000001,
        0b10000001000000001111000000000001,
        0b10010000000000000000000000000001,
        0b10010000000000000000000100000001,
        0b10001110001000010000000000000001,
        0b10000000000000000000100000001001,
        0b10000000000000100000000000010001,
        0b10000000010000000000000000100001,
        0b10000000000000010000000001000001,
        0b10000000000000000000000000000001,
        0b10000000100000000000000011000001,
        0b10000010000000000000100000000001,
        0b10000000000000000000000000000001,
        0b10000000010000000000000000000001,
        0b10000000000000001000000000000001,
        0b10000100000000000000000000000001,
        0b10000000000000000000000000000001,
        0b11111111111111111111111111111111,
    ]

    settings_state = raycast.create_settings_state(size=SIZE)

    game_state = raycast.create_game_state(Map, 16, 16, 0)
    for i in range(360):
        game_state = raycast.edit_game_state(game_state, 16, 16, i / 360 * 6.282)
        data = raycast.get_view(game_state, settings_state)
        img = Image.new("L", (SIZE, SIZE))
        draw = ImageDraw.Draw(img)
        draw.rectangle((0, 0, 500, 250), fill=(22,))
        draw.rectangle((0, 250, 500, 500), fill=(33,))
        for line in data:
            fill = int(line[2] / (SIZE / 2) * 255)
            draw.line([(line[0], line[1]), (line[0], line[1] + line[2] - 1)],
                      fill=(fill,),
                      width=1)
        img.save(f"img{i}.png")

ToDo

  • Raycast on rust
  • Full settings setter in python
  • Better structure
  • Make it more friendly to python
  • Make it work
  • Make description
  • Docs
  • Publish repository

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_raycast_engine-0.1.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_raycast_engine-0.1.1-cp310-none-win_amd64.whl (138.2 kB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file py_raycast_engine-0.1.1.tar.gz.

File metadata

  • Download URL: py_raycast_engine-0.1.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.17

File hashes

Hashes for py_raycast_engine-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6110dce7057a0cd5db6ad53c2e84baabd28d11855cca0ecf4279dce6ef88ce70
MD5 aeb56f5d7751296ddbc674c21aa2b273
BLAKE2b-256 a20be105a1a23a0832c6bd28b1824ef6fd3131811a4176f2aba783850b3329a5

See more details on using hashes here.

File details

Details for the file py_raycast_engine-0.1.1-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for py_raycast_engine-0.1.1-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 d26e8f36ad5fa184f450d0432351c967b79ed43bf24246bdef147eb82ec5c1f2
MD5 7b2f24989fd70249fa72775ba8bc5381
BLAKE2b-256 0c018cb0b4c5f442822c3cbfe1316bf2fdff6c39ac599970e509e9cfc15bf285

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page