pythonarcade / roguelike Goto Github PK
View Code? Open in Web Editor NEWRoguelike adventure written in Python and Arcade
Home Page: https://arcade-rouguelike.readthedocs.io/en/latest/
License: Other
Roguelike adventure written in Python and Arcade
Home Page: https://arcade-rouguelike.readthedocs.io/en/latest/
License: Other
Moving from:
KEYMAP_UP = [arcade.key.UP, arcade.key.NUM_8]
KEYMAP_LEFT = [arcade.key.LEFT, arcade.key.NUM_4]
KEYMAP_DOWN = [arcade.key.DOWN, arcade.key.NUM_2]
KEYMAP_RIGHT = [arcade.key.RIGHT, arcade.key.NUM_6]
to
class _KeyMap():
UP = [arcade.key.UP, arcade.key.NUM_8]
LEFT = [arcade.key.LEFT, arcade.key.NUM_4]
DOWN = [arcade.key.DOWN, arcade.key.NUM_2]
RIGHT = [arcade.key.RIGHT, arcade.key.NUM_6]
KEYMAP = _KeyMap()
so keys could be referenced as KEYMAP.UP
instead of KEYMAP_UP
and *
imports could be eliminated.
A similar thing can be done about game states and tiles.
Type hints make code easier to follow, so I am adding them while reading.
Hi there!
First and foremost, thank you VERY much for your work on the arcade library. It's amazing. Thank you very much. Really looking forward to diving in on a roguelike I've been working on (and finding pygame and other libraries lacking). Trying to get your roguelike example running but having a problem.
I have installed the prerequisites based on the readme. When I run pytest, I get the following:
____________________________________ ERROR collecting tests/test_game_window.py _____________________________________
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
../venvs/arcade/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:171: in exec_module
exec(co, module.__dict__)
/Users/keyton/Dropbox/fundev/roguelike-master/tests/test_game_window.py:15: in <module>
???
source/game_window.py:13: in <module>
from game_engine import GameEngine
source/game_engine.py:13: in <module>
from recalculate_fov import recalculate_fov
source/recalculate_fov.py:14: in <module>
def recalculate_fov(char_x: int, char_y: int, radius: int, sprite_lists: List[arcade.SpriteList[Entity]]):
E TypeError: 'type' object is not subscriptable
When I attempt to run "python source" nothing happens (no errors. just comes back to command line having done nothing)...
In looking at the Real Python article on arcade, I saw that you need to install PyObjC on mac so I did so just in case the requirements.txt file didn't do the trick...
I am running Python 3.9.1 as indicated in the error above.
Screen when attempting to run pytest:
Screen when attempting to do a python source:
I'm running in a virtual machine called "arcade"
Cover MyGame with unit tests.
nb. Drafting of first tests shows that the on_draw method is the first candidate for refactoring by extraction of some smaller methods.
Basic scaffolding to make testing possible.
While reading the code and doing #1 I was confused for a moment only to realize that entities.entity.Entity.move_towards
and procedural_generation.game_map.GameMap.is_blocked
are the dead code and artifacts of the previous implementation. Is there a plan to use it in the future in some modified way or could it be safely removed?
Describe the bug
pytest
reports 4 sound loading failures during run in the form of FileNotFound
errors.
To Reproduce
Steps to reproduce the behavior:
pyest
Expected behavior
Sound loading errors do not occur during pytest
runs
Desktop (please complete the following information):
pip -r requirements.txt
Describe the bug
The instructions for installing and running the game do not result in launching the game.
To Reproduce
Steps to reproduce the behavior:
python source
Instead, the game can be launched and played soundlessly by switching into the source
directory and running python __init__.py
. This is less than ideal.
Expected behavior
The game launches when following the launch instructions.
Desktop (please complete the following information):
Proposed solution
Update the game to follow the example of the community RPG project:
> python -m modulename
or > commandname
to run the gameA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.