GithubHelp home page GithubHelp logo

clubsandwich's People

Contributors

chrislr avatar eldarbogdanov avatar irskep avatar omgwtfgames 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  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  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

clubsandwich's Issues

Point class does not work well with pickle in python3

Pickling Point instances, and unpickling them in a different python session, leads to a malfunctioning Point class on Python>=3.3. More specifically, its _hash member value is different from what a new identical Point would generate in this session. A way to reproduce it would be to pickle a dictionary with Points as keys, save result to a file, and then unpickle this file in a different python session and try to access the keys - dictionary would almost certainly return nothing.

The underlying issue is that starting with Python 3.3, the built-in hash() function returns results that are randomized across different python sessions: https://github.com/irskep/clubsandwich/blob/master/clubsandwich/geom.py#L33

Remove the quotes from the installation instructions

Hello,
Python version : 3.7
Pip version: 18.1
OS: Windows 7

When trying to install the library using the supplied command pip install -e 'git://github.com/irskep/clubsandwich.git@master#egg=clubsandwich', there's an error:

'git://github.com/irskep/clubsandwich.git@master#egg=clubsandwich' should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+

It works when we delete the quotes, the final command being

pip install -e git://github.com/irskep/clubsandwich.git@master#egg=clubsandwich

Following README for DirectorLoop results in NotImplementedError

Hello! I have been using BLT for my roguelike project, and I wanted to give ClubSandwich a try. I was replacing some of my existing code with the examples used in the README, and maybe I'm doing something wrong, but I wanted to see what was up with this.

Here is what I have in my code:

class MainMenuScene(Scene):

    def terminal_update(self, is_active=False):
        print(0, 0, "Press Enter to begin the game, ESC to quit.")

    def terminal_read(self, val):
        if val == terminal.TK_ENTER:
            self.director.push_scene(GameScene())
        elif val == terminal.TK_ESCAPE:
            self.director.pop_scene()


class GameScene(Scene):
    def terminal_update(self, is_active):
        return super().terminal_update(is_active=is_active)

    def terminal_read(self, char):
        return super().terminal_read(char)


class Director(DirectorLoop):
    def get_initial_scene(self):
        return MainMenuScene()

On extended DirectorLoop, making a MainMenuScene subclass of Scene, and attempting to run it, instead of the expected behavior I get a NotImplementedError being raised. Here's the traceback:

Traceback (most recent call last):
  File "./anathema/main.py", line 12, in <module>
    main()
  File "./anathema/main.py", line 8, in main
    game.start()
  File "/home/krummja/Workspace/Python/Anathema/anathema/core/game.py", line 89, in start
    self.loop()
  File "/home/krummja/Workspace/Python/Anathema/anathema/core/game.py", line 106, in loop
    DirectorLoop().run()
  File "/home/krummja/Workspace/Python/Repositories/src/clubsandwich/clubsandwich/blt/loop.py", line 77, in run
    self.terminal_init()
  File "/home/krummja/Workspace/Python/Repositories/src/clubsandwich/clubsandwich/director.py", line 165, in terminal_init
    self.replace_scene(self.get_initial_scene())
  File "/home/krummja/Workspace/Python/Repositories/src/clubsandwich/clubsandwich/director.py", line 153, in get_initial_scene
    raise NotImplementedError()
NotImplementedError

Let me know if you need any other information, and I'm happy to provide it. If I'm missing something obvious, of course, please do let me know as well!

director.py DirectorLoop class error

I found an error with The Scene example on the website. I changed a thing to make it work but have no clue if I borked it or not.

OLD CODE

    def terminal_update(self):
        i = 0
        for j, scene in enumerate(self.scene_stack):
            if scene.covers_screen:
                i = j
        for scene in self.scene_stack[i:]:
            scene.terminal_update(scene == self.scene_stack[-1]) #THIS PRODUCES AN ERROR
        return not self.should_exit

MY JANKY ATTEMPT

     def terminal_update(self):
        i = 0
        for j, scene in enumerate(self.scene_stack):
            if scene.covers_screen:
                i = j
        for scene in self.scene_stack[i:]:
            scene = self.scene_stack[-1]#<=== EDITED THIS
            scene.terminal_update()
        return not self.should_exit

That said, it now works but no clue if I ruined any other features.

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.