Status update

I just wanted to make a quick post about where Rubygame is now.

I finished the changes I mentioned last time about :left_shift and :right_shift being matched by :shift for keyboard triggers. Here's how I wrote the code, if you're curious:

# @mods is the array of modifiers for the trigger.
# evmods is the array of modifiers for the event.

def _mods_match?( evmods )
  @mods.all? { |mod|
    case mod
    when :alt, :ctrl, :meta, :shift
      evmods.include?("left_#{mod}".intern) or
        evmods.include?("right_#{mod}".intern)
    else
      evmods.include?(mod)
    end
  }
end

In addition to supporting general modifiers (vs left/right specific), this code is a lot more forgiving than before. Originally, I had just checked evmods == @mods, which was rather stupid of me, because [:shift, :ctrl] == [:ctrl, :shift] would fail, even though they are equivalent in this context.

All the work that remains for 2.4 is writing documentation and specs for the event actions, event hook, and the HasEventHandler mixin. Unfortunately, that's not the kind of work that motivates me to take time out of my day to finish it. I've got the 2 hours per week scheduled, but I may need to increase that and push hard until 2.4 is done.


Comments

John Croisant submitted a comment on #

Blargh, I just realized there are no joystick event triggers. I don’t think I’m going to bother. You can simulate them with KindOfTrigger and AttrTrigger anyway.

sparkymat submitted a comment on #

Which git branch should I use (till 2.4 comes out) ? Is it ‘event_handler’ (which is newer) or ‘dev-2.4’ (which sounds more appropriate) ? Which of these will become Rubygame 2.4?

John Croisant submitted a comment on #

If you want the event stuff, you should use event_handler. When I’m done, that branch will be merged into dev-2.4.

shawn42 submitted a comment on #

It doesn’t pertain to this blog post. But, I got Rubygame running on ruby 1.9 pretty easily. Keep up the good work.

sparkymat submitted a comment on #

… any updates on the status of 2.4?

Have something interesting to add to the discussion? Email your thoughtful comments to comments@rubygame.org.