GithubHelp home page GithubHelp logo

danmacnaughtan / pyxel-raycast Goto Github PK

View Code? Open in Web Editor NEW
27.0 6.0 0.0 8.76 MB

Raycasting with the Pyxel retro game engine

License: The Unlicense

Python 100.00%
python pyxel gamedev game-development

pyxel-raycast's Introduction

Pyxel Raycast

example

A basic raycast example using the Pyxel retro game engine. The project started as an experiment porting the OneLoneCoder CommandLineFPS (see video tutorial here) to Python and Pyxel, but went a bit farther with some dithering and camera control (including "vertical" looking).

A resolution of 240x136 and framerate of a whopping 30fps was achieved using two techniques:

  1. Interleave rendering (alternate drawing even and odd columns)
  2. Using one of Pyxel's image banks as a display buffer so the scene can be rendered with a single draw command

Some additional tips, specifically "vertical" look, can be found in this article.

Requirements

Controls

Key Description
1 Reduce FOV
2 Increase FOV
3 Reset FOV
4 Toggle interleave rendering on/off (default on)
5 Increase visible distance
6 Reduce visible distance
7 Reset visible distance
8 Toggle wall boundaries on/off (default on)
W Move forward
A Turn left
S Move backward
D Turn right
Z Strafe left
C Strafe right
Q Look up
E Look down
X Center look
SHIFT Hold to run

pyxel-raycast's People

Contributors

danmacnaughtan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyxel-raycast's Issues

Running on latest pyxel release

I'm trying to run your script on latest pyxel version (1.4.3) and getting following error:

  File "main.py", line 372, in window
    return pyxel._app._window
AttributeError: 'Module' object has no attribute '_app'

Is there any chance to make it compatible with latest pyxel?

AttributeError: function 'SDL_SetRelativeMouseMode' not found

Error:

Traceback (most recent call last):
  File "D:/PROGRAMMING/temp/pyxel-raycast-master/main.py", line 52, in <module>
    _setup_api("SDL_SetRelativeMouseMode", c_int32, [c_int32])
  File "D:/PROGRAMMING/temp/pyxel-raycast-master/main.py", line 47, in _setup_api
    api = globals()[name] = getattr(_lib, name)
  File "C:\Program Files\Python38\lib\ctypes\__init__.py", line 386, in __getattr__
    func = self.__getitem__(name)
  File "C:\Program Files\Python38\lib\ctypes\__init__.py", line 391, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'SDL_SetRelativeMouseMode' not found

Steps to reproduce:

Run main.py

Environment:

Python: 3.8
Pyxel: 1.4.3
OS: Win 10

Compress GIF file

Your gif file size is 25 MB.
You can use compressed version which size is 2.5 MB:

example_compressed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.