Re: Earwax

So I've tried to use this, keyword being... tried. I have a lot of questions, like, a lot.
I mainly decided to give this another whirl because of the comment on another topic that one could subclass earwax levels and games and avoid decorators. I'm not particularly against using them, but looking at lucky thirteen's source, one file of it, made me concerned. It's 360 lines. Not a lot, but you're essentially forced to define all the level and game logic in one file. For me, this is kind of an issue, hence subclassing.
Trouble is, I can't figure out how. Looking at earwax source, there's this "magical" decorator action inside the level class. I tried going @action, @action_map.action, nothing. The provided examples only use @level.action logic, which doesn't really help me when trying to understand where this function comes from.
Looking further into the examples, in the basic.py, there are yield statements inserted here and there without an explanation as to the necessity behind their presence, I.e:

def set_title() -> OptionalGenerator:
    """Set the window title to the given text."""
    if g.window is not None:
        g.output(f'Window title: {g.window.caption}')
        yield
        e: Editor = Editor(g, text=g.window.caption)

How do you know that you need a yield statement here?
At the top of the basic.py file, you have this:

if True:
    sys.path.insert(0, '..')

Why do you even need the "if True" if the condition is axiomatic by nature.
Lucky Thirteen and every example create all their objects at the start of the game. Problem is, what if my game has 100 levels (BK III style)? How can we create objects on the fly rather than be forced to initialize *everything* at the beginning regardless of where the user is.
If I do switch to decorators, how can I keep the file lengths at a reasonable length? Making even simple sidescrollers in one giant module sounds like an inefficient practice. Your map demo is 163 lines long, for instance. If I want to expand it to include some more rooms, it would grow, and fast, but the decorators require the level, or the board, or whatever entity you wish to give the function to, thus eliminating object creation on the fly.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : mohamed via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : GrannyCheeseWheel via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : BoundTo via Audiogames-reflector

Reply via email to